-
Notifications
You must be signed in to change notification settings - Fork 691
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
1.Sync0 unstable problem and 2. state machine error reset problem #557
Comments
[Uploading ESI_Wirshark_CodeReports.zip…]( |
Thanks for the extended report. I am waiting for the report file.
Your "large" values are just small negative numbers. |
Hi,Arthur, thank you for such a swift reponse, that is so much appreciated. |
I need the minimal version of the code (smallest complete code that explains the problem), and the complete wireshark trace of that code. In this case you can get the slave operational so the slave documentation is not necessary at this time. The big advantage of posting that minimal complete code is that others in the future might learn from it. Too often only snippets of code are posted, and that just doesn't tell the whole story. Also when the issues are resolved post the complete corrected code again. So others might benefit. |
ok, i will upload the entire code, but i remember i uploaded the wireshark capture, that was captured 2 hours ago, please let me know if you can see it and download it,the code is in sync with the captured data which i will upload right now. |
main.zip |
Thanks for the code. The wireshark data did not come trough. You can check this for yourself. A click on main.zip will download the code. [Uploading ESI_Wirshark_CodeReports.zip…]( is just text, no data attached to it. As for the code, well, it is wrong in so many ways, I do not really know how to give a cohesive answer. You should follow the advice I have in #487. Your code does in now way follow these steps. The largest problem is that you try to do process data exchange in your main loop while at the same time running the real-time ethercat thread that also does PDO exchange. Again ALL PDO transfers belong in the real-time thread. Only start-up the threads AFTER you have a valid mapping, so AFTER ec_config_map(&IOmap); You have to send clock sync packets (at least 10000) before enabling dorun=1. A PDO / SYNC0 offset of only 2us is not enough by a long shot. Please try first with half the cycle time, or 2ms. When doing intra task communication please take care of data ownership and prevent races. That you could get your slaves to OP is pure luck, not because of proper programming. |
Uploading ClassicCapture.zip… |
We are doing the code optimization right now following your kind advices, when we are done, we will test to see if anything changes,please feel so free to judge our code structure whenever something comes out of your mind, all of the critiques are so much welcomed. |
@ArthurKetels Hi Arthur, hope you have a good day. We modified the code as you suggested and it worked pretty good now, always reach the target position, I will upload the updated code here, hope you can take a look. |
Thanks for the updates. I am happy you got it working.
Calling ec_configdc() 10.000 times is useless. |
Thank you SO MUCH for such a detailed response. |
@ArthurKetels Hi Arthur, hope you are well. Recently we encountered a new problem which is our slave state machine always went to fault when we trying to go back from operational mode to safe operational mode, after command is executed. Do you have any clue what might be the problem? |
@WillyTuring, can this issue be closed |
I'm sorry, but yes. I have another problem lately that i will open a new issue later, thanks. |
Hi Soem community,
We are one of the lucky users of great Soem community, first of all thanks for the contribution from all of you guys, we've learned a lot from here.
As our implementation proceed, we met a few problems here that we stuggled for quite a while and then decided to ask for some professional opinions from here hope to enlighten us for our work, let me briefly state our situation and problems in the following.
1.Current Situation:
We've managed to establish communication with the EtherCAT slave driver and write control word to change the driver state machine to move the motor.
We are using one of the Chinese servo driver called Cooldrive, model R6. The ESI file and datasheet will be attached as well.
We are running in the Sync0 mode.
We configured our Sync0 cycle time at 4,000,000ns; EtherCAT communication clycle time at 4,000,000ns; SM2 Event generation cycle at 4,000,000ns ;copy and cal time at 2,000ns.
Our initialization sequence is : ①Call Init(ec_config_init); ②Call ec_configdc; ③Call ec_dcsync0; ④Do mapping(ec_config_map)
2.Problem 1 and Observation:
2.1. Problem 1
Whenver we start to send real data, like when we are running on the CSP mode, we wrote a loop that is constantly sending the postion value to the slave, the sync situation would become unstable, to an extent that when we run the motor for a while, some of the slaves will be forced leave out of the operational mode and back to the safe operational mode and cause slave entering the error state.
2.2. Observation
①When we run the code, we also use the testing software that provided by the manufacturer, whenever we are forced into the error state, it gave us a report says the syncing communication abnormal, no more useful information than that.
②We did some trial and error, and we came to notice if we add any delay inside our position sending loop, it will cause the motor to make a huge abnormal noisy sound and draw a ton of current up to 7/8 A, while when it runs normally without any load with the same testing speed, it only draws around 0.7A, so we have to delete all the delays we had inside the loop.
③We added some code in the error detection thread trying to find out the error code(register 0x0300, 0x0308) and the system time difference(0x092C), we found out 1. for the error code, sometimes it reports the Forward Rx Error back up to the value 500-ish; 2. for the system time difference, the value fluctuates quite a lot, up to 2s in the consecutive cycle, I will attach our code report as well.
④We read the value in register 0x0910(local copy of reference time), 0x0918(local time), 0x0920(system offset time) at the beginning, we found out the local copy of reference time between 6 slaves are different; and local time≠local copy of reference time + system offset time - propagation delay.
And when we read the system time difference register(0x092C), we found out the value is 0 until we send any real data(Like change the control mode etc).
⑤I read the captured data in wireshark, the frames sended are in a sequence mathching our code, one slight observation is, from captured data we've noticed that at stage dcsync0 and mapping, the data shows each of the slave will go through dcsync0 and mapping continuously and only when it's done, it will go to the next slave.
And there is only one or a very few incorrect wkc shown.
⑥From the data we captured in Wireshark, we can confirm our slaves are using 64 bit clock.
The text was updated successfully, but these errors were encountered: