Remora - Rpi Software Stepping Using External Microcontroller via SPI

More
3 years 1 month ago #280854 by cakeslob
What are you using the message section for right now?

Also can you elaborate on your decision for 74HCT541 over TXB0108? I am working on that part, if its dedicated outputs that makes sense but I am just wondering

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

More
3 years 1 month ago #280868 by iforce2d
By "messages" I mean the information passed between LinuxCNC and the microcontroller over the SPI connection. For example LinuxCNC sends (among other things) the desired motor movement and which digital outputs should be on, and the microcontroller sends back the current motor positions and which digital inputs are on, etc. These messages are exchanged at (typically) 1kHz continuously, always with the same message content, about what is happening in the current 1 millisecond time slice.

But the message content could be anything, including settings for the microcontroller. You probably would not want to send settings all the time because it takes up SPI bandwidth, is not really necessary, and some settings might require the microcontroller to be restarted. So I think the settings would need to be saved in some kind of storage onboard the microcontroller. As for how the user can define the settings, the .hal files give us a way to set a large number of arbitrary values that will be accessible to the LinuxCNC component, which can pass them to the microcontroller.

To look at a concrete example. the first thing I would find this useful for is setting the current of the TMC2209 stepper drivers I'm using, which the microcontroller can do via UART. In my .hal file I might have something like:
Code:
setp  weeny.config.enabled  1 setp  weeny.config.stepper0.current  600  # milliamps setp  weeny.config.stepper1.current  450  # milliamps

The first line would instruct the HAL component to send config messages instead of the normal messages, and the subsequent lines give the values of whatever needs to be set. It would be also possible to switch between config messages and normal messages at run time, although I'm not sure how practical that is. At some point the microcontroller will need to write the settings to storage, which is slow and might cause the SPI connection to drop, but that's not a big problem.

To be fair, I am probably making this sound easy because I'm only looking at one specific microcontroller and I'm basically making my own PCB to run it on so adding extra components like flash storage is no big deal. Whether something like this would be practical to try on the wide range of existing boards that Remora supports is a completely different story. I'm also just outlining an idea I came up with a few hours ago and have never tried, so it could all go badly wrong when I eventually try it out :D

About the level shifter decision, to be honest I don't know much about these. I forget how I came across the TXB0108 but I just can't get it to work  at all, and I've seen a lot of people having problems with it. Somebody suggested 74HCT541 in the comments of my video, so I'm just trying that next. Apparently the 74HCT541 only does translation in one direction which hopefully makes it easier to work with... fingers crossed.

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

More
3 years 4 weeks ago #282067 by cakeslob
Hey iforce2d, I saw your machine on hackaday this weekend. Lookin good

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

More
3 years 3 weeks ago #282733 by virencq
Hello Cakeslob,
Will DMAstepgen work with your static branch, are you planning to implement it.
Will definitely boost performance I guess.

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

More
3 years 2 weeks ago #282825 by cakeslob
Hey Viren, 

yes, it would be nice, but Im under the impression that we are not able to do it.

www.forum.linuxcnc.org/18-computer/44828...rd?start=1210#282397

scotta wrote: Unfortunately no, I had the original concept "working" on the STMF407 but it was just not fast enough to get the calculations done for all 6 axes within the servo thread period. The RT1052 is heaps faster.

The following user(s) said Thank You: virencq

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

More
3 years 1 week ago #283737 by virencq
Hello Dev,
In my running RPI Linuxcnc setup, I have Phase A and index only. I am not using full quadrature encoder mode.
So when I set in Remora config "setp encoder.0.counter-mode 1".(QEI encoder)
LinuxCNC throughs error pin setp encoder.0.counter-mode 1 not found.
How easy would it be to omit Phase B from the static branch 446

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

Time to create page: 0.274 seconds
Powered by Kunena Forum