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

More
08 Feb 2025 19:36 #321016 by amanker
I am using Octopus Pro board with remora-spi. Can you help me with working TMC5160 (stepsticks) drivers. Previously I used TMC5160 with tinybee board flashed with FluidNC in daisy chain config, they were working fine.

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

More
10 Feb 2025 18:47 #321180 by 3404gerber
From what I see in the Remora docs and source code, it only supports TMC2208/2209 with UART communication. As far as I know, the TMC5160 cannot be configured to use step/dir with UART configuration; it can only mix SPI and step/dir.

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

More
11 Feb 2025 15:18 #321238 by amanker
Yes. I wanted to communicate via spi only. Since I also configured it in spi mode in daisy chain config in FluidNC. Remora communicate with LinuxCNC via spi. If possible I can send spi config data to tmc via some module in LinuxCNC. Or if you modded remora-spi source to suit tmc 5160

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

More
11 Feb 2025 17:57 #321255 by meister
someone has probably done it:


I have now also ordered some to try to integrate them into RIO

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

More
11 Feb 2025 18:55 #321264 by 3404gerber
That was me, link is on page 1. :)
The following user(s) said Thank You: meister

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

More
11 Feb 2025 19:13 #321265 by 3404gerber

Yes. I wanted to communicate via spi only. Since I also configured it in spi mode in daisy chain config in FluidNC. Remora communicate with LinuxCNC via spi. If possible I can send spi config data to tmc via some module in LinuxCNC. Or if you modded remora-spi source to suit tmc 5160
 

If you can make a direct SPI connection between the Raspberry Pi and the TMC drivers, then it should be very easy to adapt my code; all it does is sending the registers value to the drivers according to values you set via parameters until all the registers have been set, and then it reads the motor position. And another function sends velocity command. You'd just need to remove the write velocity part (or, simply said, not addf TMC5160.write) and not connect the position feedback pin. In theory you could still use the SPI line to get TMC status bit and be informed if one driver has an error.

I want to try to control the SPI device on the RPi without the use of BCM2835 library to avoid compatibility problems. Give me a week to try and I'll publish my code after that. I didn't even try to modify the spi-remora code, as this is way above my coding skills.

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

More
12 Feb 2025 18:12 #321360 by amanker
I think if you look into remora code. They are also sending hex codes payoad via spi such as estop is 0x65737470.

If you would integrate that into remora then it would be more useful.

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

More
13 Feb 2025 06:33 #321417 by 3404gerber

I think if you look into remora code. They are also sending hex codes payoad via spi such as estop is 0x65737470.

If you would integrate that into remora then it would be more useful.
 

More useful to whom? I do have a RPi and TMC drivers and want to avoid to buy an extra device. And the tests I made with FluidNC showed me that I was not able to get smooth acceleration at higher rates, that's why I decided to go full SPI. Maybe the audience would be larger if I'd add the functionality to the Remora code, but it would be useless for me.

Yes, the Remora-spi LCNC module sends SPI data to... a microcontroller. The microcontroller then translates the message into steps, or digital ins/outs, among other. To make TMC5160 work with Remora you'll need to adapt the Remora firmware. There's already a part of the TMCStepper library implemented to work with TMC2208/2209 over UART, and you configure the drivers options in the Remora config file, not in LinuxCNC ( like explained here ). The TMC5160 over SPI is not implemented yet, but most of the code is written and dispatched over the GRBLHAL/TMCStepper/FluidNC code. I think you have a better chance to find someone with the needed skills and knowledge to help you in the Remora thread.

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

More
13 Feb 2025 10:02 #321431 by amanker
Can we other spi on rpi5 other than used by remora-spi to send config data to tmc5160. Tmc5160 spi config pins connected to rpi spi pins. And remora will treat 5160 as regular step/dir mode.

I am also communicating with cakeslob who is another developer for remora via discord.

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

More
15 Feb 2025 14:08 #321639 by 3404gerber

Can we other spi on rpi5 other than used by remora-spi to send config data to tmc5160. Tmc5160 spi config pins connected to rpi spi pins. And remora will treat 5160 as regular step/dir mode.

I am also communicating with cakeslob who is another developer for remora via discord.
 

I should be able to make it work; all I have to do is to add an option when you load the module to specify the use of the second SPI channel.

I did some quick tests on RPi 4 with the use of ioctl controlling /dev/spidev0.0 rather than the bcm2835 library and it seems to be slower/less regular. I just quickly compared my read and write functions time. As I have also read in another thread (a RPi 5 thread on this forum) this morning that the spidev option was not real-time, I will stick to the same idea as the Remora SPI, meaning using bcm2835 and rp1 library for RPi 4 and RPi5.

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

Moderators: PCWjmelson
Time to create page: 0.083 seconds
Powered by Kunena Forum