-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
example ec400
stalling with slave state not switching to OP
#21
Comments
I can see on wireshark, that the slave actually received the request for mode OP and answered two successive state changes as expected: SafeOP then OP Here is the transmission capture: issue-21.pcapng.zip So why is the program blocked ? |
Thanks for the bug report and Wireshark dump. A few things:
As mentioned above, a My best guess right now is that the drive isn't configured at all as none of the SDOs are written in the init closure. Try removing the It's late for me here but tomorrow I'll test |
Oops I was running the test agains the two types of servodrives, and I copy-pasted the wrong code here it seems. I ran the program again with the good condition: mention I noticed that strange name issue, not sure if it is a bug in the firmware or not, but I will check for the drives actual pdo addresses. But shouldn't the drive raise errors if I'm using wrong PDOs ? |
Hey, the string name issue should be fixed in #23 but it would be great if you could confirm if it fixed it for you or not. I don't have access to my test gear right now, but none of them showed the bug anyway...
I don't think so - I think they just fail to go into DS402 OP if I remember what my drives do correctly. |
I confirm #22 is fixed in my case :) |
You were right, I did paid attention to that my PDO addresses were right (they are the same for omron drives and leadshine drives), but forgot to check the SDO selecting the PDO to receive (those are differents between omron and leadshine) |
I just ran the You might find it useful to look for |
Well my tests gets weirds ... slave.write_sdo(0x1c12, SubIndex::Index(0), 0u8).await?;
slave.write_sdo(0x1c12, SubIndex::Index(1), 0x1600).await?;
slave.write_sdo(0x1c12, SubIndex::Index(0), 1u8).await?; thread 'main' panicked at 'Init: Mailbox(Aborted { code: General, address: 7186, sub_index: 1 })', examples/ec400.rs:129:10
// 7186 = 0x1c12 Despite 0x1c12 is present in omron's ESI file ...
<Object>
<Index>#x1C12</Index>
<Name LcId="1033">Sync Manager 2 PDO Assignment</Name>
<Type>DT1C12</Type>
<BitSize>64</BitSize>
<Info>
<SubItem>
<Name>SubIndex 000</Name>
<Info>
<MinValue>#x00</MinValue>
<MaxValue>#x03</MaxValue>
<DefaultValue>#x01</DefaultValue>
</Info>
</SubItem>
<SubItem>
<Name>1st PDO Mapping Object Index of assigned PDO</Name>
<Info>
<MinValue>#x0000</MinValue>
<MaxValue>#x17FF</MaxValue>
<DefaultValue>#x1701</DefaultValue>
</Info>
</SubItem>
... |
I think that will be of great help in further steps of my project, but yet I'm struggling even at triggering the PDOs 😓 |
I found the cause of my problem: I wasn't sending the right subitem size: // was doing this: implicitely a usize I guess, implying u64
slave.write_sdo(0x1c12, SubIndex::Index(1), 0x1600).await?;
// instead of this: u16
slave.write_sdo(0x1c12, SubIndex::Index(1), 0x1600_u16).await?; So |
Great to hear! SDO issues are pretty hard to debug so well done figure it out :). I'm not sure it's possible but if it is, I'll look at having an error to report incorrect data types because this is a pretty mean gotcha in the current API. |
The SDO abort code helped me actually
Since these error codes are part of the canopen specifications, it could be great to mention the received error code and eventually its string message in the error returned by Mailbox(Aborted {
code: General, address: 7186, sub_index: 1
errcode: ..., // maybe even implement Display so it can be printed with the error message provided by the canopen specs
}) |
Hello
This may be the first of a serie of stupid interogations for setting up a master using CoE
I'm trying to start a cyclic communication with PDO read/write on an omron servodrive (R88D-1SN04H-ECT), based on
example/ec400.rs
. While starting, the program stalls in the loop waiting forservo.tick()
. The slave never switches to OP and then often after ~2min, the program panics with the following log:Here is the code I'm running:
Do you think I am doing something wrong ?
The text was updated successfully, but these errors were encountered: