Why does my Simulink model terminate (CANBUS communication) without reaching the end of its simulation?

8 views (last 30 days)
Zubair Martin
Zubair Martin on 25 Nov 2021
Answered: Joel Van Sickel on 22 Dec 2021
I am in possession of two AK10-9 motors ( https://store.tmotor.com/goods.php?id=1030 ) which are connected on a single canbus line. To control these motors, I use a Speedgoat real-time target machine (module IO691: https://www.speedgoat.com/products/communication-protocols-can-fd-io691). I'm using the standard canbus message format (11-bit identifier). The two motors have built in 120 ohm terminating resistors while the Speedgoat does not. The motors take in five commands: desired position, velocity, torque, kp and kd to generate the desired current (as shown below). The encoder data includes the motor position, velocity, and torque.
My layout consists of a canbus line with two motors along with two terminating resistors at the end of line. The Speedgoat branches off the line as shown in the images below.
I plan to set all the motor input values to zero (desired position, velocity, torque, kp and kd to zero) and the commands are manually driven by an external input torque. The motors require to enter motor control before commands can be sent to the motor. Without entering the motors into motor control mode but setting the motor input values to zero, I am able to read the econder data from both motors via the Speedgoat. However, after entering the system in motor control mode and then setting the motor input values to zero (of both motors) - my simulation terminates. The below image shows one of the motors input commands (motor one and two - the only difference is that for motor 2 , the ID is set to 2 instead of 1).
Sidenote: The everything works perfectly with a single motor connected, only when two motors are connected (specifically both in motor control mode) is when the problem arises.
Why does the simulation terminate? Is there a way of reading the encoder values of both motors while in motor control mode?
Please let me know if additional information is required.
  1 Comment
Zubair Martin
Zubair Martin on 1 Dec 2021
Hi all, after some digging I found that when both motors are on the same aluminium plate - it becomes electrically coupled with it. I've tried placing electrical tape on the motors which finally made it work. However, for some reason using metallic (or nylon) screws to hold the motors in place cause the simulation to terminate. Id anyone perhaps has come across a similar issue, what steps have you taken?

Sign in to comment.

Answers (1)

Joel Van Sickel
Joel Van Sickel on 22 Dec 2021
Hello Zubair,
if it works when the motors aren't screwed down, and isolated by tape, and fails when they are screwed down while still isolated by tape, its likely the compresion is breaking the insulaiton provided by the tape. Obviously metal screws would break the insulaiton, but nylon screws would not (for motor voltage levels). however, unless you did a really thorough job with the electrical tape, it would be easy to see them getting reconnected once screwed down and pressing firmly onto the conducting plate. You might need to put the motors on vinyl washers to keep them elevated off the aluminum plate (assuming it wasn't desigend for cooling purposes, which the tape would already be ruining).
However, the fact this is causing things to crash might mean you haven't set up/isolated/grounded your can communication correctly. If your communication is isolated from your motors, chaning their grounding would have no effect on anything.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by