Apr 05, 2017
04:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 05, 2017
04:29 PM
Hello,
I am using xmc4800 chip for bldc etherrcat driver. The DC sync0 is enable in this project.
When I control the slave with dc sync0 enable by ethercat master, it works only if the sync0 cycle time is larger than 500us (<=2khz). What paramater which I can change to obtain high speed dc sync event?
Thank you!
I am using xmc4800 chip for bldc etherrcat driver. The DC sync0 is enable in this project.
When I control the slave with dc sync0 enable by ethercat master, it works only if the sync0 cycle time is larger than 500us (<=2khz). What paramater which I can change to obtain high speed dc sync event?
Thank you!
- Tags:
- IFX
6 Replies
Apr 18, 2017
07:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 18, 2017
07:42 AM
Hi Mophong,
I've just reviewed the behaviour and did not find any issue.
So first i have addad a DIGITAL_IO output APP and assigned pin 2.14 to this APP on the XMC4300 Relax Kit.
This pin I toggle inside APPL_Application of the example application:
void APPL_Application(void)
{
process_app(&OUT_GENERIC0x7000,&IN_GENERIC0x6000);
DIGITAL_IO_ToggleOutput(&DIGITAL_IO_0);
}
After copying the xml-file to the PLC, I restart TwinCAT and rescan the bus.
I've implemented a small PLC-program with two boolean variables which I assign a button as input (IN_GENERIC/IN_GEN_Bit1) and LED1 as output (OUT_GENERIC/OUT_GEN_Bit1)
Basically I just toggle the LED in the PLC-program. However the cycle time I monitor on the P2.14. So the LED is just nice to have as a visual indicator.
After enabling DC-sync:
Setting cycle time of base cycle to e.g. 125us:
Setting 1 cycle for your task:
I see on the oscilloscope the 125us cycle time of the pin-toggling:
The cycle time of the device is limited by the default setting for the SSC code generation inside the SSC-Tool.
By default this limitation is set to 125us. But this default value you can modify to your specific limitations (processing time).
As I do not really process anything, I have adjusted it to a value below 50us. With this setting, you can also set the cycle time to 50us inside TwinCAT without problem:
Could you please point out in detail at which point this fails for you?
Thanks
Michael
I've just reviewed the behaviour and did not find any issue.
So first i have addad a DIGITAL_IO output APP and assigned pin 2.14 to this APP on the XMC4300 Relax Kit.
This pin I toggle inside APPL_Application of the example application:
void APPL_Application(void)
{
process_app(&OUT_GENERIC0x7000,&IN_GENERIC0x6000);
DIGITAL_IO_ToggleOutput(&DIGITAL_IO_0);
}
After copying the xml-file to the PLC, I restart TwinCAT and rescan the bus.
I've implemented a small PLC-program with two boolean variables which I assign a button as input (IN_GENERIC/IN_GEN_Bit1) and LED1 as output (OUT_GENERIC/OUT_GEN_Bit1)
Basically I just toggle the LED in the PLC-program. However the cycle time I monitor on the P2.14. So the LED is just nice to have as a visual indicator.
After enabling DC-sync:
Setting cycle time of base cycle to e.g. 125us:
Setting 1 cycle for your task:
I see on the oscilloscope the 125us cycle time of the pin-toggling:
The cycle time of the device is limited by the default setting for the SSC code generation inside the SSC-Tool.
By default this limitation is set to 125us. But this default value you can modify to your specific limitations (processing time).
As I do not really process anything, I have adjusted it to a value below 50us. With this setting, you can also set the cycle time to 50us inside TwinCAT without problem:
Could you please point out in detail at which point this fails for you?
Thanks
Michael
May 10, 2017
11:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 10, 2017
11:46 PM
Hello MichaelIFX ,
Thank you for your replying and sorry for late.
I has checked and found that the problem is due to variable 'MIN_PD_CYCLE_TIME', by default is is set 500us so I can't use DC at higher 2kHz. Your replying is very useful.
Regards,
Thank you for your replying and sorry for late.
I has checked and found that the problem is due to variable 'MIN_PD_CYCLE_TIME', by default is is set 500us so I can't use DC at higher 2kHz. Your replying is very useful.
Regards,
Not applicable
Nov 28, 2017
05:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 28, 2017
05:38 PM
Hi Michael,
I have some questions as mophong, When I control the slave with dc sync0 enable by ethercat master, it works only if the sync0 cycle time is larger than 500us (<=2khz).
I modify the MIN_PD_CYCLE_TIME,What is the mean about "After copying the xml-file to the PLC, I restart TwinCAT and rescan the bus."
Thanks!
Yang
I have some questions as mophong, When I control the slave with dc sync0 enable by ethercat master, it works only if the sync0 cycle time is larger than 500us (<=2khz).
I modify the MIN_PD_CYCLE_TIME,What is the mean about "After copying the xml-file to the PLC, I restart TwinCAT and rescan the bus."
Thanks!
Yang
Jan 06, 2021
09:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 06, 2021
09:53 PM
Hi,Michael。
I followed the user guide to develop the xmc4300 relax ethercat kit,and the default setting of the MIN_PD_CYCLE_TIME is 125us。
but I still can‘t request op state when the cycletime is less than 500us。
Can you give some advice?
Thanks
Wade
I followed the user guide to develop the xmc4300 relax ethercat kit,and the default setting of the MIN_PD_CYCLE_TIME is 125us。
but I still can‘t request op state when the cycletime is less than 500us。
Can you give some advice?
Thanks
Wade
Feb 08, 2021
12:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 08, 2021
12:43 AM
Dear Wade,
just as described inside this thread here, I could set the cycle time to 125us without a problem when setting up a task inside the TwinCAT-Host and started this task with distributed clock.
Still be aware about the implemenbtation specific limitations described here:
https://www.infineonforums.com/threads/12208-XMC4300-Ethercat-slave-can-t-change-to-op-state-when-th...
Please measure the time consumed in the mentioned functions to check if it is possible to work.
Kind Regards
Michael
Edit: I do not remember the details anymore of executing the test at that time, but what I could imagine that I have enabled full optimization of the code to reduce runtime to the lowest time possible.
Even it worked for me at that time, still 125us are quite challenging to implement more complex tasks than simple I/O switching inside process_app. Such short cycle times for my understanding are also quite uncommon.
just as described inside this thread here, I could set the cycle time to 125us without a problem when setting up a task inside the TwinCAT-Host and started this task with distributed clock.
Still be aware about the implemenbtation specific limitations described here:
https://www.infineonforums.com/threads/12208-XMC4300-Ethercat-slave-can-t-change-to-op-state-when-th...
Please measure the time consumed in the mentioned functions to check if it is possible to work.
Kind Regards
Michael
Edit: I do not remember the details anymore of executing the test at that time, but what I could imagine that I have enabled full optimization of the code to reduce runtime to the lowest time possible.
Even it worked for me at that time, still 125us are quite challenging to implement more complex tasks than simple I/O switching inside process_app. Such short cycle times for my understanding are also quite uncommon.
Jun 16, 2021
01:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 16, 2021
01:52 AM
For those who struggled with this problem like me, make sure you use a proper Ethercat master. Using my laptop with a Realtek network adapter, I could not get a sync at cycle times less than 1ms, the slave stack would keep reporting SM event missed and drop to SAFE PREOP. Twincat also reports high level of lost frames no matter the cycle times. So I did some investigation in Wireshark and it seems that the network adapter was not transmitting periodically but in bursts, meaning some frames were being transmitted faster or slower than others which is bad for DC.
So i switched to dedicated Beckhoff IPC and all my problems went away, even managed to get DC sync at 50us cycle time. Just make sure your MIN_PD_CYCLE_TIME is set lower than the default 125us.
So i switched to dedicated Beckhoff IPC and all my problems went away, even managed to get DC sync at 50us cycle time. Just make sure your MIN_PD_CYCLE_TIME is set lower than the default 125us.