Hi all, I’m new to the subject of controlling BLDC motors and have a few questions about the oDrive.
I have a project that involves controlling the rpm of a bldc motor precisely. From say 100 RPM to 12,000 RPM or more. If I were to use a quadrature encoder at what count/sec would the odrive have difficulty (lose or miss counts).
Also is there an example using an arduino to set the velocity control and what would be the precision of it?
Project involves setting the RPM and Time for which the motor should spin. Would like to also be able to control the acceleration and deceleration of the motor. Lastly is there documentation on using a brake resistor with this drive?
Very possible these subjects have been discussed, appreciate if anyone can point me to those threads.
First of all, I don’t know if ODrive can run at 12000+ RPM. But nevertheless, if the only thing you care about is velocity control, then you can choose an encoder with a relatively low CPR. This way the ODrive will not have the problem of skipping counts.
The precision of the velocity control depends of many variables. Like the attached load, disturbances from the outside, motor quality, motor type, parameters from the PI loop for velocity control (more about that here https://docs.odriverobotics.com/control), but when everything is optimized, I find that ODrive does a pretty good job of keeping the velocity stable.
To set the velocity you can indeed use that command with the velocity in counts/second (I guess). If that’s the case, you will need to convert RPM to counts/second using the encoders CPR.
If you want acceleration and deceleration, I advise you to use the integrated trapezoidal trajectory planner. First of all, you will need to set an acceleration, deceleration and max velocity. After that, you can use the move_to_pos(targetCount) command to move to a specific location while respecting those previously defined parameters.
If you want to move the ODrive for a given time (so you don’t care about the final position), you can always build your own trapezoidal trajectory planner on the Arduino and calculate what positional parameter you need to pass to the move_to_pos command.
I think I made a very basic trapezoidal planner in the past, if I find the calculations I will post them here. They might be useful.
As said by Wemelon, I’d like to get as high a PPR as possible in order to get precision velocity control.
If I get the encoder with 2,880 pulses per revolution (PPR). At 12,000 RPM I’m at 576kHz. And at 100 RPM I’d be at 4.8kHz. Could go with 720 PPR and then have 144kHz @ 12,000Rpm and 1.2kHz @ 100Rpm.
Is 8 kHz really the maximum frequency I can run an encoder at with the ODrive?
For running 12,000 Rpm and 8kHz max frequency I’d be limited to 40 PPR.