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

More
1 year 8 months ago #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
1 year 8 months ago #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
1 year 8 months ago #321264 by 3404gerber
The following user(s) said Thank You: meister

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

More
1 year 8 months ago #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
1 year 8 months ago #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
1 year 8 months ago #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.

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