Remora - Rpi Software Stepping Using External Microcontroller via SPI

More
31 Jul 2021 23:30 #216525 by mhel

This is the beginning of my stand alone controller :-)
what resolution is that screen you are using? 1080*640?
 

It's an 800x400, 7" it's too small if using Axis gui, but this github.com/UnfinishedBusiness/Xmotion is what I originally thought I'd use.
But I think the size is good enough for my (very distant) future DIY cnc lathe.
I'm eyeing on this one  www.buydisplay.com/10-inch-raspberry-pi-...river-board-1024x600, but budget is
a little tight right now :-)

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

More
01 Aug 2021 00:39 #216548 by Aaroncnc
I'm just a bit worried as it seems a lot of other chips lack the high speed encoder.

I could drop down to a 60-100 pule per rev encoder and still use the software encoders.
If the base thread gets a bump it may help as well.
I know for my cnc mill setup the step rates are just fine.

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

More
01 Aug 2021 01:08 #216555 by cakeslob

It's an 800x400, 7" it's too small if using Axis gui, but this github.com/UnfinishedBusiness/Xmotion is what I originally thought I'd use.
But I think the size is good enough for my (very distant) future DIY cnc lathe.
I'm eyeing on this one  www.buydisplay.com/10-inch-raspberry-pi-...river-board-1024x600, but budget is
a little tight right now :-)

that xmotion thing is interesting, not needing xwindow, this will come in handy, thanks
the size upgrade doesnt buy you too much space with axis, my 1024x768 barely fits axis. but i know your pain, my skr 1.4 setup is quick and dirty with rpi 7in screen. so i made axis fit the screen, if you are interested
forum.linuxcnc.org/21-axis/38188-solved-...mmand?start=0#169617

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

More
01 Aug 2021 02:00 #216570 by Aaroncnc
for a monitor setup i have been looking at touch monitors but they are costly and its hard to find a decent 1080p one.

But i have like 4 spare 23" monitors so i have been thinking about ordering this
www.aliexpress.com/item/32973485035.html...356.2.59e2def5I65ls4

if it was less to ship i would have ordered it by now.
I love having probe basic running on my RPi4. sure a few of the gcode wizard screens are blank but the rest of the interface works.

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

More
01 Aug 2021 14:28 #216607 by Cncninja
I guess i am lost a bit just like cakeslob wrote above, my understanding was the stepgen was handed off/offloaded to the microcontroller not software-driven. So your saying linuxcnc (software) makes a step pulse, sends it out well also feeding it back for a virtual encoder to see if the pulse was created. the software pulse is just passed through the microcontroller, not really generated by it. I thought the ext microcontroller was to offload the stepgen from the software where a RPI then can viably run Linuxcnc. Is this also how a FPGA like the mesa works?

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

More
01 Aug 2021 18:34 #216638 by cakeslob

I guess i am lost a bit just like cakeslob wrote above, my understanding was the stepgen was handed off/offloaded to the microcontroller not software-driven. So your saying linuxcnc (software) makes a step pulse, sends it out well also feeding it back for a virtual encoder to see if the pulse was created. the software pulse is just passed through the microcontroller, not really generated by it. I thought the ext microcontroller was to offload the stepgen from the software where a RPI then can viably run Linuxcnc. Is this also how a FPGA like the mesa works?


I was just quoting what scott said, but it caused me to look into it more, so here is the best explanation I could find

In position mode, the values of maxvel and maxaccel are used by the internal position loop to avoid generating step pulse trains that the motor cannot follow. When set to values that are appropriate for the motor, even a large instantaneous change in commanded position will result in a smooth trapezoidal move to the new location. The algorithm works by measuring both position error and velocity error, and calculating an acceleration that attempts to reduce both to zero at the same time. For more details, including the contents of the control equation box, consult the code.

In velocity mode, maxvel is a simple limit that is applied to the commanded velocity, and maxaccel is used to ramp the actual frequency if the commanded velocity changes abruptly. As in position mode, proper values for these parameters ensure that the motor can follow the generated pulse train.


So, not that they arent offloaded onto the mcu, but the mcu is sending position feedback back (position-fb) to the internal feedback loop (is that on mcu or controller?) it can execute the commanded moves and avoid generating step pulse trains that the motor cannot follow.
I will infer that this is how/why following errors work, as it sends out more steps than it can move within the parameters defined, and detects a discrepancy between position-cmd and position-fb, but I could be off that mark with this.

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

More
02 Aug 2021 09:20 - 02 Aug 2021 09:21 #216678 by Zuo99

Thank you Scott for your thorough reply, and many thanks also for this project.
  • inversion: I still didnt update the firmware with the new content but tried to use 1 instead of "True" and indeed the inversion works correctly. 
  • Steprate: ok so the maximum theoretical steprate Is coeherent with my experience, that's ok since I understand that your main target is 3D printers, the ability to use your project with a mill also very interesting. I lowered the steps per mm in the drivers configuration and lowered the maximum speeds and now the system is behaving Better. I still have to tinker with linuxcnc settings as I still have some overshoot problems.
  • Feature request: it would be nice to be able to access board sd card trough USB as a generic disk storage. That would simplify initial configuration testings, for example for headless setups like mine, since I'm using vnc and the sd is not very accessible. The file would be accessibile directly trough os.

Hi muvideo
I am also trying to use REMORA to control the milling machine, but there are still some problems. I don't know if it is convenient for you to publish and upload your ini and HAL files. At the same time, I want to know about some of your devices such as the connection of limit switches.
thank you very much for your help.
Zuo
Last edit: 02 Aug 2021 09:21 by Zuo99. Reason: something wrong

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

More
02 Aug 2021 11:54 - 02 Aug 2021 12:02 #216688 by gtt38
I have a mks SBASE but the solder jumper was too difficult for me and the noise of the DRV88xx too. But I have a NXP LPC1768 test board and i wanted to try the remora code and it works perfectly. Thanks Scott now we can use a MCU as a PRU.
File Attachment:



File Attachment:
Last edit: 02 Aug 2021 12:02 by gtt38.

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

More
02 Aug 2021 13:50 #216697 by Aaroncnc

Zuo99 post=216678 userid=29932

Hi muvideo
I am also trying to use REMORA to control the milling machine, but there are still some problems. I don't know if it is convenient for you to publish and upload your ini and HAL files. At the same time, I want to know about some of your devices such as the connection of limit switches. thank you very much for your help. Zuo

There is an example on the documents for a home limit switch combo. scroll to the bottom.
 remora-docs.readthedocs.io/en/latest/software/hal-examples.html

quick example for limit switch and home


SD config
{
    "Thread": "Servo",
    "Type": "Digital Pin",
            "Comment":                      "x limit and home",
            "Pin":                          "1.29",
            "Mode":                         "input",
            "Modifier":                     "Pull None",
            "Invert":                       "False",
            "Data Bit":                     0
    },
 
Hal file
net X-min       remora.input.0  => joint.0.home-sw-in joint.0.neg-lim-sw-in

Note that the data bit must be set equal to the remora.input.# to link

more info about the config file here
remora-docs.readthedocs.io/en/latest/fir...tup-Config-File.html

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

More
02 Aug 2021 14:19 - 02 Aug 2021 14:20 #216700 by Cncninja
I haven't had much time to dive into the Hal file to just have a plug and play MKS1.4turbo ... this seems a common board and would not be bad to just get a file to just match what is hard wired on the board already like the home, probe, heater/m3 spindle. This may be a bit slow for my mill, but i have a good 30 printers or so i can try it on. one thing that would be cool is 2209 auto home. The 2209's have the data pin that goes high when stalled (home) this can be feed right back into the home input, the only problem is the enn has to be toggled to make it move again.
Last edit: 02 Aug 2021 14:20 by Cncninja.

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

Time to create page: 0.168 seconds
Powered by Kunena Forum