Hi all,
I try to connect the output of a simulator software to ODrive.
My setting is a 3.5 board with the latest devel branch. Connected is a KEDA motor with mounted AMT102.
The startup sequence is running fine and the motor resposes to the commands through a serial connection.
Everything looks good till this point.
As you can see, the software sends a initial positioning command, waits for 1 second and starts to send positions every 50ms.
ODrive sets the motor to the initial position and after getting some of the commands, it stops responding.
hex(odrive0.axis0.error) shows nothing, the software hangs.
If you want to test this, use HTerm, it’s a pretty terminal programm for serial connections.
Make a file with just one command like: p 0 32000 0 0 (+CR)
In Hterm you can send this file coninuously.
I know, that block shouldn’t be used, without sending a “w”. But that’s what I found. After remarking it, I was able to send thousands of commands with a distance of 10ms. I’m not really confirm in programming ST32, maybe somebody can tell me why that happens. Maybe the If else is to long and the serial receive interrupt fires before the routine is finished.
I think I may have the same problem as you do (explained here).
So I was wondering what you mean by “remarking” the block of code ? Did you suppress the “else if” so that this block is always called even when you don’t send “w”?
So I guess that if this is what you do, it means that you can only write property, but you can’t read anymore.
looks like, we have the same problem. I commented out the hole block shown in my post, so everything is used but ‘w’.
I couldn’t test if removeing other unused parts of the function will fix it too.
@Zennix I have made a github issue for this bug. Can you please keep your test probram available at that google drive link, and we will use it when we get to addressing this issue.
Is this problem still present? I’ve started to word on the program of my simulator. If the problem is still present, do I have do download the end stop branch, after that comment out the problem you mentioned and after that compile it and load it to the ODrives?
depending which decoder you are using you have to find out, how many steps will be made for a full travel of your actuator. With this information you can set the output bit range.
With the endstop branch you can do a initial find zero run. After that, the actuators stops at position 0. Now my game-engine startup output sets the actuator to it’s middle position. In my case 262143.
Now Simtools send a position command every 20ms.
Stopping the game, sets the position of the actuators to middle position again.
I’m still having trouble with serial ASCII commands. I’m using Simtools to send commands to the odrive. This works for a while, but suddenly the motors stop moving. I was able to reach the odrive through odrivetool and was also running a plot. Both showed no errors. odrv0.axis0.error was also 0x0000. I could still control the odrive with pos_setpoint. COM3 was still available in PuTTY, but the odrive didn’t respond to serial commands anymore.
Is there a way to debug the serial protocol? The serial buffer for example? I don’t see any relevant properties I could watch in odrivetool.
EDIT: After unplugging and reconnecting the usb cable, the serial connection worked again.
Still looking for the problem and solution…
I think I found the problem. It seems that the driver, usbser.sys, that is being used for usb-serial communication is unreliable. That’s why reconnecting usb solves the problem.
Can anyone confirm that?
I’m going to try to use a Teensy 3.2 as usb->serial->step/dir interface. Because I might combine the odrives with other servo drives in the future, I can keep using the step/dir interface.