Matlab-Simulink with 2 motors

Hi,

I just tried to control two 5065 motors with the Matlab-Simulink model in external mode with a raspberry pi , you can find the model here. With my first motor on axis0, everything works great. When i plugged a second motor and coupled their axis derecty at each other and run the model with both motors, the velocity of motor0, for example, never reaches the input velocity. I use constant Blocks for it. First the velocity goes up directy to the setpoint but drops slowly to round about the half of the desired velocity. What is wrong threre? Thanks :slight_smile:

I am trying now something new now. Instead of one model for both motors I created two different Simulink models: one for Axis0 in velocity mode and the other for Axis1 in current mode. I want the motor on axis0 to drive in a certain velocity while the other motor on axis2 is the load with a certain current. The Axis0 model works great, I have no problems there. But the Axis1 model does not even react, when I set the current input. Both models are equally configurated except the input mode. Maybe there is something wrong with the Odrive-Simulink block.

Where did you get an ODrive Simulink block?

See my first post. I got it from here.

Hi, how does the configuration look like? If something like this: PC with Matlab installed connects to Raspberry Pi, and Raspi3 is connected to Odrive? Can You explain , I would like to try Odrive with simulink directly to PC via USB. Thanks

I have been looking into that lately. And have started to program a system file.
I’ve based my code on some of what the rasberry pi model, showed before

It’s a work in progress using ASCII and serialport directly on matlab. If you want to help let me know
here