Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
projets:charly_robot_grbl:accueil [2017/03/16 10:52] resonance [Notes] |
projets:charly_robot_grbl:accueil [2018/01/18 13:07] (Version actuelle) resonance ancienne révision (2017/12/11 12:59) restaurée |
||
|---|---|---|---|
| Ligne 5: | Ligne 5: | ||
| * Description : Passer en GRBL une fraiseuse numérique Charlyrobot CRA4 | * Description : Passer en GRBL une fraiseuse numérique Charlyrobot CRA4 | ||
| - | {{tag> | + | {{tag>esadmm, ensadmm, |
| ===== Description ===== | ===== Description ===== | ||
| Ligne 34: | Ligne 34: | ||
| * L' | * L' | ||
| - | ==== Code test driver | + | ==== Code test drivers |
| Nous allons tester les moteurs et drivers un par un avec ce code test : | Nous allons tester les moteurs et drivers un par un avec ce code test : | ||
| Ligne 41: | Ligne 40: | ||
| {{: | {{: | ||
| - | ps : nous reglons | + | ps : nous règlons |
| * pour un maximum de courant : SW1,SW2,SW3 = OFF OFF OFF, SW4 = ON | * pour un maximum de courant : SW1,SW2,SW3 = OFF OFF OFF, SW4 = ON | ||
| - | * pour une resolution | + | * pour une résolution |
| <code c+> | <code c+> | ||
| - | //relier | + | //Relier |
| int dirPin = 2; | int dirPin = 2; | ||
| int pulPin = 3; | int pulPin = 3; | ||
| Ligne 53: | Ligne 52: | ||
| void setup(){ | void setup(){ | ||
| - | pinMode(dirPin, | + | |
| - | pinMode(pulPin, | + | pinMode(pulPin, |
| - | pinMode(enblPin, | + | pinMode(enblPin, |
| - | digitalWrite(enblPin, | + | digitalWrite(enblPin, |
| } | } | ||
| void loop(){ | void loop(){ | ||
| - | slide(' | + | |
| - | delay(2000); | + | delay(2000); |
| - | + | slide(' | |
| - | slide(' | + | delay(2000); |
| - | delay(2000); | + | |
| } | } | ||
| void slide(int dir, int steps, int sspeed){ | void slide(int dir, int steps, int sspeed){ | ||
| + | if (sspeed < 50) sspeed = 10; //keeps the speed above 10 | ||
| + | if (dir == ' | ||
| + | else if (dir == ' | ||
| - | if (sspeed < 50) sspeed = 10; //keeps the speed above 10 | + | while (steps > 0){ |
| + | digitalWrite(pulPin, | ||
| + | delayMicroseconds(10); | ||
| + | digitalWrite(pulPin, | ||
| + | delayMicroseconds(10); | ||
| + | delayMicroseconds(sspeed); | ||
| + | steps--; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| - | if (dir == ' | ||
| - | else if (dir == ' | ||
| - | while (steps | + | ==== Configuration GRBL ==== |
| - | digitalWrite(pulPin, HIGH); | + | Nous devons configurer le grbl ... |
| - | delayMicroseconds(10); | + | https:// |
| - | digitalWrite(pulPin, LOW); | + | |
| - | delayMicroseconds(10); | + | |
| - | delayMicroseconds(sspeed); | + | <code> |
| - | steps--; | + | |
| - | } | + | $0=10 (step pulse, usec) |
| - | } | + | $1=255 |
| + | $2=0 (step port invert mask: | ||
| + | $3=0 (dir port invert mask: | ||
| + | $4=1 (step enable invert, bool) | ||
| + | $5=1 (limit pins invert, bool) | ||
| + | $6=0 (probe pin invert, bool) | ||
| + | $10=3 (status report mask: | ||
| + | $11=0.010 | ||
| + | $12=0.002 (arc tolerance, mm) | ||
| + | $13=0 (report inches, bool) | ||
| + | $20=0 (soft limits, bool) | ||
| + | $21=0 (hard limits, bool) | ||
| + | $22=0 (homing cycle, bool) // homing ne marche pas bien , donc desactivé pour le moment | ||
| + | $23=4 (homing dir invert mask: | ||
| + | $24=250.000 (homing feed, mm/min) | ||
| + | $25=1500.000 (homing seek, mm/min) | ||
| + | $26=250 (homing debounce, msec) | ||
| + | $27=1.000 (homing pull-off, mm) | ||
| + | $100=640.000 (x, step/mm) | ||
| + | $101=640.000 (y, step/mm) | ||
| + | $102=640.000 (z, step/mm) | ||
| + | $110=3000.000 (x max rate, mm/min) | ||
| + | $111=3000.000 (y max rate, mm/min) | ||
| + | $112=500.000 (z max rate, mm/min) | ||
| + | $120=100.000 (x accel, mm/sec^2) | ||
| + | $121=100.000 (y accel, mm/sec^2) | ||
| + | $122=40.000 (z accel, mm/sec^2) | ||
| + | $130=320.000 (x max travel, mm) | ||
| + | $131=220.000 (y max travel, mm) | ||
| + | $132=80.000 (z max travel, mm) | ||
| </ | </ | ||
| - | ===== Photos ===== | ||
| - | Code pour afficher les images du projet : | ||
| - | < | ||
| + | |||
| + | <WRAP center | ||
| + | Si vous utilisé UGS le reglage de la vitesse de deplacement (Feedrate) manuelle est tres lente par defaut, il faut penser à la regler sinon vous penserez que ca ne marche pas ! | ||
| + | </ | ||
| + | |||
| + | note : sur WIn 10 UGS platform ne marche pas... il faut utiliser le Classic GUI il semble... | ||
| + | |||
| + | |||
| + | ==== Code allumage fraiseuse bouton de façade ==== | ||
| + | Nous avons choisi d' | ||
| + | Les boutons sont en pullUp, et le stop est inversé... de plus nous obtenons pas mal de bruit qui déclenche l' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | <code c+> | ||
| + | float Compteur = 0; | ||
| + | |||
| + | int StartBouton = 4; | ||
| + | int StopBouton = 5; | ||
| + | int RelayPin = 3; | ||
| + | |||
| + | void setup(){ | ||
| + | pinMode(StartBouton, | ||
| + | pinMode(StopBouton, | ||
| + | pinMode(RelayPin, | ||
| + | //Debug | ||
| + | Serial.begin(9600); | ||
| + | } // close setup | ||
| + | |||
| + | |||
| + | void loop() { | ||
| + | while (digitalRead(StartBouton) == LOW ){ | ||
| + | |||
| + | delay(100); | ||
| + | Compteur = Compteur + 100; | ||
| + | |||
| + | //Afficher le temps allumé | ||
| + | Serial.print(" | ||
| + | Serial.println(Compteur); | ||
| + | |||
| + | if (Compteur >= 600){ | ||
| + | digitalWrite(RelayPin, | ||
| + | Serial.print(" | ||
| + | } | ||
| + | |||
| + | } //close while | ||
| + | |||
| + | |||
| + | // attention le bouton stop est inversé ! | ||
| + | while (digitalRead(StopBouton) == HIGH ){ | ||
| + | |||
| + | delay(100); | ||
| + | Compteur = Compteur + 100; | ||
| + | |||
| + | //Afficher le temps allumé | ||
| + | Serial.print(" | ||
| + | Serial.println(Compteur); | ||
| + | |||
| + | if (Compteur >= 300){ | ||
| + | digitalWrite(RelayPin, | ||
| + | Serial.print(" | ||
| + | } | ||
| + | |||
| + | } //close while | ||
| + | |||
| + | //reset compteur | ||
| + | Compteur = 0; | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | === Photos === | ||
| + | {{gallery>?& | ||