Remora - Rpi Software Stepping Using External Microcontroller via SPI

More
9 months 2 weeks ago - 9 months 2 weeks ago #341419 by amanker
I didnt understand what do you mean by balancing the signal? Please explain.

I was follwing your work on TMC5160 on LinuxCNC.
How can I use TMC5160 on LinuxCNC on this board. I need just TMC5160 is configured via connected SPI cable nothing else. And remora will operate as regular step/dir mode.
Last edit: 9 months 2 weeks ago by amanker.

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

More
9 months 2 weeks ago #341438 by 3404gerber
I think Wikipedia will explain balanced signal better than me:  en.wikipedia.org/wiki/Balanced_line . I made a small pcb that uses DS90LV/DS90LT line transceiver to turn the SPI into a balanced signal, and one at the end of the line that turn it back to an TTL SPI signal.

For the TMC5160, if you use the Remora-STM32F4xx-PIO or Remora-STM32H7xx-PIO, you'll have the possibility to configure your drivers via SPI. If you prefer to use my library, it would benefit from some changes; mainly removing the read/write functions that aren't needed and just make a configure and status check function. But you could try to use it without changes for a test, as the driver won't accept any SPI command related to internal ramp if the SPI mode isn't activated by a jumper on your board.

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

More
9 months 2 weeks ago #341448 by amanker
I will try changing SPI cable with LAN cable. Which might work better in shielding external interference.

I have already tried STM32F4xx-PIO and STM32H7xx-PIO branches. H7xx works ok on SKR3 board.
But F4xx branch is not working with tmc5160 but working in step/dir mode. I have tested ben-jacobson branch github.com/ben-jacobson/Remora-STM32F4xx-PIO.git who is orginal developer of F4xx branch. I have posted issue on GIT about this but didnt got reply. Didnt tested remora-cnc branch which 28 commits less than ben's branch. and since it was forked out of ben's branch so didnt thought that it will work on remora-cnc branch.

for configuring tmc5160 via spi I have to change jumpers on board for SPI. Other option is, I should remain board jumpers in step/dir mode and run external spi wires connected to stepsticks (daisy chain) to RPI, which will make really mess.

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

More
9 months 2 weeks ago #341459 by 3404gerber
Changing the cable can help a little. You can also try to go even lower with the SPI frequency; it really depends on how fast your servo thread is and as long as your SPI communication is faster than the servo thread, it shouldn't be a problem.

I agree that the wiring would be a mess if you had to wire the TMC directly to the RPi. I was surprised when you said that the H7 version worked but not the F4, as they share the same remora-core repo, which contains the tmc module. I think I found out why: on the SKR (H7), the remora comms is on one SPI channel, and the drivers are on another one. Scotta decided to use SoftwareSPI to communicate with the drivers. On the Octopus pro (F4), the remora comms and the motor drivers share the SPI 1 channel, so my guess is that is causing the issue. To my understanding, the same SPI channel cannot be a master and a slave at the same time, and it is a slave for the Remora component. If you want it to work on the Octopus, you'd have to connect the RPi on a different SPI channel and adapt your platform.ini file accordingly. I don't have a board myself, but as far as I could see on the product datasheet you could use the SPI 3 channel on the J74 header.

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

More
9 months 2 weeks ago #341483 by amanker
I was also suspecting SPI is the issue, since as soon as I use SPI for tmc5160, The blinking LED which I configured to know if firmware is working, glows continuously insteed of blinking.
There is somthing different in ben-jecobson F4 port, since console output on uart gives garbage, no readable output.

As per your suggestion, I comapred both repos, for TMCsteppers both are same, no changes. And both F4 and H7 uses software SPI for tmc communication.

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

More
9 months 2 weeks ago #341542 by cakeslob
ashok he is saying that the comms SPI the tmc spi both use spi channel1, PA_5/6/7. we will need change it to use spi2 or 3 for comms. im not sure the other parts

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

Time to create page: 0.217 seconds
Powered by Kunena Forum