Machsupport Forum

Third party software and hardware support forums. => SmoothStepper USB => Topic started by: plasmator on October 31, 2012, 12:45:40 PM

Title: SmoothStepper firmware for LinuxCNC?
Post by: plasmator on October 31, 2012, 12:45:40 PM
Please forgive that this post pertains to LinuxCNC, not Mach3 - this seems to be 'the' support forum for SmoothStepper, otherwise I'd post it on a non-Mach3-centric place if one was available. :)

Some folks have asked about running SS under LinuxCNC but the answer seems to be that the SS is set up as more of a buffer-type device than a real-time one.  This makes a lot of sense, but given that the SS is basically an FPGA with associated interface circuitry, could a custom firmware be written to support LinuxCNC's requirements?  LinuxCNC does currently support other FPGA products for interface.

It would be nice for those looking for USB- and Ethernet-based solutions for use with LinuxCNC, and if the necessary data was available it might get written by someone in the LinuxCNC community.

Documentation on LinuxCNC's requirements can be found here:

http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Emc2HardwareDesign

You'll notice that it says that nobody has yet written drivers that use the rtlinux Ethernet or USB stacks, but it also doesn't definitely say it won't work, either.

Thanks
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: ger21 on October 31, 2012, 05:52:51 PM
All the LinuxCNC users i see posting always say the LinuxCNC will never use a USB motion device, because it's not "realtime". They tend to have the belief that if it's not realtime, it doesn't work.
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Jeff_Birt on October 31, 2012, 07:43:53 PM
The SmoothStepper is a motion control device all by itself. Mach plans the movements and the SS then carries them out and does all the 'real time' stuff on SS board itself (i.e. homing, limits, probing, threading, etc.) This is similar to how most motion control boards work (like Galil, etc.) but is in contrast to how the LinuxCNC guys think the 'loop has be closed by the controller', i.e. the PC. With an external motion control board the encoder feed back can be used for stuff like electronic gearing, etc but these types of features are done on the motion board NOT the PC. (It does not matter where it is done really but some of the Linux guys 'insist' that it 'has' to feed all the way back to the PC.)

The SmoothStepper could work with LinuxCNC if the motion board were allowed to do what it does best, real time control, and PC was allowed to do what it does best, crunching numbers. LinuxCNC just needs to allow for this type of distributed control.
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: plasmator on October 31, 2012, 10:35:35 PM
First off, thanks for the civil replies.  I half expected to get blasted out of the water for asking my question, and it's great to get 'real' answers instead.

Second, I get what you're saying about external motion control going against LinuxCNC dogma.  I am not actually myself a LinuxCNC user (yet), and its a bit disappointing to hear that they're so set in their ways.  I don't necessarily think that their way is 'wrong', but it would be nice if they'd support both realtime on the PC and on external motion control devices.

Back to my original question though; I'm still not hearing a 'no' :)  Probably sounding less likely, though
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: BR549 on November 03, 2012, 08:23:52 PM
The SS was DESIGNED and coded to respond to MACH3 motion language. To use it with LinxCNC you would either have to write a plugin for LinuxCNC to inturput the EMC2 motion language and send it to the SS to run OR create new code for the SS that understands the EMC2 motion language. AND you would LOOSE some of the cool features that EMC2 offers as a reatime controller.

There are already COntrollers for LinuxCNC that work similar to the SS.

But as Gerry mentioned the LinuxCNC developement group is NOT a very open minded bunch overall and tend to do things THEIR way or NO WAY regardless of what is an industry standard for most things.

I USE both, along with about a 1/2 dozen more (;-) TP
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: skunkworks on November 18, 2012, 03:03:01 PM
There is a few big reason why linuxcnc does it that way (realtime within the computer). 

- interface hardware can be 'dumb'.  (which usually means less expensive.)  - mesa has a $200 pci board set that has 5 hardware step generators, encoder counter, +/- 10 volt ouput, 48 i/o and it is very expandable. 
- any new realtime stuff added to linuxcnc is available to all interface cards.  Example - rigid tapping was added a few years back.  All interface cards (even the printer port if you wanted to) can rigid tap.  With mach - it has to be part of the motion card (like smooth stepper)
- Flexible...  look at the youtube videos.  Gear hobbing, robots, all kinds of cool things are being done with it.  The developers are already looking at what needs to be done in linuxcnc3.  (more realtime kernel support...) 

USB's latency doesn't allow for a realtime control loop.  Ethernet seems to be the next interface option for linuxcnc. 

sam
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Cmorley on November 18, 2012, 06:57:54 PM
To definitively answer the USB / linuxcnc question:

Yes it can be done:
http://en.araisrobo.com/linuxcnc

This is a forked/patched version of linuxcnc that uses regular USB to communicate to a FPGA card.

Will it be added to mainsteam linuxcnc - almost certainly no.

If USB can be made to work in a deterministic manner so that the control smarts stay in the PC it will be added for sure.

So there you go :)

Chris M
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: BR549 on November 18, 2012, 07:06:52 PM
That is just Linux talking across usb to communicate with a Mesa motion control card.  In that case the LOOP is close in the servo drive.

(;-) TP
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Cmorley on November 18, 2012, 07:44:49 PM
I'm not sure what you are implying.

It's not my project but AFAIK:
The raw gcode is not being sent to the mesa card.
the pc still does the trajectory planing.
They added jerk limited planning, which seems pointless if you are planning on the card.
I'm not sure how it buffers things.
I assume that the positions are sent to the FPGA openloop and it is in charge of closing the loop from there.

Is this not roughly how smoothstepper works?

Chris M
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Hood on November 18, 2012, 07:59:43 PM
With that example the loop is either being closed in the control card or the servo drive but not the computer. LinuxCNC people do not like doing that so it is unlikely to ever be adopted by them.
Hood
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Cmorley on November 18, 2012, 08:06:36 PM
Well that's what I said. :)

The original question is whether it could be done.
It can and it has been done on a forked project.

But besides code changes, it requires a ideology change.
If you care about the advantages of 'control in one place' or instead prefer the advantages of plug and play,
then you have two great choices.

Chris M
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Hood on November 18, 2012, 08:09:37 PM
Yes I know that is what you said I was just clarifying what TP said as you seemed to think he was " implying" something else.
I couldnt agree more, where the loop is closed is of no concern to me as long as it is closed.
Hood
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Hood on November 18, 2012, 08:13:26 PM
Oh and BTW the SS doesnt close the loop at all and it is unlikely it ever will, the loop needs to be closed in intelligent servo drives when using the SS with servos.
Hood
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Cmorley on November 18, 2012, 08:26:06 PM
So the only advantage of it is it doesn't use the parallel port? (not that that is not great is it's self)
I would think it also meters the pulses out -smoother- if the computer had bad latency.

I thought it did more then that. but I must confess I haven't researched it.

USB is surely convenient.

Chris M
Title: Re: SmoothStepper firmware for LinuxCNC?
Post by: Hood on November 18, 2012, 08:37:43 PM
The big advantage to the SS is as you suspect nice clean pulses, also it can pulse up to 40 times faster than the parallel port can, 4MHz as opposed to 100KHz.
The Ethernet SS is likely a better choice than the USB version.
Hood