Forum Replies Created
-
AuthorPosts
-
July 22, 2016 at 7:30 pm in reply to: TinyG with external drivers: J19 (motor3) and J20 (motor 4) don't work #9855lquirozMember
Hi Splocal,
I am sorry to take a while to answer you. The driver I use is a cheap M542T and you can buy from:
http://www.omc-stepperonline.com/24-phase-nema-23-stepper-motor-driver-2450vdc-15a45a-256-microstep-m542t-p-293.htmlFour of this drives are working fine on each mill controlled by tinyg with a configuration X, doubleY, Z and the mentioned modification to firmware of tinyg.
I hope it will help you.
March 14, 2016 at 9:21 pm in reply to: TinyG with external drivers: J19 (motor3) and J20 (motor 4) don't work #9428lquirozMemberI found a solution to adapt the pulse width to needs of external drivers.
Warning! I have not evaluated yet the impact on the performance (and I am not a programmer).
I modified stepper.c adding a delay as a function#include <util/delay.h>
void delay(int us) {
while(us–) { // loop adds some overhead
_delay_us(1);
}
}and inside of each “if” in ISR(TIMER_DDA_ISR_vect) I put a delay of 2 and followed by step bit off:
if ((st_run.mot[MOTOR_4].substep_accumulator += st_run.mot[MOTOR_4].substep_increment) > 0) {
PORT_MOTOR_4_VPORT.OUT |= STEP_BIT_bm;
st_run.mot[MOTOR_4].substep_accumulator -= st_run.dda_ticks_X_substeps;
INCREMENT_ENCODER(MOTOR_4);
delay(2);
PORT_MOTOR_4_VPORT.OUT &= ~STEP_BIT_bm;
}
Without the delay I had a pulse width of 1.4 us . Now pulse width for all motors is 3.4us. I measure this with an oscilloscope.
Now J19 and J20 are working and I know why.
I hope it will be helpful for all people that tried to use external drivers with tinyg.February 22, 2016 at 2:33 pm in reply to: TinyG with external drivers: J19 (motor3) and J20 (motor 4) don't work #9371lquirozMemberSorry. I forget to mention it. I return to 440.20 before the test with $tr=40.
Thanks you for your concern.February 22, 2016 at 8:42 am in reply to: TinyG with external drivers: J19 (motor3) and J20 (motor 4) don't work #9369lquirozMembercmcgrath: Thank you for your answer.
Before to send my post here I read all posts related to external drivers and pulse width.
You are right. My parameters are for a screw drive machine.
I do some test with all $_tr=40, as you suggested, but I have the same results.Exploring the code I found on stepper.c
// pulse stretching for using external drivers.- turn step bits off
PORT_MOTOR_1_VPORT.OUT &= ~STEP_BIT_bm; // ~ 5 uSec pulse width
PORT_MOTOR_2_VPORT.OUT &= ~STEP_BIT_bm; // ~ 4 uSec
PORT_MOTOR_3_VPORT.OUT &= ~STEP_BIT_bm; // ~ 3 uSec
PORT_MOTOR_4_VPORT.OUT &= ~STEP_BIT_bm; // ~ 2 uSecbetween 530 and 534 lines. I am not a programmer but I see some code done to provide longer pulses for external drivers. Comments show me that the pulse width is not the same for all ports. Am I right?
cmcgrath: May be I must start a new thread on pulse width? PW of 4-5us is fine but only if we have the same in all ports.Thanks you again.
February 20, 2016 at 8:35 pm in reply to: TinyG with external drivers: J19 (motor3) and J20 (motor 4) don't work #9367lquirozMemberBecause of https://github.com/synthetos/TinyG/issues/61, I downgrade the firmware to 412.01 on one board to see if I can have 5μs that scottcarlson found.
I mesure now:
J17: 5.2 μs (same)
J18: 4.0 μs (a bit lower)
J19: 4.0 μs (greater)
J20: 1.4 μs (same)So, now the driver connected to J19 works fine, of course. Also J17 and J18.
Someone else could compare my mesurements with his/her board?
I cannot figure out why I have different pulse width on each port. It was programmed intentionally like that?
Thanks in advance for any help.February 19, 2016 at 8:34 pm in reply to: TinyG with external drivers: J19 (motor3) and J20 (motor 4) don't work #9365lquirozMemberThanks cmcgrath for your answer.
The setup on both boards is a X,double Y,Z. One board is set with 1.25 mm/rev and the other one with 5 mm/rev. There is some differences with speeds also.
The firmware on both boards is 440.20 version 0.97
I use Coolterm or ChiliPeppr. The behavior is the same (same pulse width)
Here are the links to both boards parameter configuration.
https://www.dropbox.com/s/jfz9g7c8n3fl5jg/TinygV8-1.txt?dl=0
https://www.dropbox.com/s/bhdagnianrsqmk8/TinygV8-2.txt?dl=0
I have connected four stepper motors to one board outputs. Of course the four motors work fine because the on board drivers can handle pulse width of less than 1μs (at my knowledge)
Thanks you for your time.February 18, 2016 at 7:44 pm in reply to: TinyG with external drivers: J19 (motor3) and J20 (motor 4) don't work #9359lquirozMemberI have the following measures of pulse width:
J17: 5.2 μs
J18: 5.2 μs
J19: 2.5 μs
J20: 1.4 μsSo, there are a difference in firmware for each port. Is it normal?
This could explain that J19 and J20 doesn’t work. May be the drivers don’t really like 2.5us (in spite of specification of >1.5μs) or 1.4us (well, it is under 1.5μs)
Do you know where to change this settings if it can be done?
Someone could say me or test (I don’t know how to do it) if the DIR signal is ahead of PUL signal by 5μs at least?Thanks again.
February 18, 2016 at 6:43 pm in reply to: TinyG with external drivers: J19 (motor3) and J20 (motor 4) don't work #9358lquirozMemberThank you for your answer.
Both boards are 131v8h
I tested each external driver (four) connecting each one to only one conector (J18) and every one works fine. No one of the four external drivers works fine connected to J19 or J20 connector. That means to me that the driver is not the problem.
I don’t know very much about the input side of the external drive, except the connection information http://www.omc-stepperonline.com/images/typical-connection-m542.jpg. It seems to have opto-isolation.
I tested again with 3.3V to 5V level shifting for J19 connector. I have the same behavior. The same driver connected to a level shifted J19 doesn’t work but connected to a level shifted J18 works fine.
When I send movements commands without drivers connected the four green leds are lit and then go off, no matter what axis is driven. I have $3pm=2 and $4pm=2.
I was thinking about timing or pulse width. Could be different for J19 or J20 compared to J17 or J18?
The driver specification says: “For reliable response, pulse width should be longer than 1.5μs” and “For reliable motion response, DIR signal should be ahead of PUL signal by 5μs at least” I will try to measure pulse width.
Thanks again for any help. -
AuthorPosts