Re: Jedicut and Arduino over USB

181
Bonsoir,

Le m'appelle Alain de France.

Je suis content de vous lire, je suis désolé de répondre en français , Google peut vous aider en traduction.

Je suis sur un projet de Arduino Mega 2560 + Ramps 1.4 avec A4988 Voir sur le forum : http://www.aeropassion.net/forums/read.php?5,9691

Tout fonctionne correctement, j'ai simplement un problème de vitesse rapide.

Attention pour commander les drivers A4988 "moteur ON" il faut inverser la commande "1" driver bloqué, "0" Moteur ON.
Voici ma modification:

[pre]void handleCommand()
{

byte val = cmdArray[arrayIdxRead + 1]; // The command parameter value
switch (cmdArray[arrayIdxRead])
{
case 'A': // All Motors on/off
if (val == '1' & (digitalRead (Int_Mot) == LOW)) {
Jed_Mot_Off = 0; // "0" déblocage driver
}
else {
Jed_Mot_Off = 1; // "1" blocage driver
}
Gest_Cde_Mot_ON();

[/pre]


& (digitalRead (Int_Mot) == LOW) : c'est mon interrupteur ON/OFF de tous mes moteurs.
Gest_Cde_Mot_ON() : c'est la fonction qui commande plusieurs ports pour les drivers de la RAMPS 1.4.

Cordialement
Alain
Je vous invite sur mon blog :
http://alainfelixdenis.wordpress.com/
sur mon site :
http://www.aeroden.fr

Re: Jedicut and Arduino over USB

182
Okay. My french lessons in school are some years back and Google translation is crap as usual :D

From what I understand you mentioned two points.

a) The enable pin is inverted on the A4988 then to other stepper drivers, and your code is correcting it. To not mess up with the code I just went and rejumpered the pin so that the motors are always enabled.

b) The timing in the Arduino sketch is to fast for the A4988. So I increased the delays in the sendMotorCmd() function. But also without a good result.

Re: Jedicut and Arduino over USB

183
Just ran along the Pins for controlling the stepper drivers with an led. regardless of using a programm or driving the steppers manually the led hasn't indicated anything. No stepping, no direction pin change. So I think it's a problem with the communication...

Shouldn't I see any data through the serial monitor when sending commands from jedicut to the arduino as well?

Re: Jedicut and Arduino over USB

184
Bonsoir,

Voici les retards dans la fonction sendMotorCMD()

[pre]
void sendMotorCmd(byte cmd)
{

Mot_Dir = (Mot_Dir & 0x0F) | (cmd & 0xf0); // Directions first!
ValCommDir();
delayMicroseconds(1); // eventually wait a little bit

Mot_Ck = (Mot_Ck & 0xF0) | (cmd & 0x0f); // and step
ValCommStep();
delayMicroseconds(5); // eventually wait a little bit
// and falling edge of step pulse
Mot_Ck = (Mot_Ck & 0xF0);
ValCommStep();

}
[/pre]

Délay pour A4988

A+ Alain
Je vous invite sur mon blog :
http://alainfelixdenis.wordpress.com/
sur mon site :
http://www.aeroden.fr

Re: Jedicut and Arduino over USB

185
God damn it.... guess how's the biggest idiot in this forum. Hint: It's me! :P

I was searching through the code to find anything that could be wrong when the sendMotorCmd function catches my attention again. It's not working with the "Arduino Pins" which get initiated in the setup routin. It's communicating directly to the ports PORTD and PORTB. And quess what: On the Mega the pins initiated for the steps and directions (pin 4 - 11) are not located on these ports. They are located on PORTF and PORTK -_-

So back to an trusty Arduino Uno the motors are working.....
`); }); })(jQuery, window, document, phpbb);