RPI's GPIO for driving the stepperdrivers?

I’m sorry if this is a dump question, but i am not finding anything by searching, and after giving up to patch RPI with a RT Kernel to run linuxcnc, i am about to go nuts.

Does a mod or plugin exists, to send the step and dir directly to gpio, and also to read some basic inputs like a e-stop?

And if not, why does it not exist? it should be pretty simple to do, and it would help big time with applications like plasma, where a usb connection is iffy… Such thing should be all the rage no?

Thanks

I think the root of the challenge lies in implementing a real-time OS on a system which, as I understand it does not carry a real-time clock.

Protoneer has developed the Rapberry Pi CNC “hat” for the PI that implements a hybrid approach. The elements requiring the tight real-time timing (e.g. generating steps) are offloaded to a microprocessor embedded in the hat.

1 Like

As far as i understand, neither do arduino with a grbl shield, but still it works?

but it’s bash, no gui…

I think this should be possible but nobody has done it. In particular it appears that pigpio can send binary waveforms fast (but I haven’t tried it), so with a level shifter you could theoretically drive stepper drivers with high enough step frequencies.

It would be cool to have a single board solution (or like “ramps” stacking onto pi instead of arduino), with octoprint, linuxcnc, and pigpio serving as the chain, but I suspect it’s not as easy as it sounds.

What you’re suggesting isn’t impossible, but it makes about as much sense as installing windows on a raspberry pi.

The pi is 3.3V, and it runs an operating system, with lots of different parts, and changing what it runs is as simple as git clone. It is a really capable computer. But what it doesn’t do well is just toggle the IO.

The arduino is an embedded device, which doesn’t run an OS. It therefore is much simpler to manage. There isn’t any code running on it that isn’t part of the libraries and code you’ve loaded. It is much easier to get things to happen quickly, and in real time.

There are also a huge amount of choices for chips, and perpherals, The boards are well designed to work with these peripherals, for a specific chip, and they do a great job. Many of them are absurdly cheap, and still somehow profitable.

The pi excels at being flexible, and having the power of the Linux OS, and a (relatively) fast processor. The microcontroller excels at doing things deterministically, and simply, with the least amount of surprise.

IMHO, an awesome combination is klipper, which uses the microcontroller as a synchronous controller, and interface to the peripherals. The pi, gets updated frequently, and handles the trigonometry, and path planning. These algorithms can be a little late, and not affect the performance.

Making all of that work on the pi is possible, but the daughter card would be as expensive as a controller, and the configuration of it would send a lot of people packing.

This is a neat project, but still, they are using the ramps board (which is a good choice) to connect the peripherals. Why not just use an arduino mega with the klipper firmware and get all the same benefits, but have a lot more room to make mistakes in the raspberry pi?

To be honest, I think this is neat, but I’m not sure it’s practical. That’s what a lot of naysayers say. Sorry for being a naysayer.

i like to drive the drivers as directly as possible

any serial connection or ethernet, is prone to issues with emi.

is it from the frequency drive that sits close to the hardware, or a plasma cutter that is mounted on the mpcnc.

the only solution yet i found is to drive the system over a old pc with a ltp connection.

we are in 2020 and i would like to use a bit newer hardware… and i find roadblocks everywhere for this application.

grbl shoots down in both, so the only thing right now is to go to something like linuxcnc, but there i need expensive boards like mesa, that are imported and add 100$ on top of everything.

so i like to find a way to do it as slim as possible, where the only shielding i need to worry is power and the step/dir cables - and of course, the connection from the drive to the stepper

The raspberry pi is not newer than the microcontrollers they are using in the controllers.

So is a raspberry pi. And connecting a hodgepodge of wires between a pi and a daughter card is not going to be better. At least USB has a protocol to detect errors in transmission.

Embedded processors are not weaker, they are not older, but they are built to work in applications like mining and farming equipment. They are designed to work in cars, trucks, factories. The packages they are put into don’t meet the standards for these environments, but neither does the pi.

You should figure out a way to work from a computer, but run the job from a microcontroller. Put the microcontroller in a metal box and ground it. The right solution may be running off of an SD card, or something, but I think installing a pi for the sake of not using USB is missing the point.

4 Likes

crazy russian’s, nobody told them it’s impossible:

https://www.raspberrypi.org/forums/viewtopic.php?t=33809&start=950


http://www.machinekit.io/docs/getting-started/installing-packages/

we’ll see about the emi, i can put the rapsberry pi inside of a case, i can’t do the same for my laptop which runned the gcode so far. so my hope is in creating a isolated system that processes the gcode within a shielded case is good enough to go ahead with all the code.

if i use a usb cable that goes from the laptop outside to a controller inside, it looses the synch.

so after all the doubts (not only you, but also other) this maybe works after all.

1 Like

LinuxCNC is a good option. Your first post suggested that wasn’t working for you. Sorry for the confusion.