Signals Output by LinuxCNC to Breakout boards
This is not a typical CNC application. I am trying to write a program to automate a testing process at work that involves control of two stepper motors, and Mach or LinuxCNC software isn't quite what we need because we'll also be doing separate data logging and decision making through LabVIEW and would like to keep it all together in one program. However, due to data rates, I still need the buffering ability of something like a breakout board.
My understanding is that Mach or LinuxCNC software takes in G-Code and converts each movement into another form of command which is sent to the breakout board, which then buffers some number of commands so that they're not dependent on pc timing, and converts them to step and direction or some other signal form to be sent to the motor controller. What I need to know is what kind of commands a breakout board needs/expects to receive from the CNC program, (i.e. what kinds of commands LinuxCNC sends) so that I can write them manually for my specific testing/control scenario. Can you please help me to find some documentation or explanation of this? I would be very grateful.
Regards,
Johnathan Simeroth
Please Log in or Create an account to join the conversation.
If you have a realtime requirement and the budget you could look at doing everything with LabVIEW RealTime (if that still exists, it's been about 15 years since I was involved in a project using that).
Depending on what you want to log in tandem with the stepper motion you might be able to use LinuxCNC for logging. It all rather depends on what time-stamp resolution you need for the data.
Please Log in or Create an account to join the conversation.
Please help me understand: are you saying that you do not think a breakout board will help me in this situation, or simply that because LinuxCNC doesn't use them you wouldn't know what kinds of signals they expect?
To clarify, in the end, I would like to send 7500 step signals per second to a stepper controller. Without buying LabVIEW RealTime, is there any way I can do this? I thought that perhaps by sending say... 2 signals (e.g. a direction and a frequency) some hardware could do the real time processing to turn that into the necessary step and direction signals spaced at the necessary frequency. Then these signals would be routed to the motor controller. Is that not how it works?
Please forgive my ignorance. I've been searching online for ages and haven't found any clear explanation of what happens between a PC and a breakout board. I've come here because this community seems to know the most about the behind-the-scenes, low-level signal stuff.
Please Log in or Create an account to join the conversation.
Things like the Mesa cards (5i25 for example) can output steps at 10 MHz, but can only _change_ step frequency every 1mS.
I think a more important question is what you want to log at the same time as making the step pulses.
Please Log in or Create an account to join the conversation.
You can do 7500 steps per second without any special hardware at all, that is within the capability of a parallel port.
Things like the Mesa cards (5i25 for example) can output steps at 10 MHz, but can only _change_ step frequency every 1mS.
I think a more important question is what you want to log at the same time as making the step pulses.
You say I can do 7500 steps per second. Is that statement based on the assumption that I am using Linux, or is that true of Windows too? Everything else I've read seems to say that generating waveforms and driving steppers directly from a pc is terrible and subject to delays.
As for the data logging, I'll be taking readings from an rs232 device that measures conductivity at a sampling rate of about 10Hz.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
You say I can do 7500 steps per second. Is that statement based on the assumption that I am using Linux, or is that true of Windows too?
That was assuming that you were using Linux _and_ that that version of Linux was running a real-time patched kernel.
It is somewhat dependent on the PC hardware but 20uS timing jitter is about average with the RTAI Linux kernel and some machines get down to 3uS.
Mach3 runs under windows and manages to be functional for many people without recourse to a buffering breakout board, and so it seems fair to assume that it is possible to do it in Windows too. (Mach uses some rather special tricks to make this all work)
I have to say that if I wanted to send stepper pulses and read RS232 at the same time, and be sure of the time-stamp alignment, I would probably be using an Arduino Mega (you need one with multiple UARTs, one to send data back to a host PC on the serial-to-USB connection and one to read the real-time data.
The type of "breakout" that you seem to be thinking of (Probably the Smoothstepper?) isn't a simple breakout. It is basically a complete motion controller that is smart enough to buffer a few tens of mS of instructions. I don't think this will help you at all, because the Smoothstepper wouldn't be able to read the RS232 for you to get the timestamp alignment.
Please Log in or Create an account to join the conversation.
So, if I was using a non-buffering breakout board, what would its benefit be? It still offloads some of the processing to the dedicated hardware, right?
The question I am still confused about and cannot seem to find an answer to, is: what signals does a simple $30 breakout board expect? Does it expect (as I have been guessing) some serial code that tells it "make ___ # of pulses in ____ direction at ____ speed"? Or does it do something entirely different?
I'm struggling to see the benefit of a non-buffering breakout board if it doesn't at least do this.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Very little actual processing. The advantage is that the controlling PC isn't being interrupted every 25uS to make a step pulse (if one is needed at that timestamp) and that the step pulses are made faster and more regularly than can be managed by software. The step-time jitter with software stepping is typically 5uS or so whereas an FPGA card can time steps to a few nS.So, if I was using a non-buffering breakout board, what would its benefit be? It still offloads some of the processing to the dedicated hardware, right?
I don't know which $30 breakout you are talking about, so can't say. Most of the ones on eBay at that price don't do any processing at all, they just pass-through the signals from a parallel port. Things like the Smoothstepper cost $150 or so.The question I am still confused about and cannot seem to find an answer to, is: what signals does a simple $30 breakout board expect? .
Please Log in or Create an account to join the conversation.