Well actually not. A full period of jitter then using average
        time over 100 samples is 1% or about if not exact 1/n=(100/n)%
        of jitter. 

The ethernet controller of the processor has a clock with a very
fine-grained control of the time. Currently this clock takes 3 seconds
to lock to the PC clock. Once locked it is very stable ...  But there
is also the PWM frequency, which determines the sampling time of the
position and motor currents. I want all the drives to sample the position
at exactly the same time. For this I want to sample just before the next
data from the PC arrives. This way both the encoder data and the ethernet
packet arrive simultaneously and the current control loop has everything
up-to-date for the next computation.  After the current control loop
has finished it sends the status back to the PC.

What using the timer brings, is that it allows me to compensate for the
delay from the sigwait to the actual sending of the packet. By
reading the timer with timer_gettime.

        I have done this for stepper and have also written about how
        to do it with decimal point to reduce jitter then running servo
        loop at similar rate as stepper pulses.

        What protocol do you use for Ethernet?

Currently it is an ad-hoc protocol over UDP. One port is used for
the timing and the PC broadcasts sync packets. I want to change this
protocol to PTP, but also use the hardware time-stamping of the ethernet
controller on the PC. Both will take some effort ad will have to come
after I've finished the mechanics. Currently there is no compensation
for propagation delay which causes one drive to sample slightly earlier
than the other, and swapping the ports on the switch causes the order
to change. The delay is well below 1us, so not an issue for mechanical
systems like milling machines and lathes.

Since the PTP protcol has to be mixed with the real-time control I need
to do something with scheduling. The TDMA driver included in RTNET is not
"suitable" because the UDP packets are tagged differently and the ethernet
controller in the microcontroller is not able to do all the checks. I
also use a switch, instead of a HUB which also makes the TDMA sub-optimal.
The drives have a 100Mb link and the PC had 1Gb.

The other port is the data for the control loop which is just a struct
sent with every UDP packet, and changed at will.  If, for some reason,
I want to add a protocol I'll use another port.

regards,

Mark.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to