Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does DCTime correspond to #45

Closed
jespersmith opened this issue Jul 13, 2016 · 2 comments
Closed

What does DCTime correspond to #45

jespersmith opened this issue Jul 13, 2016 · 2 comments
Labels

Comments

@jespersmith
Copy link
Contributor

jespersmith commented Jul 13, 2016

I'm trying to wrap my head around DC clocks and I was wondering what the context->DCtime variable corresponds to. From testing it seems to get changed when ecx_receive_processdata is called, but it seems to correspond to the execution of the ecx_send_processdata call.

The question is, what is the corresponding time on the PC?

A) Moment the datagram gets send by ecx_send_processdata call (aka master clock compensated by transmission delays).
B) Moment the datagram reaches the master clock (aka no compensation for transmission delay)
C) something else

The goal is to synchronize the DC Sync0 pulse to to SYNC moment in the following psuedocode

while(true)
{
       wait for next period
       SYNC
       ecx_send_processdata
       ecx_processdata_receive
       do control, non-deterministic execution time < cycle time

}
@ghost
Copy link

ghost commented Jul 13, 2016

DCtime variable is populated by the reference clock (typically EcSlave #1), so when EcMaster (SOEM) receives the PDO message its value changed, unless you configure the EcMaster to be the reference clock (or if DC isn't used).

Edit: so really, DCtime can be different than the PC's (EcMaster's) time, if the EtherCAT Reference Clock is not synchronised with the PC.

@jespersmith
Copy link
Contributor Author

So the master creates and sends a datagram to slave 1, which (if it's the DC ref clock) will populate the field with its time.

So for pretty decent synchronization I can assume that the moment I call ecx_processdata_send is a few microseconds before the value of DCTime. I probably want to call send about 50-100us after the DC sync pulse to know that I have the data from the last pulse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants