CAN Bus Communication with Laptop

I want to use my laptop to control the Amiga robot. I am currently using a USB to DB9 RS232 Cable Adapter connected to my laptop, and then a DB9 RS232 to M12 CAN Bus cable adapter to connect to the Amiga robot. Could you provide me with a sample script to send control commands to the Amiga robot from my laptop?

Hello @Fujiwala, thank you for your message!

We don’t have an specific example for using it, but I believe you will find the FPV example and the very useful.

If you look at the FPV code.py and the Spacebar ESTOP code.py files, you will get a good sense on how to use AmigaTpdo1 to listen for the state of your Amiga and send back requests to the proper services.

Let me know if you want more details on this!

Hi @MScatolin ,

Thank you for sharing the FPV example.

I have written a program to send CAN bus messages from my laptop to the Amiga robot. It seems that the laptop can send the correct messages via the port, but the motors are recognized as unhealthy when I plug in the cables and I cannot set the robot to “auto control.” As previously mentioned, I am using a USB to DB9 RS232 Cable Adapter connected to my laptop, and then a DB9 RS232 to M12 CAN Bus cable adapter to connect to the Amiga robot.

Here are the situations I’m encountering:

When I plug in the cables and do nothing, several motors are always marked as red on the dashboard. I cannot even clear the e-stop to manually control the robot (Figure 1).

When I send CAN bus messages to the robot, the dashboard displays either “No healthy motors | Check for pressed E-stop” with 4 motors marked as red (Figure 2), or “No pendant or motors detected | CAN bus may be in a bad state” with the pendant and 4 motors marked as red (Figure 3). It switches between these two conditions.

Decoding the dashboard error messages, you will see that the motor error code 09 and pendant error code 08 are related to timeouts on these devices, which tells me you are probably working with the wrong BAUD rate.

Our CAN bus works on 250 kbps. Is that what you are using?

P.S.: Thank you for your message. When looking at the error page linked above, I spotted a couple items missing :slight_smile: . I will add those there ASAP.

Hi @MScatolin , I am using 250 kbps.

Hello,

Generally if you connect new hardware to a working CAN bus the hardware, or software driving the hardware, is what is causing issues.

There could be several causes and here are some examples.

  • CAN High and CAN Low wires backwards, or not both connected
  • Tool is not properly grounded/referenced to the Amiga
  • The default hardware state loads or locks the CAN bus
  • Adds too much termination when connected

We do not support 3rd party CAN tools, except for maybe the PCAN tool from Peak, which we use internally for development and testing. I am willing to review your setup to see if it is something simple that might be causing issues, if you can explain more about which tools and software you are using to try to communicate with CAN to the Amiga. Also confirmation of wiring from your CAN tool to the Amiga.

Link to one of the US distributors of the PCAN USB to CAN tool. Also the DB9 to

Also keep in mind, that when a CAN message is sent, and if there is not a proper acknowledgment it will spam the bus with retries, which can exaggerate communication issues. Sometimes making sure the CAN tool is fully configured and ready to send, and just receiving, is the best way to confirm your setup. This method helps to avoid adding new symptoms to debug.