Anyone figured out how to get Trinamic's TMC5160 drivers working with LinuxCNC?

More
1 year 8 months ago #322634 by 3404gerber
Hi,

I have uploaded a first development version of my module on github.

It has not been deeply tested and will probably have some bugs. But it connects to drivers on RPi4 and RPi5 and moves motors. I wrote a very short how-to, but feel free to ask questions about how to use it.
The following user(s) said Thank You: meister

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago #323167 by 3404gerber
Hi all,

I worked on the sensorless homing this week-end and it seems to work, at least on a single axis. I uploaded this video where you can see it in action. The code is a mess so I didn't upload it on github yet, and will first try it on a gantry system before publishing it. I also tried to connect a ABN magnetic encoder (AS5047P) directly on the TMC5160; I can read the encoder position through the X_ENC register and use it as feedback for LinuxCNC, as expected.

I'm not sure what next step will be; probably clean up the code a little and publish a "main" branch. I'd also like to try a Pi Zero 2 version without a GUI, actually without X-Server at all if that's possible, to see if this could be an option for OpenPNP users as a cheap yet powerfull motion controller.
The following user(s) said Thank You: meister

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #331939 by Yan_moto

I'm using those drivers currently. They are quite a beasty. It is possible to use them in standalone mode, but  i would advice against it if your motor is relatively low current (below 5A). I burnt one motor this way as setup of IRUN (with CFG pins) is half range up to full power - this is probably linear scale so 5 -10 A.

Best option is to have additional SPI capable device (arduino, rasperry pi, even 8081 probably would do) just to configure the driver(s).
Connect DIR/Step (and maybe DIAGs) to parallel/mesa card. 

Quite important to supply all 3 power inputs (took me some time to get figure this out)
- main board HV (0-60) 
- stepstick adapter VIO for logic (5V)
- stepstick adapter VM/ 24V (it can be lower - i'm  using 19.5V/4A now). As mentioned this input is exposed as VM on stepstick adapter - it should be used to  supply colling FAN but is also used to supply TMC internal voltage regulator and then some internal circuitry !!! 
As a observation it looks like this input require some power too like few amps (my 24V/1.6A died when suppling 3 drivers- was good with one).
 
Next step is just to tune parameters and you are set.


 
I did manage to get these boards to work in the mode I needed through SPI programming.
NEMA23 - 48v 3A
I measured the current on the 24V branch - 20-30mA when the engine was running.
Programming via SPI from STM32 has its own tricks, but it was actually very interesting!
 

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #332275 by Yan_moto
I connected two TMC5160 drivers and a NEMA17 motor (from another driver) to the 24V power supply. The video shows the current with the motor running, and the second part of the video shows the motor holding current when stopped.
Each of the TMC5160 drivers drives a motor at 3A.


Last edit: 1 year 3 months ago by Yan_moto.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Moderators: PCW, jmelson
Time to create page: 0.218 seconds
Powered by Kunena Forum