It is too fast for my particular application so I just purchased an ODrive and encoders for the motors.
I would like to be able to stop at each plate in 90 degree intervals with the two motors running together in sync. They are locked together on the same drive “shaft”.
What is the best approach to turn the motors in sync such that they are not fighting with each other? I hoping to be able to use the gimbal motors I have as I really like the look of them but I am open to other motor suggestions as well.
We don’t really have the ODrive setup with an input block for managing two axes “properly” simultaneously, but you should be able to command a position to each of them as quickly enough that it won’t be a problem. One will be a positive position and the other negative. You may also want to run it in “counts in cpr” mode since you only care about positions with respect to the motor position, not some “linear distance” (0 and 8192 are the same position in your case).
With the inertia your system has, I would actually call “move_to_pos” for each one and let the trapezoidal planner handle it
What kind of encoder are you using? I have the motor in gimbal mode with a 24V supply, and I set resistance_calib_max_voltage to 6, current_lim to 8 and calibration_current to 4 (in gimbal mode the last two are voltages, even though it says current).
The current state is a crude mostly untested implementation in a PR. I haven’t had much time recently for testing this properly and working out all the bugs.
Thanks for the info. I have read through the getting started page and other documentation as well as the arduino library.
I have seen how to set to configure the trapezoidal planner and the related parameters but I do not see mention of how to use the move_to_pos function in the arduino library.
Can the arduino library implement move_to_pos or am I stuck to using odrive.SetPosition?
I just set up my gimbal motor today in gimbal mode and it is working perfectly via my macbook pro terminal. So after configuring the control mode as trapezoidal, I am assuming something like this would work, correct?
Is there a method of changing the motion control modes via the ASCII protocol? Is it even necessary to change it or can the different commands for the different modes work as is?
I think once the ODrive is booted into position control mode and working correctly, you can simply send the t command on ascii, and it should execute the move.
What libraries did you use to connect the ESP32? As soon as I add ODriveArduino and Set my board to “Esp32 Dev Module” I get conflicts with multiple SoftwareSerial.h and Constructors not existing in the library that work with the example.
Please Help? I have been trying to solve this for over a week now.
The examples work fine when I connect an Arduino Uno, but once the esp32 is connected it does not compile. I even went in and changed the libraries to have constructors that work with example and I can get it to compile. But no connection with odrive.
This setup sounds very close to what I’m trying to run. I’m using 5208-200t motors on two (yaw/pitch) axes and would like to run a control scheme as a simple two axis stabilizer.
The objective to receive the benefit of the Odrive’s power and BASIC gimbal 2 axis stabilization using PX4’s stabilization over PWM input. which is referenced here: