Cannot set or read torque constant

Hi all

I’m currently trying to correctly set the parameters of my motor (Dual Shaft Motor - D5065 270kv).

I am trying the following in my setup:

odrive_serial << "w axis0.motor.config.torque_constant " << 0.0306f << '\n';

that value is calculated as explained on the odrive website 8.27 / KV of motor, so 8.27/270 in my case.

but when i try to read this value with the following code:

  odrive_serial << "r axis0.motor.config.torque_constant\n";
  Serial.println("torque constant: ");
  Serial << odrive.readFloat() <<'\n';

It allways returns 0.000… I think the arduino code is working so I dont understand why it is not reading 0.03 ?

Are you on 0.5.3? There is a bug in 0.5.3 ASCII, so please upgrade to 0.5.4 to see if your problem is fixed.

Hello,

I just upgraded the firmware to 5.3 (I was on really old firmware, around 4.11 I think). I also installed odrive tool (which is awesome). Before that I did everything with the arduino, which was a bit of a mistake i guess.

Anyway, using odrivetool i was abe to set the torque_constant. I will try and make some improvements to my arduino program to check if it can now write to it as well.

Thanks for your help!

Hello all,

today I tried upgrading to the latest firmware using the hex file found here Release Firmware version 0.5.4 · odriverobotics/ODrive · GitHub

I specifically downloaded ODriveFirmware_v3.6-56V.hex

I followed the instructions to flash the odrive using STM32CubeProgrammer and everything seems to work fine…

but when I read the revision with odrv0.fw_version_revision in odrivetool it still says 3…

So I assume it has failed and I am still on 0.5.3… any advice?

(By the way I work like this because the odrivetool dfu command does not seem to work on my windows machine…)

So just a small update: this morning I tried to calibrate the motor with the arduino and now that part at least worked, even though I did not make any hardware or software changes this morning… (For some reason last night nothing was working…)

This was the reason I wanted to upgrade to 0.5.4, because of the explanation above that there are bugs in 0.5.3 which might lead to some communication errors…

I still seem to have problems with for example trying to change the odrive control mode via arduino commands… So I still suspect some things are going wrong.

What I will do is I will upgrade my arduino to a mega, so I can stop using software serial and have a more robust connection.

In the meantime, any advice on how to upgrade to 0.5.4 is still welcome, because I suspect this will be needed as well…

thanks all

edit: I did some more testing,

installed fw 0.5.1 and odrv0.fw_version_revision returns 1
installed fw 0.5.2 and odrv0.fw_version_revision returns 1 again
installed fw 0.5.3 and odrv0.fw_version_revision returns 3
installed fw 0.5.4 and odrv0.fw_version_revision returns 3 again
installed fw 0.4.12 and odrv0.fw_version_revision returns 0 ?
installed fw 0.4.11 and odrv0.fw_version_revision returns 11

In other words, I will assume that this revision value could be incorrect… I think the installation of 0.5.4 went well and I am on the correct firmware

Looks like we screwed up. 0.5.4 got released as 0.5.3-dev.

0.5.4 is:

odrv0.fw_version_major == 0
odrv0.fw_version_minor == 5
odrv0.fw_version_revision == 3
odrv0.fw_version_unreleased == 1