Hi,
I clicked a little app together to get a better test. You need dot net 4.6.1 to run it.
https://drive.google.com/open?id=1kKuIi_Zo5Npc25uD6jVV-5sX5PyVmX6X
you can send your commands in defined intervalls and repetitions.
greetings / Zennix
Hi,
I clicked a little app together to get a better test. You need dot net 4.6.1 to run it.
https://drive.google.com/open?id=1kKuIi_Zo5Npc25uD6jVV-5sX5PyVmX6X
you can send your commands in defined intervalls and repetitions.
greetings / Zennix
Hi all,
after some more digging I found, that remarking the following block in ascii_protocoll.cpp solves the problem.
else if (cmd[0] == 'w') { // write property
char name[MAX_LINE_LENGTH];
char value[MAX_LINE_LENGTH];
int numscan = sscanf(cmd, "w %" TO_STR(MAX_LINE_LENGTH) "s %" TO_STR(MAX_LINE_LENGTH) "s", name, value);
if (numscan < 1) {
respond(response_channel, use_checksum, "invalid command format");
} else {
Endpoint* endpoint = application_endpoints_->get_by_name(name, sizeof(name));
if (!endpoint) {
respond(response_channel, use_checksum, "invalid property");
} else {
bool success = endpoint->set_string(value, sizeof(value));
if (!success)
respond(response_channel, use_checksum, "not implemented");
}
}
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.
Greetings / Zennix
Hi Zennix,
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.
Thank you for your work!
Hi CFluck,
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.
Greetings Zennix
Hi Zennix,
Thank you for answering!
did you also try to read out some parameters ? or did you just send position commands ?
Hi CFluck,
sorry, no. My use case only sends position commands.
Greetings / Zennix
@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.
Thanks.
Hi,
sure, I will keep it available.
Greetings / Zennix
Hi zennix,
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?
Thanks in advance
Cheers
Carelsbergh Stijn
Hi Stijn,
There is no progress on this issue.
You are right. Get the end stop branch and comment out as described.
Greetings / Zennix
Hi
Thanks for the reply,
Can you tell me something about the command that you are sending true SimTools to the ODrive?
Is there a guide on how to compile the code and write it to the ODrive with the st-link?
Thanks
Cheers
Carelsbergh Stijn
Hi Stijn,
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.
Building the firmware with VSCode is described here: https://docs.odriverobotics.com/configuring-vscode.html
How to handle the ST-Link is shown here: https://docs.odriverobotics.com/odrivetool.html#device-firmware-update
Greetings / Zennix
Hi
Thanks for the reply.
Can you tell me how you came up with the command p 0 262143 <13>p 1 2621143 <13>
Or is this something from the internet?
When you start up your system, do you first turn on your platform to do the encoder test and so on and after that start up the SimTools?
Cheers
Carelsbergh Stijn
Hi Stijn,
p is the normal ASCII position command of ODrive. https://docs.odriverobotics.com/ascii-protocol.html
<13> is a carridge return ASCII sign to show ODrive the command is finished.
Yes I always start the sim before I start simtools.
Greetings / Zennix
Hi
Thanks for the fast reply
And the 0 and 1 are the Axis?
Can you also answer this question?
Cheers
Carelsbergh Stijn
Yes
p -> Position command
0 or 1 -> Axis
2621143 -> position
<13> -> ASCII return
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.
Can you give us any info about that?
usbsys.ser on Windows 10? USB 2.0? I don’t really know what’s relevant here.
Based on what I read, the usb serial CDC connection uses usbser.sys as a driver on Windows. If you search for usbser.sys CDC on google, there are a lot of topic with people complaining about problems with this driver. It seems to be unreliable. For example: https://www.microchip.com/forums/m538194.aspx
And because reconnecting usb solves the connection, I think this driver is causing the problem.