Anyone Have Experience Connecting a MPG to LinuxCNC?

devils4ever

H-M Supporter - Gold Member
H-M Supporter Gold Member
Joined
May 13, 2019
Messages
1,016
I'm thinking of adding a MPG (Manual Pulse Generator) to my LinuxCNC PC to get me away from the keyboard and make life simpler.

Has anyone added one?

How hard is it to do? Do I need to change a HAL file (or something)?

Which model of MPG?
 
Other than that I have always used Linux PCs, I don't (yet) understand what you need in the way of pulse generation, meaning what voltage, what pulse rate, what connected to, etc. We should start with setting out what exactly pulses you need.

Sure, with any Linux PC, you can have your own app, driven by your own commands, but as with all PCs, the interface to the outside world kit is the bit you need. Quite a lot depends if you have any spare routes, like a USB, or network connection, or Bluetooth, whatever.

My route to working outside kit has been Raspberry Pi, because it gives one a whole lot of options for doing stuff like making pulse trains, etc from the GPIO set of pins, and the various add-on PCBs one can get for a a few bucks from eBay. They have everything from signal generators, A/D converters, relay controllers, cameras, whatever. Of course, a $40 Raspberry Pi 4 runs the whole LinuxOS, and can easily run LinuxCNC by itself, and has two HDMI video outputs, 4 USBs, and BlueTooth, and Network, and WiFi, and has 40 GPIO pins, and you can browse the net for instructions from it, and have it play music as well!

But .. there are other ways. You can have a little Pi board be in the same room as your LinuxCNC machine, and have it connected via WiFi or Bluetooth, or USB, and be your pulse generator.

Suppose you opt to keep the Linux PC running LinuxCNC. There are lots of powerful little Raspberry Pi boards that can talk to any Linux Computer from the $4 Raspberry Pi Zero, right up to the $35 Pi4. Supply is a bit frenetic right now, because of how much of professional industry is using them. You might need to get creative, and fix it up with a little case and a 5V power supply, but most can steal some from the USB.

If I were into CNC, (and I will be one day), I would opt to put a Raspberry Pi in a box, with a heatsink, and a PSU, load up with Raspian (which is Debian), and get it to make my pulses. A cheap eBay GPIO add-on with opto-isolated interface would let me make pulses all the way up to direct motor control drivers. Python programming to control GPIO comes with it, and the software examples out there are free, and plentiful.

Have a look at the Pi site -> RaspBerry Pi boards
Google for Raspberry Pi signal generator projects, keywords "Raspberry Pi Pulse Generator"
Try the same link, and set to images.
There may be something you see that works for you.
 
Last edited:
There is an article in the current issue of Digital Machinist magazine on adding a MPG (actually 3). The author uses a Raspberry Pi microcontroller to turn the MPG pulses into an USB keyboard data stream to interface with the CNC software .It is relatively easy to do, but it is helpful if you are comfortable with Raspberry Pi or Arduino.
 
I think you misunderstood my intent. I want to be able to move the X, Y, and Z axis on my mill by using a remote pendant like this one I found on eBay. It is USB based.

I believe the hard part is getting LinuxCNC to accept and understand the MPG pendant. I would have to modify the HAL files or something like that. That's the part that I don't quite get.

I have that issue of Digital Machinist, but it wasn't clear how to hook it up to the LinuxCNC PC. I'll have to reread it.

s-l1600.jpg
 
Tormach's Path Pilot controller is based on LinuxCNC and uses a jog shuttle to accomplish what you want. The jog shuttle interfaces with the controller PC via a USB port. Beyond that, I have no knowledge but the presumption would be that it would be an option withing the LinuxCNC engine.
 
Watching this, need to get my project back on track.
 
What is the protocol of the remote pendant? If it mimics the keyboard commands that Linuxcnc expects, you are good to go. Just plug it into a USB port. If not, yes you need to modify a file in LinuxCNC to translate the pendant output to the commands linuxcnc expects.
 
Hmm. I'm not sure about that one. It mentions connecting to a second parallel port. I don't have two, but I guess I could add one. I was hoping for USB to make things easier.

Thanks.
 
Back
Top