The invention discloses an
EtherCAT master station distributed
clock synchronization method based on an ARM and an FPGA, and relates to the technical field of industrial control, the method comprises the following steps: S1, using an
FPGA chip integrated with the ARM and programmable logic resources to construct an
EtherCAT master station distributed
clock module, the ARM and the programmable logic resources interacting through an internal AXI
interconnection bus; s2, the programmable logic resource obtains an enable
signal sent by the ARM end, and if the enable
signal is 1, the
master station performs topology scanning,
delay calculation,
clock compensation and dynamic drift compensation operations on the slave
station to obtain a
delay compensation value and a local clock compensation value of the slave
station; s3, after compensation is completed, the state
machine of the master
station automatically jumps to a synchronous
signal generation module,
SYNC parameters are obtained from the ARM end, and
SYNC signal starting time of the slave station is calculated according to the
SYNC parameters; s4, respectively converting the
delay compensation value, the local clock compensation value and the starting time of the slave station into message information, sending the message information to the slave station, adding 1 to the address of the slave station, and returning to the step S1 until the distributed clock configuration of all the slave stations is completed; the
EtherCAT master station distributed
clock synchronization method solves the problem that a synchronization (SYNC) signal generated after a distributed clock
algorithm is started is unstable, and shows potential and value in the field of higher-frequency slave station synchronization.