#1
vibram En ligne le 14/08/2021 à 13:29 (54 messages sur soudeurs.com)

Sujet : Proposition Pédale de soudage V2

22/06/2016 09:32:36

Salut à tous,
Suite à mon premier sujet ici: http://www.soudeurs.com/fronius-conseils-et-choix-du-materiel-de-soudage/16089-montage-diffuseur-grille-sur-torche-fronius.html
je vous expose l'avancée de la version 2, un peu plus élaborée.

Je conserve les bases de la V1 à savoir:
Un arduino (mega pour la V2)
Un potentiomètre actionné par la pédale
Des mosfet afin d'isoler le TIG de l'arduino

Pour la V2, j'ajoute:
Un afficheur LCD déporté
Des réglages d'ampérage min et max, de la tolérance
Une mesure du courant de soudage via capteur à effet hall

J'ai deux deux modules.
Un premier boitier avec afficheur LCD, 3 encodeurs rotatifs et un potentiomètre.
Chaque encodeur rotatif permet de régler:
l’ampérage minimum
l’ampérage maximum
La tolérance entre ampérage théorique et réel
le potentiomètre permet de régler la luminosité du LCD

Ce module va être relié à l'arduino situé dans la pédale.
La pédale va actionner le potentiomètre. L'arduino va lire la valeur du potentiomètre et calculer le courant théorique.
Exemple: la lecture du potentiomètre va donner une valeur entre 0 et 1023
Si on définit l'ampérage minimum à 40 et le max à 80, une valeur de 300 au potentiomètre va donner 51.7A
550 au potentiomètre va donner : 61.5A etc
Le courant théorique est comparé au courant réel + ou - la tolérance. L'arduino envoie ensuite la commande adaptée ( amp -, amp + ou ne rien faire).

Actuellement, j'ai tout testé avec succès sur la partie gestion de l'affichage LCD, paramétrage des ampérages, tolérance...
Il me reste à vérifier la fiabilité de la lecture du capteur à effet hall et de l'action de l'arduino en fonction du résultat et vérifier qu'il n'y ai pas de problème de variable etc (même si en théorie j'ai déclaré mes variables pour éviter cela...)

Voici le code dans l'état actuel, bien entendu, je me décharge de toute responsabilité en cas de dommages !

[CODE]
// Made by Paul Sauvignac
// License: CC-BY-NC-SA 3.0

#include

#define GapPinA 2 // PE4
#define GapPinB 3 // PE5
#define AmpMinPinA 18 //PD2
#define AmpMinPinB 19 //PD3
#define AmpMaxPinA 20 //PD1
#define AmpMaxPinB 21 //PD0
#define on 4 // On pin
#define up 5 // Up amp pin
#define down 6 // Down amp pin

LiquidCrystal lcd(12, 11, 7, 8, 9, 10); //LCD parameters

volatile byte GapaFlag = 0; // let's us know when we're expecting a rising edge on pinA to signal that the encoder has arrived at a detent
volatile byte GapbFlag = 0; // let's us know when we're expecting a rising edge on pinB to signal that the encoder has arrived at a detent (opposite direction to when aFlag is set)
volatile byte AmpMinaFlag = 0; // let's us know when we're expecting a rising edge on pinA to signal that the encoder has arrived at a detent
volatile byte AmpMinbFlag = 0; // let's us know when we're expecting a rising edge on pinB to signal that the encoder has arrived at a detent (opposite direction to when aFlag is set)
volatile byte AmpMaxaFlag = 0; // let's us know when we're expecting a rising edge on pinA to signal that the encoder has arrived at a detent
volatile byte AmpMaxbFlag = 0; // let's us know when we're expecting a rising edge on pinB to signal that the encoder has arrived at a detent (opposite direction to when aFlag is set)
volatile byte GapencoderPos = 0; //this variable stores our current value of encoder position. Change to int or uin16_t instead of byte if you want to record a larger range than 0-255
volatile byte GapoldEncPos = 0; //stores the last encoder position value so we can compare to the current reading and see if it has changed (so we know when to print to the serial monitor)
volatile byte Gapreading = 0; //somewhere to store the direct values we read from our interrupt pins before checking to see if we have moved a whole detent
volatile byte AmpMinencoderPos = 0; //this variable stores our current value of encoder position. Change to int or uin16_t instead of byte if you want to record a larger range than 0-255
volatile byte AmpMinoldEncPos = 0; //stores the last encoder position value so we can compare to the current reading and see if it has changed (so we know when to print to the serial monitor)
volatile byte AmpMinreading = 0; //somewhere to store the direct values we read from our interrupt pins before checking to see if we have moved a whole detent
volatile byte AmpMaxencoderPos = 0; //this variable stores our current value of encoder position. Change to int or uin16_t instead of byte if you want to record a larger range than 0-255
volatile byte AmpMaxoldEncPos = 0; //stores the last encoder position value so we can compare to the current reading and see if it has changed (so we know when to print to the serial monitor)
volatile byte AmpMaxreading = 0; //somewhere to store the direct values we read from our interrupt pins before checking to see if we have moved a whole detent
boolean state = 0; // state at startup
boolean laststate = 0; // state after startup
int value = 0; // Potentiometer value
int oldvalue = 0; // Potentiometer value of last read
const int start = 30; // Potentiometer value for startup
const int duration = 300; // delay of each loop in ms
unsigned int push = 50; // duration of each push button in ms
unsigned int current = 0; // theoretical value in current from potentiometer
unsigned int ActualCurrent = 0; // Current measured by Hall sensor
// unsigned long previousMillis = 0; // last time loop done
int mVperAmp = 10; // See Scale Factors
int ACSoffset = 2500; // See offsets
int RawValue= 0;
unsigned int Voltage = 0;


void setup() {
pinMode(GapPinA, INPUT_PULLUP); // set pinA as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)
pinMode(GapPinB, INPUT_PULLUP); // set pinB as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)
pinMode(AmpMinPinA, INPUT_PULLUP); // set pinA as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)
pinMode(AmpMinPinB, INPUT_PULLUP); // set pinB as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)
pinMode(AmpMaxPinA, INPUT_PULLUP); // set pinA as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)
pinMode(AmpMaxPinB, INPUT_PULLUP); // set pinB as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)
pinMode(A0, INPUT); // pedal potentiometer
pinMode(A1, INPUT); // Hall current sensor
digitalWrite(on, LOW); // default state ON
digitalWrite(up, LOW); // default state UP
digitalWrite(down, LOW); // default state DOWN
pinMode(up, OUTPUT);
pinMode(down, OUTPUT);
pinMode(on, OUTPUT);
attachInterrupt(digitalPinToInterrupt(GapPinA), GapMinusPinA,RISING); // set an interrupt on PinA, looking for a rising edge signal and executing the "PinA" Interrupt Service Routine (below)
attachInterrupt(digitalPinToInterrupt(GapPinB), GapPlusPinB,RISING); // set an interrupt on PinB, looking for a rising edge signal and executing the "PinB" Interrupt Service Routine (below)
attachInterrupt(digitalPinToInterrupt(AmpMinPinA), AmpMinMinusPinA,RISING); // set an interrupt on PinA, looking for a rising edge signal and executing the "PinA" Interrupt Service Routine (below)
attachInterrupt(digitalPinToInterrupt(AmpMinPinB), AmpMinPlusPinB,RISING); // set an interrupt on PinB, looking for a rising edge signal and executing the "PinB" Interrupt Service Routine (below)
attachInterrupt(digitalPinToInterrupt(AmpMaxPinA), AmpMaxMinusPinA,RISING); // set an interrupt on PinA, looking for a rising edge signal and executing the "PinA" Interrupt Service Routine (below)
attachInterrupt(digitalPinToInterrupt(AmpMaxPinB), AmpMaxPlusPinB,RISING); // set an interrupt on PinB, looking for a rising edge signal and executing the "PinB" Interrupt Service Routine (below)
Serial.begin(9600); // start the serial monitor link

// LCD display
lcd.begin(20,4);
lcd.setCursor(0, 0);
lcd.print("Set parameters");
lcd.setCursor(0, 1);
lcd.print("with buttons below");
delay(3000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Amp min:");
lcd.setCursor(10, 0);
lcd.print(AmpMinencoderPos);
lcd.setCursor(0, 1);
lcd.print("Amp max:");
lcd.setCursor(10, 1);
lcd.print(AmpMaxencoderPos);
lcd.setCursor(0, 2);
lcd.print("Gap:");
lcd.setCursor(5, 2);
lcd.print(GapencoderPos);
lcd.setCursor(0,3);
lcd.print("Real|Theo: ");
lcd.setCursor(12,3);
lcd.print(ActualCurrent);
lcd.setCursor(15,3);
lcd.print("|");
lcd.print(current);
}
// GAP Move

void GapMinusPinA(){
cli(); //stop interrupts happening before we read pin values
Gapreading = PINE & 0x30; // read all eight pin values then strip away all but pinA and pinB's values
if(Gapreading == B00110000 && GapaFlag) { //check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
GapencoderPos --; //decrement the encoder's position count
GapbFlag = 0; //reset flags for the next turn
GapaFlag = 0; //reset flags for the next turn
}
else if (Gapreading == B00010000) GapbFlag = 1; //signal that we're expecting pinB to signal the transition to detent from free rotation
lcd.setCursor(5, 2);
lcd.print(" ");
lcd.setCursor(5, 2);
lcd.print(GapencoderPos);
sei(); //restart interrupts
}

void GapPlusPinB(){
cli(); //stop interrupts happening before we read pin values
Gapreading = PINE & 0x30; //read all eight pin values then strip away all but pinA and pinB's values
if (Gapreading == B00110000 && GapbFlag) { //check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
GapencoderPos ++; //increment the encoder's position count
GapbFlag = 0; //reset flags for the next turn
GapaFlag = 0; //reset flags for the next turn
}
else if (Gapreading == B00100000) GapaFlag = 1; //signal that we're expecting pinA to signal the transition to detent from free rotation
lcd.setCursor(5, 2);
lcd.print(" ");
lcd.setCursor(5, 2);
lcd.print(GapencoderPos);
sei(); //restart interrupts
}
// AMP MIN MOVE
void AmpMinMinusPinA(){
cli(); //stop interrupts happening before we read pin values
AmpMinreading = PIND & 0x0C; // read all eight pin values then strip away all but pinA and pinB's values
if(AmpMinreading == B00001100 && AmpMinaFlag) { //check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
AmpMinencoderPos --; //decrement the encoder's position count
AmpMinbFlag = 0; //reset flags for the next turn
AmpMinaFlag = 0; //reset flags for the next turn
}
else if (AmpMinreading == B00000100) AmpMinbFlag = 1; //signal that we're expecting pinB to signal the transition to detent from free rotation
lcd.setCursor(10, 0);
lcd.print(" ");
lcd.setCursor(10, 0);
lcd.print(AmpMinencoderPos);
sei(); //restart interrupts
}

void AmpMinPlusPinB(){
cli(); //stop interrupts happening before we read pin values
AmpMinreading = PIND & 0x0C; //read all eight pin values then strip away all but pinA and pinB's values
if (AmpMinreading == B00001100 && AmpMinbFlag) { //check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
AmpMinencoderPos ++; //increment the encoder's position count
AmpMinbFlag = 0; //reset flags for the next turn
AmpMinaFlag = 0; //reset flags for the next turn
}
else if (AmpMinreading == B00001000) AmpMinaFlag = 1; //signal that we're expecting pinA to signal the transition to detent from free rotation
lcd.setCursor(10, 0);
lcd.print(" ");
lcd.setCursor(10, 0);
lcd.print(AmpMinencoderPos);
sei(); //restart interrupts
}

// AMP MAX MOVE
void AmpMaxMinusPinA(){
cli(); //stop interrupts happening before we read pin values
AmpMaxreading = PIND & 0x03; // read all eight pin values then strip away all but pinA and pinB's values
if(AmpMaxreading == B00000011 && AmpMaxaFlag) { //check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
AmpMaxencoderPos --; //decrement the encoder's position count
AmpMaxbFlag = 0; //reset flags for the next turn
AmpMaxaFlag = 0; //reset flags for the next turn
}
else if (AmpMaxreading == B00000001) AmpMaxbFlag = 1; //signal that we're expecting pinB to signal the transition to detent from free rotation
lcd.setCursor(10, 1);
lcd.print(" ");
lcd.setCursor(10, 1);
lcd.print(AmpMaxencoderPos);
sei(); //restart interrupts
}

void AmpMaxPlusPinB(){
cli(); //stop interrupts happening before we read pin values
AmpMaxreading = PIND & 0x03; //read all eight pin values then strip away all but pinA and pinB's values
if (AmpMaxreading == B00000011 && AmpMaxbFlag) { //check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
AmpMaxencoderPos ++; //increment the encoder's position count
AmpMaxbFlag = 0; //reset flags for the next turn
AmpMaxaFlag = 0; //reset flags for the next turn
}
else if (AmpMaxreading == B00000010) AmpMaxaFlag = 1; //signal that we're expecting pinA to signal the transition to detent from free rotation
lcd.setCursor(10, 1);
lcd.print(" ");
lcd.setCursor(10, 1);
lcd.print(AmpMaxencoderPos);
sei(); //restart interrupts
}

void loop(){




// unsigned long currentMillis = 0;
// if (currentMillis - previousMillis >= duration) {
// previousMillis = currentMillis;
// On-off
if (analogRead(A0)>start) {

state = 1;
}
else {
state = 0;
lcd.setCursor(16,3);
lcd.print(" ");
lcd.setCursor(16,3);
lcd.print("0");
}
// CHECK Serial.println(state);

if (!(state==laststate)) {
Serial.println("START");
digitalWrite(on, HIGH);
delay(push);
digitalWrite(on, LOW);
}
laststate=state;


//comparison between actual amp and theoretical value
if (analogRead(A0)>start) {
value = analogRead(A0);
ActualCurrent = analogRead(A1);
int current = map(value,0,1023,AmpMinencoderPos,AmpMaxencoderPos);
Serial.print("valeur potentiometre:");
Serial.println(value);
Serial.print("Courant theorique:");
Serial.println(current);
//lcd.setCursor(12,3);
//lcd.print(" ");
//lcd.setCursor(12,3);
//lcd.print(ActualCurrent);
lcd.setCursor(16,3);
lcd.print(" ");
lcd.setCursor(16,3);
lcd.print(current);
RawValue = analogRead(A1);
Voltage = (RawValue / 1023.0) * 5000; // Gets you mV
ActualCurrent = ((Voltage - ACSoffset) / mVperAmp);
// Serial.println("Actual current:");
// Serial.println(ActualCurrent);
if ((current + GapencoderPos) > ActualCurrent) {
digitalWrite(up, HIGH);
delay(push);
digitalWrite(up, LOW);
}
else if((current + GapencoderPos) < ActualCurrent) {
digitalWrite(down, HIGH);
delay(push);
digitalWrite(down, LOW);
}

}

if(GapoldEncPos != GapencoderPos) {
Serial.print("Gap:");
Serial.println(GapencoderPos);
GapoldEncPos = GapencoderPos;
}
if(AmpMinoldEncPos != AmpMinencoderPos) {
Serial.print("Amp min:");
Serial.println(AmpMinencoderPos);
AmpMinoldEncPos = AmpMinencoderPos;
}

if(AmpMaxoldEncPos != AmpMaxencoderPos) {
Serial.print("Amp max:");
Serial.println(AmpMaxencoderPos);
AmpMaxoldEncPos = AmpMaxencoderPos;
}
delay(duration); }[/CODE]

Si vous avez des remarques, réflexions ou même une requête pour un usage perso, n'hésitez pas
je mettrai à jour lorsque j'aurais avancé sur le module à effet hall

Sujets connexes les plus populaires

Question Posée Avis poste MMA, Fronius ou EWM ?

14/04/2017 13:42:03 - 1040 MC1
Réponses : 18
Affichages : 4625
yanng22
02/05/2017 20:30:13

Question Posée Copie conforme de poste à souder Fronius?

12/01/2013 23:23:08 - tungstene
Réponses : 8
Affichages : 11210
locouarn
12/12/2016 21:19:33

Question Posée Problème de HF sur Fronius Magicwave 2000 Fuzzy

30/11/2016 15:09:10 - SYLVAIN81
Réponses : 49
Affichages : 7497
locouarn
06/07/2018 08:29:00

[Résolu] Choix Fronius Magicwave, lequel? 1700 ou 2200

21/08/2009 12:27:20 - mci9698
Réponses : 1
Affichages : 5436
Admin dusweld1
22/08/2009 06:40:14

achat fronius

18/12/2007 14:02:00 - steph17
Réponses : 4
Affichages : 6837
ouakam160
19/12/2007 12:09:01

Question Posée Equipement manquant pour un TIG Fronius Magicwave 1700

25/04/2017 21:05:25 - comode
Réponses : 28
Affichages : 2595
shocker
24/11/2020 13:21:43

Question Posée Est que le Transpocket 150 peut faire le pulsé en MMA ?

09/02/2018 18:17:07 - nico1992
Réponses : 16
Affichages : 1380
gildas56
24/05/2021 16:00:51

Question Posée Les consommables Fronius sont-ils propriétaires?

18/10/2015 15:50:22 - Tharkey
Réponses : 29
Affichages : 4256
panpinou
28/12/2020 17:51:19

Question Posée Galère à paramétrer FRONIUS DIGIPULS 320 !

21/11/2017 18:51:58 - Weldeur
Réponses : 4
Affichages : 1107
tungstene
22/11/2017 22:31:57

Fronius MAGICWAVE 2000 HELP!!!

19/02/2009 10:11:05 - nonoplan
Réponses : 3
Affichages : 6539
21/02/2009 19:40:32

Proposition Connecteur spécial de torche non Fronius sur poste TIG FRONIUS

30/11/2013 07:33:40 - Dominique ADMIN
Réponses : 3
Affichages : 3524
tungstene
20/06/2017 08:27:51

Fronius Transteel 5000

19/01/2010 16:46:04 - waguize
Réponses : 1
Affichages : 4362
Admin dusweld1
24/01/2010 08:33:03

Question Posée Montage diffuseur à grille sur torche fronius

26/04/2016 18:41:07 - vibram
Réponses : 42
Affichages : 8374
shocker
25/10/2020 12:26:46

Recherche Magic Wave 2000 fuzzy

07/11/2013 12:36:28 - yanng22
Réponses : 18
Affichages : 4957
rldfer83
24/12/2021 13:40:26

Question Posée Fronius VarioStar 2500

08/04/2016 16:20:11 - cesyone
Réponses : 11
Affichages : 2757
cesyone
10/04/2016 17:10:30
Réponses : 8
Affichages : 2837
peekwood33
28/11/2013 22:01:27

Solution reglage pre gaz fronius transtig 1750 plus

01/10/2015 12:33:49 - cigarillos
Réponses : 0
Affichages : 1460
cigarillos
01/10/2015 12:33:49

Magic wave Fronius ou Castolin ?

28/02/2010 21:12:00 - ALUALU
Réponses : 2
Affichages : 5969
01/03/2010 18:22:32

Question Posée hardfacing sur FRONIUS TRANSPUL SYNERGIC 3200

11/10/2017 16:40:25 - vulcain79
Réponses : 9
Affichages : 1281
yanng22
24/10/2018 19:21:35

Question Posée Fronius Magic Wave 2000 Fuzzy rectangular connector

05/07/2017 22:48:48 - boky043
Réponses : 6
Affichages : 936
shocker
08/11/2020 10:36:12