On 2/28/2019 6:43 PM, [email protected] wrote:
> 
> On Friday, 1 March 2019 04:42:41 UTC+11, Schooner wrote:
>>
>> ~
>> Machinekit has dropped software step generation and its reliance upon rtai 
>> kernels to get a low a latency as possible to make it work.
>> The recommended stepper generation methods are FPGA card or SOC,  or the 
>> BBB PRU
>> ~
> 
> ok, hold the presses. 
> 
> I understood that on the  BBB, machinekit off loaded the signal generation 
> to the extra cores set up specifically to run real-time i.o. (steps, 
> encoder signals & whatever), but are you telling me that machinekit is no 
> longer capable of running real-time on a general cpu with a real time 
> kernel like the preempt-RT patched linux kernel?
> 
> If so, would that make it pointless to try and run machinekit on anything 
> other than a BBB (or another board with a similar set of silicon?). Are 
> bit-banged GPIO ports an entirely lost cause?
> 
> Or have I misread that sentence?

A slight misunderstanding on both sides.  There is "real time" and
there is "real time step generation".  These require vastly different
performance from the underlying OS regarding worst-case interrupt latency.

The Linux real-time options in terms of latency (best to worst):

* RTAI
* Xenomai
* Preempt-RT

...and the performance of each option varies dramatically depending on
the CPU architecture.

RTAI requires HAL code to run in kernel space, which Machinekit no
longer supports.  RTAI is only available for x86 platforms, and is
mostly considered dead (although there has been a somewhat recent
update after apx. 4 years of silence).  LinuxCNC still supports RTAI
if you want to go this route.

Xenomai provides almost as good latency performance as RTAI but HAL
code can run in usermode.  Xenomai is supported by Machinekit,
however, Xenomai patched kernels are not particularly common and
generally have to be custom compiled by the user.  The primary use
case for Xenomai is the BBB, where the improved latency vs. Preempt-RT
matters more than for x86.

Preempt-RT provides the worst latency performance but is fine for the
control (or "servo") thread and on some systems can provide results
decent enough to support software stepgen.  Note that newer ARM
Preempt-RT kernels perform much better than earlier versions (3.x and
early 4.x), so the performance gap between Preempt-RT and Xenoami is
narrowing.

Summary/conclusions:

* RTAI is not supported by Machinekit

* Pretty much any Xenomai or Preempt-RT kernel can run Machinekit well
if you off-load the step generation to something else (Mesa hardware,
BBB PRU, etc).

* On some x86 systems, you can get a working machine using software
stepgen and a Preempt_RT or Xenomai kernel.

* On ARM systems, no real-time kernel works well enough to support
software stepgen, so you need something else to generate the step
pulses (eg: the PRU, or some of the "tricks" used on the RPi like
programmed DMA to the GPIO port).

* If you want good performance with "bit-banged GPIO ports", get a
decent x86 machine with a parallel port and a motherboard that
performs well with Xenomai or the Preempt-RT patch set.

-- 
Charles Steinkuehler
[email protected]

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to