I am currently working on a balancing cube project (inverted pendulum) and am trying to implement the control side of the project but I have no idea what the best way is to implement this velocity independant torque control. I tried to use the torque control mode of the odrive but it just remains stationary rather than controlling the speed to produce a torque.
How would I implement a spinning momentum wheel which can be accelerated/decelerated to achieve a torque output?
Thanks for that! Took me a while to figure this out since I kept on getting an error. The input_mode function is actually located within controller.config as shown below. odrv0.axis0.controller.config.input_mode = INPUT_MODE_PASSTHROUGH
Now I just need to figure out how to make the Arduino side work. Pre-programmed commands work like:
When you send commands to the control mode, input mode, or state, you shouldn’t put the text. What you want to send is the integer value that corresponds to the enumeration that you want. See how we do this in the library as an example:
Of course… you could also just use the library and call odrive_serial.run_state() like we do in the example code.
Would the method using odrive_serial.run_state() also work with say the InputMode or the ControlMode?
I have however as per usual run into further problems. The Odrive doesn’t seem to do anything the arduino asks once I disconnect the usb between my pc and the Odrive. Likely just a setting somewhere but I am not sure where to find this.
EDIT: I would also like to reset any errors that occur on the Odrive (sometimes it randomly comes up with an encoder error) automatically from the Arduino. Is there a command accessible through the serial interface for this?