Hi Nigel,
the comport.ini is a file in the jedicut directory. To change the baudrate for jedicut, you only need to change the value in this file and in the arduino code.
When disconnecting the direction pin, the logical input to TB6560 is not defined, but may be held internally low or high. This commands a specific rotation direction. Manfred may be right when he assumes problems in the timing of the pulses for direction.
If your board has positive logic the sequence looks like this:
pulsetiming.jpg
Vu 5373 fois 9.38 Kio
We have here 3 timing values
- d1 - the time the direction must be valid before the step pulse has its rising edge
- d2 - the time the step pulse must me valid (high)
- d3 - the time the direction level must be valid after the falling edge of the step pulse
You can modify this values in the arduino code:
[pre]
void sendMotorCmd(byte cmd)
{
PORTD = (PORTD & 0x0F) | (cmd & 0xf0); // Directions first!
delayMicroseconds(150); // Delay d1 <-------------------------------------------------------
PORTB = (PORTB & 0xF0) | (cmd & 0x0f); // and step
delayMicroseconds(150); // eventually wait a little bit Delay d2 <-------------------------------------------------
// and falling edge of step pulse
PORTB = (PORTB & 0xF0);
delayMicroseconds(150); // Delay d3 <-------------------------------------------------------
}
[/pre]
The delay d3 is as long as the time to the next call to sendMotorCmd. If it's to short, you can add a delay after linr PORTB=... in the function. If your board steps on falling edge of step pulse, it may a good idea to add a delay d3.
Start with "high" values (150 us) for d1,d2,and d3 and reduce them until it starts to become unsmooth.
Martin