Replies: 1 comment
-
Hello @N00BMIN3R, sorry your post didn't get a reply yet. It's quite a bit of information to parse and I guess most people (including me) cannot afford the time to dive deeply into your code and troubles. Try to read up some more on CANopen, maybe by studying other device manuals that show how the protocol is intended to be used in practice. The one you have from LINAK sounds pretty confusing to me, mixing up several concepts and misleading about the general CANopen idea. From a quick glance, in general it seems the PDOs are pre-configured for this device, but it doesn't say what triggers the TPDO. Usually you send a SYNC object from the master regularly and that triggers every device to report its state via TPDO. But there are other transmission types. If the device really behaves like a CANopen device, you should be able to read out these details live from the Object Dictionary:
That is misleading and totally unrelated. Whether your master (Node ID 1 here) sends a Heartbeat object or not should not matter to the device at all. It doesn't even have a concept of a "master" node, but rather all devices by default communicate with objects involving their own Node ID (720, 620, 5A0, etc.). Just disregard this entry.
Nice, so it's behaving properly, and says it's in Initialization state. No PDOs "exist" (in CANopen parlor) unless you switch to the Operational state, so it will react to its RPDO and transmit its TPDO.
You shouldn't need to do that, it's just an example reading the Consumer Heartbeat Time (0x1016:01) object. What would be a sensible exchange at that point is reading out the PDO configuration, so the python-canopen library knows about the data mapping and can provide you with meaningful names to access the PDO contents. That'll be a whole bunch of SDO exchanges though, during the
If you have the Producer Heartbeat Time object configured to some interval, you should get 0x720 objects regularly where you can observe the state change to Operational (05).
This is where the documentation should be clear under which conditions a TPDO is sent. Cyclic, caused by the SYNC object reception? Asynchronous in regular intervals? Whenever one of the involved values changes? Try to investigate the active PDO configuration, especially the Transmission Type entry. These are standardized modes, let's hope the device adheres to the standard enough to tell you what it expects.
This should be you sending the RPDO, with the contents according to the other table. The first field there specifies a command. Note that with PDOs, you don't specify object index and subindex anymore, it's just interpreting the data bytes according to the mapped layout. Or more in CANopen's official terms: The mapped objects are applied to the Object Dictionary when receiving the RPDO, either immediately or upon the next SYNC object. This again depends on the RPDO's Transmission Type configuration.
Whatever you need to exchange, there is no requirement to use SDO at all if the PDOs are preconfigured.
Apparently not, take the included table more as an example exchange, not as a recipe to follow. Hope that helps. If you have further questions, please try to ask as precisely as possible, with a limited scope. It's much easier to parse and answer than a truckload of logs and example scripts. Kind regards |
Beta Was this translation helpful? Give feedback.
-
Dear readers,
For my undergraduate electrical engineering graduation project I will need to get a Raspberry Pi 3 model b+ to communicate with a LINAK LA25 (eventually 4 to control some lift for Autonome Mobile Robots, but let's stick with just one for sake of simplicity) actuator using CANopen. The past few weeks I have learned as much as possible on my own about CANopen since its very new to me. To make communication possible I have bought the PiCAN2 DUO.
Then I found this wonderfull CANopen library for Python full of function and features that I need to make communication happen. So let's get to it. The first thing I want to get working is being able to move the actuator in different positions (with an RPDO), and get a read-out of this position (with an TPDO). Once I get this working, I will a basis for further expansion of the program.
First things first, let me tell you something about the actuator ON NODE ID 32 The actuator comes with a handy CANopen manual that I have added in the attachement (techline-canopen-user-manual-eng). Within this document there are 2 tables (0x2000 and 0x2001).
and
I also saw the following table which describes a starting procedure which is needed before PDO's can be send:
And also received an EDS-file from LINAK. Which I also have added to this plead for help.
I decided to start replicating the starting procedure first. I programmed the following: (See attachment boot-up.py).
Which resulted in the following CAN-log: (see CAN-log-start-procedure.txt).
Lets walkthrough that startup procedure.
So clearly I am doing stuff wrong, and I want to fix that. This is the first where I need this communities help with.
In the mean time I have continued on a bit of code (see CANopen Raspberry & LA25) that reads-out the Position, Current and Speed with TPDO's which works without executing the starting procedure properly? Seems a bit strange to me. But to position read-out for instance is correct.
However when I send RPDO's I do get an emergency error back. I have also added the CAN-bus log of that (NOTE: the NODE ID is 1 here). See CAN-bus-log.txt.
In summary:
I tried to make my question as compact as I could, if things are not clear please let me know! I will clarify as much as I can for you!
Thankyou in advance for your time dear reader :)
techline-canopen-user-manual-eng.pdf
Boot-up.zip
CAN-log-start-procedure.txt
LINAK-actuator-v3-1.zip
CANopen Raspberry & LA25v0.1.zip
CAN-bus-log.txt
Beta Was this translation helpful? Give feedback.
All reactions