Signals Output by LinuxCNC to Breakout boards

More
17 Nov 2016 22:35 #82934 by jsimeroth
Hello,
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.

More
18 Nov 2016 00:11 #82939 by andypugh
LinuxCNC doesn't do buffering. Even with the FPGA cards that generate steps independently of the main control loop they only ever make steps at a constant rate for the 1mS servo-period, then make the steps at a different commanded rate for the next period.

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.
The following user(s) said Thank You: jsimeroth

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

More
18 Nov 2016 01:12 #82941 by jsimeroth
Thank you andypugh.
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.

More
18 Nov 2016 01:32 #82942 by andypugh
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.

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

More
18 Nov 2016 02:14 #82943 by jsimeroth

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.

More
18 Nov 2016 02:17 #82944 by jsimeroth
Also, I have found people controlling steppers with arduino type products that take in # of steps, frequency, and direction, and do all of the pulse generation on dedicated hardware. That's all I'm looking to do, but without the arduino. I thought maybe a breakout board would accept similar input signals. Am I incorrect? I still don't understand what I'm missing if so.

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

More
18 Nov 2016 11:03 #82954 by andypugh

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.
The following user(s) said Thank You: jsimeroth

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

More
21 Nov 2016 19:57 #83091 by jsimeroth
Thank you again for your reply.
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.

More
21 Nov 2016 20:05 #83094 by jsimeroth
Also, the program will now most likely be reading data from a USB device, and it is not necessary that my breakout board be able to read the RS232 device. Close timestamp alignment is not critical. I just want my motor to turn relatively smooth at its maximum operating speed (2250 rpm).

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

More
21 Nov 2016 20:15 #83095 by andypugh

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?

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.

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? .

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 following user(s) said Thank You: jsimeroth

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

Time to create page: 0.216 seconds
Powered by Kunena Forum