6DOF motion platform using ODrive

And here is a short status of my Project:

  • The main material and parts to build 1 prototype-actuator arrived and are waiting to be worked with :

  • I built a simple test stand for first tests with electronic and software:


Peter W.

So at the end of the introduction of my project I have reached the following status:

I downloaded the odrivetool and simtools and after some trials i was able to run the calibration sequece…it worked and I am super happy !!! :slight_smile:

But… now I am standing in front of a mountain called “software” and every code thats written in the tutorials seems to be chineese language for me.
Maybe somebody (…,Zennix? Stijn?,…) could give me some hints on how to continue ?

My main questions:

  1. Do I have to follow all the settings listed in “Configure M0” before I can continue/ see wether the motor and simtool is working together?

  2. After reading different threads it seems to me, I have to write some kind of “software” in order to fix the right settings and start-procedure…oh man…thats way too complex for me!! :fearful:
    (It´s 30 jears passed when I learned simple “Turbo pascal”…)
    So my question is: how can I get a working *.config, without beeing a software-developer? :wink:

  3. How can I manage to see the complete *.config (?) At the moment I can only see the current commands in the “Anaconda-prompt”

Thanks in advance for any hints!
greetings
Peter W.

Hi Wicki,
great construction :+1::clap:

Now to your questions.

  1. Settings
    The combination of your motor and the decoder is the standard configuration in the Odrive settings.
    So, your motor is spinning without any changes.
    But, later on, when you want to get some performance you have to tune it.

  2. Firmware
    If I understand your previsious post correctly, you have ODrive Tool running. With this tool you are able to set all the parameters you need and save it to the board. Also you can write a new firmware to your board.
    odrivetool dfu path/to/firmware/file.hex

  3. Config
    You can save your complete config with odrivetool backup-config my_config.json

  4. Endstops
    Do you need endstops? The master branch didn’t support endstops. There is a branch from Wetmelon that could do this. But it’s not merged to the official branch yet.

  5. Connection to game engine
    connect the Odrive to your gaming machnine. You will find a new seriel port.
    Have a look at this: ASCII commands makes ODrive unreachable
    For simulators you need only postion commands. Fast movements to a specific position. Accuracy is not the major thing. We send a position command every 20ms to Odrive. But unfortunately there is a bug in the firmware. After a few commands, Odrive will hang. I found a work around described also in the previsous link.
    I wrote a little programm to test the configuration. You can find it at the same link.

Greetings / Zennix

Hi Zennix,
thanks a lot for your help! I will go through it the next days.
kind regards
Peter W.

Hi

Thanks a lot for al the information!

Carelsbergh Stijn

Hi Zennix !

yesterday I went through your Topics:

  1. OK. Made some new configurations and the calibration sequece worked still good. But I was not able to spin the Motor. Please see: https://discourse.odriverobotics.com/t/setpoint-command-doesnt-work/1642
  2. After trying to write the latest Firmware with the “odrivetool dfu” command only, my Odrive is “dead” now and will not be found again when typing “odrivetool” to the prompt. Only with the DIP switch in DFU mode my computer will recognize the Odrive.
    Please see my Question to the Odrive support:
    https://discourse.odriverobotics.com/t/error-after-trial-to-load-new-firmware/1641
  3. OK
  4. I will have reed-switch endstops, but I will them inplement later after my prototype will work fine.
  5. I am so sorry, but currently I am not skilled enough to follow These steps. Maybe later….

Now, after trying lot of hours only to get the motor spinning I am a little frustrated. For me personal the Odrive does not seem to be a “enduser-finished” System yet.
For me as an software-newbe in combination with the remaining Software issues, it is a nearly undoable challange…….

Kind regards
Peter W.

Hi Wickie,
don’t be frustrated. Nobody says that Odrive is a ready build, end user friendly device. You have to read a lot and ask some people for help.
For your first question look to the thread.
For your second problem, I can not help you. I always use a ST programmer like this:


At the beginning, my ODrive was also unaccessible after rebooting sometimes… But with the programmer you can always flash the firmware again. You do not need any knowledge about editing the firmware code.
My suggestion is: prepare a development environment and buy a ST-Link.

Greetings / Zennix

Hi Zennix
Thanks a lot for the fast reply!
I have an ST-Link at home and try to dive deeper Into it…:grinning:
Peter

Hi Zennix, Hi community
first I want to wish you and the comunity a happy new year!!

Regarding the ST-programmer: Now I tryed several hours to get the OpenOCD get running. But without success. Although I did all steps according to the manual my computer can´t start the program. When I open the *.exe file, the programm seem to start for a fractual second, but then…nothing. I also tryed lot of compability settings…but also without success.
(Remarking: I have a new Windows 10 computer with an i5 processor and RTX-graphic card - so no old stuff)

So I swaped to an other DFU-tool called “DfuSe”. Its recomendet in the chapter: “Upgrading firmware with a different DFU tool”.
After installation the program is now running .
But it does´nt recognise the ST-Programmer (Available DFU Devices).

Bild-DfuSe-1

I changed the drivers with the Zadig-tool several times, used a second ST- Link (I ordered two), forced the Odrive in DFU-Mode, changed the USB-Ports, rebootet my computer and the Odrive, checked all wiring …but…nothing, the program does´nt recognise the ST-Link!!

Something goes completely wrong…

Anybody in the comunity with any ideas, same experience ?..

