Page 19 sur 23

Re: Jedicut and Arduino over USB

Posté : dim. nov. 06, 2016 6:28 pm
par AERODEN
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

Re: Jedicut and Arduino over USB

Posté : lun. nov. 07, 2016 5:59 pm
par Christopher
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

Posté : lun. nov. 07, 2016 6:07 pm
par Christopher
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

Posté : lun. nov. 07, 2016 6:18 pm
par AERODEN
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

Re: Jedicut and Arduino over USB

Posté : lun. nov. 07, 2016 6:30 pm
par Christopher
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.....

Re: Jedicut and Arduino over USB

Posté : lun. nov. 07, 2016 6:37 pm
par AERODEN
Congratulations on your successful efforts

Re: Jedicut and Arduino over USB

Posté : lun. janv. 30, 2017 6:37 pm
par Sebastien
Hi, I have made an adapter with arduino nano and DB25 cable.
Could you tell me where I can dowload the sketch file, and the jedicut plugin, to make it work?

Many thanks!
Sebastien

Re: Jedicut and Arduino over USB

Posté : lun. janv. 30, 2017 7:41 pm
par Jerome
Hi,

Do you build the adaptor based on arduino described in this discussion ?

Re: Jedicut and Arduino over USB

Posté : lun. janv. 30, 2017 9:17 pm
par Sebastien
Hi, of course it's this adaptor.

Sebastien

Re: Jedicut and Arduino over USB

Posté : ven. févr. 03, 2017 12:54 pm
par Jerome
Hi,

Do you find what you search ? The plugin is now included in Jedicut's setup file. And firmware is available on Aeropassion's GitHub page : https://github.com/jerome-aeropassion/j ... /USBSerial