Jon Elson wrote:

>Kenneth Lerman wrote:
>  
>
>>Remember that the issue on ethernet will not be throughput; it will be 
>>latency. I'm sure Jon can give you a profile of what he is doing.
>>
>>How many bytes in a send packet?
>>How many bytes is a receive packet?
>>Cycle time?
>>
>>  
>>    
>>
>OK, the current latency is VERY short per byte, reading sequential bytes 
>takes about 800 ns.
>
>I am guessing a request map might look like :
>length
>start addr
>length
>start addr
>zero
>
>So, that could be about 10 bytes, and the return packet could be maybe 
>15 bytes, for a 4-axis system.
>I would want to be able do this at a several KHz rate.  I can do 2-5 KHz 
>with parallel ports, depending on CPU, port and number of axes.
>With only 4 axes, PCI par port and a faster CPU, 10 KHz is feasible, but 
>kind of pushing it by par port.  I'd hope that this could be done with 
>ample margin with 8 axes using an Ethernet system.
>
>The protocol would look something like this, with the way the current 
>driver works :
>The first packet would write to a register to latch encoder count 
>values, then read back the encoder counts and digital inputs.
>The Arm CPU would send back a response packet with these values.  The 
>PID servo calculation would be done and another packet would be sent 
>with new velocities and digital outputs.  So, each servo cycle would 
>involve 3 short packets being transmitted.  Hopefully, the latencies 
>could be held down to 10 us or so, as each stage has to wait for the 
>results from the other one.
>  
>
A standard ethernet frame has to be 512 bits (64 bytes) long.  This 
includes ethernet framing info, and I think the net payload is 46 bytes 
for a minimum packet.  This is aside from any UDP/IP or TCP/IP 
addressing or protocol information.  So you probably need at least 3 and 
maybe 4 packets of 64 bytes each (master status request, slave status 
reply, new command from master, maybe ack from slave).  Add 2 or 3 per 
additional slave if you want a point-to-multipoint system.  (one less 
than expected since the new command could be a broadcast with 
information for all slaves)  Apparently, some microcontroller ethernet 
controllers allow you to send short packets, so you may not have to 
follow the standards with a well-known and small network.  I don't know 
how the PC controllers deal with short packets though.

So the minimum transfer is probably 256 bytes or 2048 bits per servo 
cycle.  A 10 mbit link can theoretically transfer 10 kbits per 
millisecond (neglecting latency, calculation time, turnaround time at 
the slave, etc. etc), so it could be possible to do close to 5 kHz with 
10 mbit ethernet.  Of course, 100 mbit would be that much faster, or 
provide that much headroom.

I don't know the specifics of how to deal with the incoming packets on 
the PC (or the specifics of how to send them, for that matter :) ), but 
I'm pretty sure data throughput won't be an issue.  Latency is unlikely 
to be either, unless there's some very complex packet reception 
mechanism on the PC which can't be worked around.

Just my $0.02
- Steve


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

Reply via email to