greetings from a lost Peter W.

Hi Peter,
happy new year too.

If you connect your ST-Link it has to be shown in yourt device manager. Do you install the correct driver?
https://drive.google.com/open?id=1lh6c8yppO8CyezMrd5QOS4_LbPg9eKeu

ST-LINK/V2

One example of compatible drivers are the ST-LINK/V2 USB drivers, from ST, available as part number STSW-LINK009. Download the stsw-link009.zip archive, extract its content to a separate folder, and run the dpinst_amd64.exe (or dpinst_x86.exe ) with administrative privileges.

Greetings / Zennix

Actually you have to do some minor changes to the code, so you also have to follow this manual: https://docs.odriverobotics.com/configuring-vscode.html

Greetings / Zennix

Hi Zennix,

thank you so much for your fast reply!!!

Answer to your Question: “Do you install the correct Driver”:
I installed the driver again and it is shown correctly in the device Manager:


Answer to "ST-Link/V2: I also followed your proposed steps:

The zadig tool says following:

Nothing improved……

Hi Zennix,

I followed the Manual you mentioned (https://docs.odriverobotics.com/configuring-vscode.html)
a few steps, but I a am sorry…thats much, much, much too difficult for me.
I have a collegue at my work and he is a professional programmer…maybe he can do this steps for me.

Hi all,

After some more hours of reading and trying, I finally managed to flash the new Odrive firmware only with help of the DfuSe -Software!

Two sources that gave me the starting spark to the missing steps:


and a youtube-video:

Now my Odrive ist working with the position commands :
needless to say I am verry happy now!!! :smiley:
Thanks to all who gave me the right hints!

regards
Peter

Hi Peter,
thats really great that you made it. :+1:
You are now half the way up the “software mountain” :smile:

The master brunch has some issues if you try to use the serial command interface like we have to. Also it didn’t support end switches.
The branch with end switch support comes from wetmelon and is located here:
https://github.com/Wetmelon/ODrive/tree/Endstops

How to use it:

I downloaded the latest version and did the fixes for you.

Greetings / Zennix

1 Like

Hi Zennix!
thank you so much for your help and efforts! I appreciate this very much!
I imediately flashed your custom made firmware and it works so far, but I have some errors codes I have to check for the next days.

I am not sure how to connect the end switches to the Odrive. I think the connection has to be made from GPIO Pin 8 to GPIO Ground or any voltage pin?

Do I need the switches for the startup procedure or can I test your firmware without switches (maybe temporary disable the switch in via the config?
best greetings!
Peter W.

Hi Peter,
there are a lot of additional settings through the ODrive Tool. Please have a look to the thread I have shown in my last answer.
You have two switches per axis. So you will need 4 GPIs for two axis. You have to enable the endswitches otherwise it’s like a normal branch firmware.
I have my switches active low, means switches GND to the GPI but you can define it in the settings too. I had some debouncing, therefore I connected some caps between the GPIs and GND. Described all in the upper thread.
Greetings / Zennix

Hi Zennix,

Today I studied the Odrive-commands that are given in the Odrive documentation and I made a summary In order to get a better understanding for building of the commands:
please have a look (still in progress…):

But I found that a lot of commands and settings shown in the firmware are not explained or shown in the Odrive documentation. So its difficult for me to optimise the firmware for my system without having a detailed understanding of the commands !
what to do!!!

I changed some settings in your firmware, but I am not able to get the Odrive running with the firmware. Now there is an error shown, that I can´t find in the troubleshooting. It is error = 0x0040
please have a look:
Fehler%200x0040

Kind regards
Peter W.

1 Like

Hi Peter, nice job with the spreadsheet, for us with little experience in this stuff, maybe it will make using and experimenting a bit clearer.

“I’m having a stab here” do you think it could be related to an encoder error?

  • ERROR_NO_RESPONSE = 0x04

Confirm that your encoder is plugged into the right pins on the odrive board.

However, You’ve probably checked that already.

Regards Jerry.

Hi Peter,
I gave you the latest build of the endstop firmware. I have a version running from september last year.
https://drive.google.com/open?id=1lOZ5YWdu3BavNJusFNKw6GGAO-fryOhN
You can try this. But I have made some settings inside the firmware, so I didn’t have to make it after every flash progress.
The changes are as follow:

axis config:
startup_motor_calibration = true; //<! run motor calibration at startup, skip otherwise
startup_encoder_index_search = true; //<! run encoder index search after startup, skip otherwise
// this only has an effect if encoder.config.use_index is also true
startup_encoder_offset_calibration = true; //<! run encoder offset calibration after startup, skip otherwise
startup_closed_loop_control = false; //<! enable closed loop control after calibration/startup
startup_sensorless_control = false; //<! enable sensorless control after calibration/startup
startup_homing = false; //<! enable homing after calibration/startup
enable_step_dir = false; //<! enable step/dir input after calibration

encoder config
use_index = true;

motor config
current_lim = 30.0f; //[A]

controller config
vel_limit = 50000.0f; // [counts/s]
homing_speed = 4000.0f; // [counts/s]

As we have the same config, so you can use it as it is. Maybe the current and the vel_limit is to high for testing. With your encoder you can use index search as well.
Normally your settings are kept after a flash but you should know that the default settings has changed.

Thanks for your spreadsheet.
You should add the vel_limit. It limits the rotation speed of your motor.
And save_config.

Greetings / Zennix