-
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
PDO data mismatch problem #851
Comments
As you can see from 1.source code and 2. running results capture, status word and mode display did not make any change after I specify control word with 0x06->0x07->0xf and mode 0x03. At least I think the motor should be in an enabled state, but it doesn't respond at all. |
Common mistake in the motor.cpp code. The PDO structs for input and output need to be packed, otherwise the compile will adjust all elements of the struct to 32bit or 64bit boundaries. See how it is used is the example code. For GCC you need PACKED and for visual studio PACKED_BEGIN and PACKED_END. You can also search the issues for these keywords to see more. |
Thanks for your reply Arthur, I've already added #pragma pack(1) and pack() for RX/TXPDO struct, now data alignment is okay. |
A first check should be to rotate the motor by hand and see if your position inputs are updating. |
Sigh, inventing solutions for problems you do not understand is mostly not very effective. First understand your problems. I have very little to go on, but from the above conversation it seems you could do with some more basic understanding of EtherCAT in general. And more specific about implementations of EtherCAT motor controller slaves. Key points:
|
Hi there,
Recently, I've made a simple demo to control a servo motor wth SOEM. Everything seems fine except that the motor fails to run. Then, I did littile research about ethercat frame, PDO Configurations, Sync state etc but still no results. The inconsistency I found is that the data in RxPDO does not match the data in RxPDO that's why I choose this title. By the way, the status code 0x210 means power on and CANopen control according to motor manual. I just wonder did anyone encounter the same issue. Code and wireshark captures attached below.
1.source code
motor.zip
wireshark capture
ethercat_capture_1.zip
slave info capture
Sincerely,
Lya
The text was updated successfully, but these errors were encountered: