[etherlab-users] EtherCAT :: Problems with EL4732 and EL3702 distribuited clock

Guido guithercat at gmail.com
Mon Jul 23 16:13:09 CEST 2012


Hello everybody,
my name is Guido and I am evaluating the EtherLab EtherCAT-Master.
I've just done some simple tests and everything is working properly. I 
have instead some problems regarding Beckhoff EL4732 and EL3702 modules. 
Looking the mailing lists I was able to send an output voltage value and 
to read it with the input module. However I have a problem: when I set 
the output like a square wave I have periodically (after about 10 
seconds) a lost of synchronism, visible on the oscilloscope like a 
flicker of the square wave . The task that I have written is a simple 
real-time tasks (under rtai) with a periodicity of 1 ms (which I have 
checked).
I made the setting of the Distributed clock (without oversampling) ​​ 
with the instructions:

ecrt_slave_config_dc(sc_ana_out, 0x0730, 1000000, 0, 0, 0); //1ms (EL4732)
ecrt_slave_config_dc(sc_ana_in, 0x0730, 1000000, 0, 0, 0); //1ms (EL3702)

while in the cycle run:

while(1) {
ecrt_master_receive(master);
ecrt_domain_process(domain1);

blink=!blink;

if(blink) ch1_volt=0x3FFF;
else ch1_volt=0;

EC_WRITE_S16(domain1_pd+off_el4732_ch1, ch1_volt);
EC_WRITE_S16(domain1_pd+off_el4732_cc1, 0)

tv.tv_usec +=1000;
if (tv.tv_usec>=1000000) {
tv.tv_usec -=1000000;
tv.tv_sec++;
}
ecrt_master_application_time(master, EC_TIMEVAL2NANO(tv));
ecrt_master_sync_reference_clock(master)

ecrt_domain_queue(domain1);
ecrt_master_send(master);

rt_task_wait_period();
}

Does anyone tell me where is the problem?
I also tried to follow the same steps with the SOEM master, setting the 
Distribuited Clock with the ec_dcsync01 and the ec_configdc() func. but 
in this case I can not see the output voltage on the module.

Can anyone help me to solve these problems?
Thank you so much.
Guido



More information about the Etherlab-users mailing list