last day (41 days later) » 

4:52 PM
1
Q: TMC2130 Stepper Motor on Raspberry Pi. SPI issue?

johnFor the last few days I've been struggling to get a NEMA17 (1.5 rated current) stepper motor to function with TMC2120 driver (vref = 1.0) and I'm all out of options now to try, so I'm here looking for some help. I think it may be SPI related due to me not getting back expected results on statuses...

 
1. I think your SPI hardware and software looks more or less OK. 2. But why frequency set so low? 3. Have you ever tried to use a square wave sig gen to move the motor?
4. Of course you also need to use jumper wires to manually config the driver first.
 
1. thanks, it's nice to know that matches what I think it should be. 2. The frequency is low because that's all that seemed to get the correct output on PISCOPE, but I think that might be an issue with Piscope than anything else from what I've read recently. 3. I haven't tried this no, I presume it's software based so I'll give it a google to try today (feel free to point me to any scripts/resources on it if you have any handy)
 
Ha, when I started playing with my tmc2209 a while ago, I skimmed the data sheet and used jumper wires to config, and a sig gen to send the steps, and the motor started moving happily.
You might like to go to Rpi SE and search tmc2209 to find my tldr answer!
Two more things. (1) You seem to forget to initialize the ENABLE pin. (2) When you clean up GPIO, all GPIO output pins would automatically return to INPUT mode. This is a trap to many newbies.
 
Thanks. I've been tying the ENABLE pin to ground which is 0 I believe? The SPI screengrab above doesn't seem to say that though so I'll double check. I have tried via a GPIO pin too though. The response issue I was having looks like it's due to it being sent on the next request for reads, so I'm playing with that now to check outputs and errors now I can.
 
Yes, I am reading the tmc2130 datasheet and now understand why you missed the "pin operation mode". In tmc2209 datasheet, this "standalone or pin mode" is clearly explained. (4) Ref: TMC2130 DATASHEET (Rev. 1.10 / 2018-MAY-09) Page 5 trinamic.com/fileadmin/assets/Products/ICs_Documents/… Section 1 - Principles of Operation THE TMC2130 OFFERS THREE BASIC MODES OF OPERATION: / to continue, ...
(1) In Step/Direction Driver Mode, the TMC2130 is the microstep sequencer and power driver between a motion controller and a two phase stepper motor. Configuration of the TMC2130 is done via SPI. (2) In Standalone Mode, the TMC2130 can be configured using pins. In this mode of operation CPU interaction is not necessary, ... (3) The third mode of operation is the SPI Driver Mode, ...
Perhaps what is confusing is that, in standalone/pin mode, no cpu/mpu is necessary, but you do need a square wave pulse/PWM/(Step) signal generator to send the step signal.
(1) My enable pin function is something like this: def tmcStartMotor(enblPin): setGpOutPinLow(enblPin) return (2) This is a complete listing of my still buggy Pico MicroPython program: penzu.com/p/6f3b4f94.
 
4:52 PM
I've tried with the enable pin and still no luck. Running DRV_STATUS after each step is showing s2ga as 1 though? Any idea what that could be?
Looking at my chip it's a SPI version so I should be able to use operation mode 1 or 3 in the datasheet I presume. Another thing to add it that when I run my stepping script, sometimes it ends with the motor being in an active state (hard to move) and sometimes it's free to rotate. It seems strange that it'd be doing that to me, but I dont know how to debug the issue.
 

  last day (41 days later) »