On 10/22/2018 03:17 PM, andy pugh wrote:
On Mon, 22 Oct 2018 at 20:31, Nicklas Karlsson
<nicklas.karlsso...@gmail.com> wrote:

It depends on hardware but to simultaneously sample inputs and actuate outputs 
is a good method. Then computations could happen anywhere within period and it 
also agree with theories for real time scheduling.
I don't think that any LinuxCNC hardware driver does this, and none of
the sample HAL files are written this way. LinuxCNC typically uses a
read-process-write scheme.

(then waits 1mS for the next cycle)

Well, the Pico Systems PPMC boards for analog servo interface does this. At the beginning of the thread, you latch all the encoder counts, and then read them in. Various components execute, especially PID, and then outputs are sent to the velocity command DACs. But, these DACs hold the new setting in a digital memory, and do not update the analog output immediately. At the beginning of the NEXT servo thread, when the encoders are latched, the DACs update the analog output.

So, this makes sure that the encoders for ALL axes are sampled simultaneously, and then the DACs are updated simultaneously on the next servo cycle. Thus, there is no variable delay between encoder sampling and DAC update, it is always equal to the servo thread period +/- the jitter at the start of the thread, which is typically less than 10 us. (Much less on a machine with good latency jitter numbers.)

Jon


_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to