CAN Networking with 3rd-party device
5 years 10 months ago #29532908
by azglav
CAN Networking with 3rd-party device was created by azglav
Hi, we have a system where two Roboteq SDC2160N controllers are used to drive the joints of a robot arm and an extra RIOX card is used to read the arms sensors. All this is meant to be controlled by a RTLinux PC which supports CAN communication using CANopen protocol
We would like it if the controllers could access the data from the RIOX card and vice-versa to implement safety procedures without the need to go through the PC. We would also like to be able to send commands like initiating the homing procedure or setting initialization variables of the controllers from the PC without dedicating a RPDO to the functionality.
As I understand the controllers could easily communicate with each other using ROBOcan protocol, but the PC will be unable to read any data from the bus. This could perhaps be solved by implementing a way to construct and read the necessary CAN frames on the PC but since they are undocumented that is impossible. This means that by using ROBOcan I forgo the ability to control the controllers using the PC.
Using CANopen all the components can easily communicate with the PC and each other using TPDOs and RPDOs and the PC can use SDOs to communicate with the controllers but the controllers can’t use SDOs to communicate with each other. That means that if I need to transfer more data than there are TPDOs and RPDOs I am out of luck.
Is there a way to read and send ROBOcan messages from the PC?
If not can the controllers communicate with each other in any way other than PDOs when using CANopen?
We would like it if the controllers could access the data from the RIOX card and vice-versa to implement safety procedures without the need to go through the PC. We would also like to be able to send commands like initiating the homing procedure or setting initialization variables of the controllers from the PC without dedicating a RPDO to the functionality.
As I understand the controllers could easily communicate with each other using ROBOcan protocol, but the PC will be unable to read any data from the bus. This could perhaps be solved by implementing a way to construct and read the necessary CAN frames on the PC but since they are undocumented that is impossible. This means that by using ROBOcan I forgo the ability to control the controllers using the PC.
Using CANopen all the components can easily communicate with the PC and each other using TPDOs and RPDOs and the PC can use SDOs to communicate with the controllers but the controllers can’t use SDOs to communicate with each other. That means that if I need to transfer more data than there are TPDOs and RPDOs I am out of luck.
Is there a way to read and send ROBOcan messages from the PC?
If not can the controllers communicate with each other in any way other than PDOs when using CANopen?
Please Log in or Create an account to join the conversation.
5 years 10 months ago #29532912
by niko
Replied by niko on topic CAN Networking with 3rd-party device
Hello,
We can only propose you the following options. Of course we do not have full view of your project so keep that in mind.
1) If possible you can drop the PC and use RIOX as "PC". It can be programmed using microbasic (like the controllers), it supports RS232 and USB, has plenty of inputs outputs in order to use them respectively and RoboCAN with which you can control the motor controllers.
2) Use RS232 in order to connect RIOX with the PC. In that way the PC can query RIOX about any value and parse the reply. Also via RoboCAN the PC can query and command the controllers as well.
3) Use CANOpen on all modes. Use SDOs in order to command and query RIOX and SDOs in order to command and query controllers. Additionally TPDOs and RPDOs can be used in order to send receive any data you want. Any parsing or processing can be done with a script. So there might be 4 TPDOs for one controllers => 8 32-bit numbers.If you want to send more you can write a script which will send to TPDOs the first 8 32-bit numbers, at the second loop send to TPDOs the second 8 32-bit numbers and so on. Respectively the PC can parse these data.
Let us know if you have any questions on the above.
We can only propose you the following options. Of course we do not have full view of your project so keep that in mind.
1) If possible you can drop the PC and use RIOX as "PC". It can be programmed using microbasic (like the controllers), it supports RS232 and USB, has plenty of inputs outputs in order to use them respectively and RoboCAN with which you can control the motor controllers.
2) Use RS232 in order to connect RIOX with the PC. In that way the PC can query RIOX about any value and parse the reply. Also via RoboCAN the PC can query and command the controllers as well.
3) Use CANOpen on all modes. Use SDOs in order to command and query RIOX and SDOs in order to command and query controllers. Additionally TPDOs and RPDOs can be used in order to send receive any data you want. Any parsing or processing can be done with a script. So there might be 4 TPDOs for one controllers => 8 32-bit numbers.If you want to send more you can write a script which will send to TPDOs the first 8 32-bit numbers, at the second loop send to TPDOs the second 8 32-bit numbers and so on. Respectively the PC can parse these data.
Let us know if you have any questions on the above.
The following user(s) said Thank You: azglav
Please Log in or Create an account to join the conversation.
5 years 10 months ago - 5 years 10 months ago #29532916
by maple
Replied by maple on topic CAN Networking with 3rd-party device
I assume you do need PC in the system, even if nothing else but a user interface, in which case option 1 would be a no-go for you.
CANOpen (option 3) has an advantage of being a standard, so your system can be expanded with other CANOpen devices in the future. However it does require some extra work which may be tricky and time consuming.
Despite some issues RoboCAN is a great alternative. You can connect RS232 to any node in CAN network (not only RIOX as suggested) and have full access to all the data and configuration in any controller or sensor. You can even remotely upload new versions of scripts to the nodes if necessary.
All you need to decide is how decentralized your system should be. I would advise against any midway solutions, they bring nothing but headaches to the table. Go with either fully centralized system with minimum logic on the nodes, or with highly modular system where each node is fully responsible for its own part of the job and needs minimum guidance from PC.
Finally, I would add another option to the above:
4) From the documentation: "RoboCAN includes support for processing raw can data as defined in the RawCAN specification". I do not know how this works, but if it does you can use RoboCAN for all your control needs and design your own protocol to pass large amounts of data in RawCAN frames. This is basically an extension to option 2. I doubt that you'll need it, though. When you can set or query or scan anything on any controller the need for large data transfer goes away.
In short, if you have to stick to CAN-only communication go with option 3 and do some simple time sharing to pass large amounts of data. If you are OK with RS232 go with option 2 and use RawCAN to pass large amounts of data if you still need it.
CANOpen (option 3) has an advantage of being a standard, so your system can be expanded with other CANOpen devices in the future. However it does require some extra work which may be tricky and time consuming.
Despite some issues RoboCAN is a great alternative. You can connect RS232 to any node in CAN network (not only RIOX as suggested) and have full access to all the data and configuration in any controller or sensor. You can even remotely upload new versions of scripts to the nodes if necessary.
All you need to decide is how decentralized your system should be. I would advise against any midway solutions, they bring nothing but headaches to the table. Go with either fully centralized system with minimum logic on the nodes, or with highly modular system where each node is fully responsible for its own part of the job and needs minimum guidance from PC.
Finally, I would add another option to the above:
4) From the documentation: "RoboCAN includes support for processing raw can data as defined in the RawCAN specification". I do not know how this works, but if it does you can use RoboCAN for all your control needs and design your own protocol to pass large amounts of data in RawCAN frames. This is basically an extension to option 2. I doubt that you'll need it, though. When you can set or query or scan anything on any controller the need for large data transfer goes away.
In short, if you have to stick to CAN-only communication go with option 3 and do some simple time sharing to pass large amounts of data. If you are OK with RS232 go with option 2 and use RawCAN to pass large amounts of data if you still need it.
The following user(s) said Thank You: azglav
Please Log in or Create an account to join the conversation.
5 years 10 months ago #29532917
by azglav
Replied by azglav on topic CAN Networking with 3rd-party device
Thank you very much for the replies. I am controlling a robot arm using a Simulink schema which is compiled into C code and run on a real-time Linux PC for educational purposes. That means that the PC is necessary in the system and needs to communicate directly with all the controllers. We have planned to implement safety functionality and homing procedures using limit switches but since we don’t have enough digital inputs (we are using both analog inputs and encoders) on the controllers we needed to add a riox board. Also since the robot is used in educational purposes it is desirable to log a lot of data from the controller. That is why I wanted to bypass the restriction of using CANopen and its 4 TPDOs. It seems that it is the best option is to continue to use CANopen and impellent some logic on the controller to enable communication between the controllers and RIOX using TPDOs when necessary and use SDOs for infrequent communication with the PC (parameter changing).
Please Log in or Create an account to join the conversation.
Moderators: tonysantoni
Time to create page: 0.055 seconds