Remora - Rpi Software Stepping Using External Microcontroller via SPI

More
3 years 2 months ago #278807 by virencq
Re compiled,
Re halcompiled remora.c.
All working in RPI 3B.
Changed the Dupont cables for 100 mm.
Just to check I intensely pulled MOSI cable from RPI 3B, same result as I have with RPI 4B.
Estop comes out but on jog jont 0/1 error.

So all in all I had fried my pin 19(MOSI) in RPI 4B.

Now I will have to wait for ethernet branch!

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

More
3 years 2 months ago #278831 by cakeslob
That is unfortunate to hear viren. At least you could reproduce the error...

You might have better luck changing the linuxcnc component to use RPI SPI1 instead

pinout.xyz/pinout/spi

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

More
3 years 1 month ago #280751 by iforce2d
Hello, just thought I would share this project based on Remora for STM32F103C8 (blue pill).
github.com/iforce2d/weenyPRU

Most of the component side is as for Remora, the firmware is written from scratch except for the DDS section. It uses STM32 HAL and is quite narrow in scope compared to Remora, there's no nice way to change settings and no considerations for other microcontroller targets.

The idea was to see how far I could get with a lowly blue pill, and how small and cheap a LinuxCNC build could be and still have reasonable performance. I'm building a little solder bot that fits on an A4-size paper, and it seemed silly to have a big PC twice the size of it to run the controller. I want to use a PiZeroW, first I tried software stepping but that was pretty slow, so I started searching for SPI based methods and discovered Remora. With an external PRU the ZeroW actually holds it together pretty well, at least when not also running the GUI.

Anyway, the blue pill works but made for an awfully messy wiring setup, so I designed a PCB to keep everything tidy. Some info about that here if anyone is interested: 
The following user(s) said Thank You: cakeslob

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

More
3 years 1 month ago - 3 years 1 month ago #280781 by cakeslob
Hey iforce2d, lookin good. I am interested to see your PCB for this. Ive started working on a cheap RPI shield to work with the STM32 bluepill and blackpill as well.
I am interested in poking around your repo though, to see whats going on. I like the analog in.

If you are interested in working with mainline remora, Ive made a bluepill/blackpill repo. I havent made an SD card version yet, but I can cook one up if you are interested, although you seem capable enough on your own.
edit, right, removing the sd was the only way i could get it small enough for the firmware

github.com/cakeslob/Remora/tree/blackpill
Last edit: 3 years 1 month ago by cakeslob.

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

More
3 years 1 month ago #280784 by scotta
This is why I love opensource projects. Great work iforce2d. With the ZeroW how are you implementing a GUI?

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

More
3 years 1 month ago #280829 by iforce2d
@cakeslob I shared the next revision PCB design here (click Editor Open to view and edit):  oshwlab.com/iforce2d/stm32-pru_copy

That's actually a modified design to what I showed in the video, as yet untested. I ordered some new boards and once I've confirmed that my changes are ok I'll add this to the github readme. fwiw the changes are:
- fix the need for bodge wire seen in the video
- replace TXB0108 level shifter with 74HCT541
- rearrange so that PA9/PA10 (for UART1) are not connected to optocouplers
- link the UART pin of all stepsticks together, to allow Trinamic 'single wire interface' settings for motor drivers
- add a few more solder pads for GND, 5V, VMOT

Regarding the setting of options, it seems to me that this might be possible via HAL files, eg. use a separate .hal file that causes the LinuxCNC component to fill messages with different information, and the firmware to interpret incoming messages differently. Each message would of course include a flag to denote which type of message it is. To change settings, the secondary .hal file (containing a 'setp' to set the message mode) would be included in the .ini file. In settings mode the PRU would simply read settings and store them to EEPROM or some other onboard storage. For normal usage, comment out the settings .hal line from the .ini file. Each configurable setting would need its own 'pin' in the HAL configuration, and the component could cycle around all settings in turn, sending one per message so that the number of settings can grow in future without needing a larger message size. The firmware could reply with the normal response to keep the connection going and avoid e-stop... I guess. Admittedly I haven't really thought this idea through much, so perhaps there is some problem I'm not foreseeing, but I can elaborate on the details more if it sounds interesting.

@scotta First, thanks for all the effort you put into this, not least of which being decent documentation - I know how that can be a pain in the ass :)
I have two intended use cases for this in the near future, neither of which actually need any GUI.

The first is a little soldering bot which will do the same job over and over, so the main interaction during the course of normal operation is just to press start after placing another PCB into it, this will be a hardware HALUI button. Initially after a power up, it will need to be enabled and homed which I will do via my g-code server but that will not be very often. Occasionally it will need to be jogged into the starting position with HALUI joystick and rotary encoder, then another HALUI button to touch off.

The second application is as a back-end for the OpenPNP pick-and-place controller, so again no GUI is needed. OpenPNP will issue g-code commands over the network as if it were talking to a more typical 3d printer style firmware, which seems to be common with OpenPNP users.

The g-code server was loosely based on linuxcncrsh, you can find more info about it here:  github.com/iforce2d/linuxcnc-gcode-server
Demo video of the headless operation: 
The following user(s) said Thank You: tommylight, scotta

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

Time to create page: 0.104 seconds
Powered by Kunena Forum