TMCStepper
TMCStepper copied to clipboard
TMC22XX UART stepping example
I trying to move step motor with the uart only. I have used the folowed code:
TMC2209Stepper driver(&SERIAL_PORT, R_SENSE, DRIVER_ADDRESS);
void setup() {
driver.begin();
driver.toff(2);
driver.pdn_disable(true);
driver.rms_current(600);
driver.microsteps(16);
driver.pwm_autoscale(true);
}
void loop() {
Serial.println("vactual");
driver.VACTUAL(1000);
delay(1000);
}
With oscilloscope i have seen good datagram at tx. But driver did nothing.... What i doing wrong ?
Would be curious to see that you don't need to call SERIAL_PORT.begin(19200);
as the driver.begin()
does not do that for you. Perhaps you particular platform initializes it for you.
However, I don't see a call to pull the enable line low.
driver.begin()
already sets pdn_disable
so you don't need to do that yourself.
Hello teemuatlut! Thank you for your reply. I am sorry, I have dropped some info for you. I have forgotten add it to this piece of code. I have used Serial1.begin(115200); Platform is esp8266. Driver is tmc2226 I trying to enable the driver in software. EN pin is always hight with pull up 10k resistor.
The enable pin is active low, so you need to pull it gnd.
But what about this notice ?
Sounds like a boot time condition you should be aware about but I've never seen it to be a problem if the EN pin would be pulled low when powering on.
In other words you trying to say what i can't enable the driver in software ? (without hardware pins from mc)
One way or another you need to pull the enable line low in order to power on the coils.
EDIT: The condition seems to be just when using internal sense resistors, which is quite rare but you should follow the guideline if this happens to apply in your case.
Do you mind if I pop in for a question? are you trying to move the motor without other libraries like accelsteppr or step (high/low)? is that possible? I really would love to do that directly from the board rather than from another library.
Do you mind if I pop in for a question? are you trying to move the motor without other libraries like accelsteppr or step (high/low)? is that possible? I really would love to do that directly from the board rather than from another library.
I have tested it yesterday... It's so primitive. VACTUAL command will set a motor speed. Motor speed can't be big. Any acceleration will no work with it. Motor will miss all steps on 1-2 rev/sec. In my current requirements big speed not needed. But I need count steps. I will don't use it.
Hi @Flyguy did you can move by counting steps? Im in the same problem with a TMC2209. Tks
I have not used it. And it was long time ago.. But I think you can try to using the index pin for this.
пт, 15 сент. 2023 г., 23:51 Fernando Mazzaferro @.***>:
Hi @Flyguy https://github.com/Flyguy did you can move by counting steps? Im in the same problem with a TMC2209. Tks
— Reply to this email directly, view it on GitHub https://github.com/teemuatlut/TMCStepper/issues/200#issuecomment-1721851874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI5LECF65KKUUEMSIUIZHLX2S5URANCNFSM46QTFE6Q . You are receiving this because you were mentioned.Message ID: @.***>