Position Control of a Brushless DC Motor w/ an encoder

I have a ~7 Amp continuous Micromo Brushless DC motor with a HEDS 5500 encoder which will get me ~500 lines per revolution. I'm looking to control this motor in a range of 0-180 degrees in a repeating sinusoid sweep. I have a really simple program in Arduino that runs my prescribed trajectory well on a servo but my current application requires much higher torque/higher speed, hence the need for a beefier motor.

I have a dedicated 24V 10Amp power supply which will power my motor. Does anyone have any suggestions as to how to set up a system to control the position of this Bushless DC motor using arduino?


Is this a geared motor or are you looking to have it be direct drive?
Most brushless motors and motor controllers are designed for continuous rotation, not movement like a hobby servo.

As in, when you tell the motor to go, it does so at many hundreds of revolutions per minute.

That does not fit with the 0-180 control you are looking for.

There are some broshelss motor/controller combos that do behave like a servo. Google up the term "brushless gimbal"

Thanks for the reply!

There is 4:1 gearing at the output shaft. These gimbals are interesting and I've also found some examples online of people precisely controlling their brushless DC servos using arduino and a potentiometer but not a lot of information about those setups.

I think I have an encoder that would make such a setup possible I'm just hoping someone else who has had some experience in this area could shed some light on it.

A few things.

4:1 is not enough reduction to use a standard ESC to get controllable 180 degrees of rotation on the output.
The motor would have to have positional control in a range of 2 revolutions. Either you need more gearing and a bi-directional ESC, or you will have to look at the gimbal style motor control.

Your encoder is not an absolute position device. It will be good for measuring relative changes, but it will not know the position when it starts up. If you put a limit switch at one far end of the movement, you could initialize the device on startup by moving until the limit switch is triggered. Then you will know you are at the far end of movement. Then you can keep track of encoder pulses to track absolute position.

Other than a sinusoidal sweep, you have not told us much about what you are really trying to do. Will an initialization step moving to one far end of the movement range be workable?

The application is going to be used on an experimental device to simulate fish motion. So an initialization step would not be an issue at all and the limit switch is a great idea!

I have a question about the gearing. What about the gear ratio isn’t workable? Is there some maximum RPM value that I should be aiming for when adding more gearing or do I need more resolution in my lines per revolution. My understanding was if I am getting 500 lines per revolution then that would be 2000 counts/rev and with my gear ratio 8000 counts/rev, is this resolution too low? Or am I confused about the fundamentals here?

thanks again for the help!

I think fundamentals. :slight_smile:

The issue is not being able to measure the output.
The issue is being able to control the motor at the required accuracy.
Most ESCs will not let you control the position of a motor to a fraction of a rotation.
They are great at telling the motor to start turning.
They are great at telling the motor to turn fast or turn slow.
But just the startup of the motor, where it is transitioning from a stop to stable movement may take several revolutions.
If you are looking for accurate positioning of the output over a 180 degree range, that means your 4:1 motor will need accuracy within 2 revolutions.
How much accuracy do you want with the output? 1 line of your encoder?
That is .72 degrees. Your 4:0 motor will turn 2.88 degrees.
Standard ESCs do not support this small movement.

2 ways to fix this as I have said.
More gearing. Let the motor turn many revolutions for each revolution of the output.
you can even do an experiment. Hook up your encoder to the output of your motor. Read the output of the encoder. Start the motor and read the output until your encoder has read 10 steps. Then stop the motor but keep counting. How many steps did it actually move between the start and stop of the motor? If it is just 10, then I am all wrong. But I bet it will be much more than 10.

Or, a different motor controller that supports gimbal style movement. I have read about these, but have no real world experience.

Hmmm, I see the problem now. the issue is with more gearing I am going to lose my high speed which is kind of the whole point of going with this motor in the first place. I'll do a bit more research on the gimbal style movement control and see if there is anything i can make work for me in that area.

If this method doesn't work I'm looking into buying a more advanced motor controller from the manufacturer, something that will do some of the more complicated work for me.

Thanks for all your help with this!

What is your period of osculation? How fast will the motor need to be? And I guess, how fast is the motor itself?

On another thought, can you do this mechanically? Is is possible to use a mechanical arrangement to drive the fish mechanism? Rotary movement to sinusoidal movement is fairly common.

Over the range of 180 from start to end and then back to start the motor will be oscillating between 1-2 Hz.

The issue with a mechanical solution is that this is not a traditional sinusoid. I'm using about 12 different designed modified sinusoids in these experiments and several will result in very high velocity peaks needing speeds of ~3600 degrees per second to be within the factor of safety. The motor I'm using with the gearing has a max speed at around ~6000 degrees per second, so I don't have too much more room. There are also various torque concerns but if a higher gear ratio is needed then that isn't really as much of an issue.