TMCStepper icon indicating copy to clipboard operation
TMCStepper copied to clipboard

TMC22XX UART stepping example

Open Flyguy opened this issue 3 years ago • 11 comments

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 ?

Flyguy avatar Jun 11 '21 12:06 Flyguy

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.

teemuatlut avatar Jun 11 '21 12:06 teemuatlut

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.

Flyguy avatar Jun 11 '21 12:06 Flyguy

The enable pin is active low, so you need to pull it gnd.

image

teemuatlut avatar Jun 11 '21 12:06 teemuatlut

изображение But what about this notice ?

Flyguy avatar Jun 11 '21 12:06 Flyguy

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.

teemuatlut avatar Jun 11 '21 12:06 teemuatlut

In other words you trying to say what i can't enable the driver in software ? (without hardware pins from mc)

Flyguy avatar Jun 11 '21 12:06 Flyguy

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.

teemuatlut avatar Jun 11 '21 12:06 teemuatlut

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.

MahOraibi avatar Jun 11 '21 17:06 MahOraibi

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.

Flyguy avatar Jun 12 '21 10:06 Flyguy

Hi @Flyguy did you can move by counting steps? Im in the same problem with a TMC2209. Tks

thecockroach avatar Sep 15 '23 20:09 thecockroach

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: @.***>

Flyguy avatar Sep 15 '23 21:09 Flyguy