2
\$\begingroup\$

I intended to replace some DC motors (which have very unreliable encoders) with something better. I'm looking at BLDC motors with built in controllers. The ones I'm looking for are dimensionally compatible.

These motors (or rather the built in controller) has 5 pins:

  • 12v
  • GND
  • PWM_IN
  • DIR
  • FEEDBACK

The feedback is pretty common across many different designs, and gives 6 pulses per revolution of the motor.

I have ordered the motors that are compatible with my intended application, and had purchased a much smaller (but the same control scheme) version a few months ago on a whim, so I'll do some testing on that today.

Now, 6 encoder pulses per revolution is IMHO not sufficient for PID control. My test motor has a reduction of 1:45 and my application motors are 1:60. Intended speeds are about 10RPM. That would give 75 pulses and 100 pulses in a 1 min period respectively. Since you would likely need to do some filtering on the input in the form of averaging (examples I've seen average 8 ticks,) it would take several seconds to get an input for the PID controller.

This post indicates that the duty cycle on the PWM input has a linear relationship with the output of the motor.

Does anyone know if these motors / controllers already operate some form of PID control? Presumably there's some form of Hall effect sensor setup within the motor itself, and the controller is using this for control, and the feedback signal is generated from this.

This is my test motor.

This is my application motor (or very similar.)

The data suggests that the load RPM and no load RPM are different, which would indicate to me that there is no PID control.

Does anyone have any experience with this? I intend to do some testing later so will post results.

\$\endgroup\$
2
  • \$\begingroup\$ Should note that I got my maths completely wrong, 6 pulses per revolution of the motor and 45:1 gearbox would give 270 pulses per revolution of the output shaft, or 2700 in a one min period at 10RPM. About 22ms. Given that the application has 4 motors, and will need to work between say 2rpm and 15 rpm... i'm still not sure how workable PID is especially when some form of averaging is applied. \$\endgroup\$
    – Ben Bird
    Nov 11, 2023 at 15:58
  • 1
    \$\begingroup\$ Should note that I got my maths completely wrong Not quite: You should Edit your post into the best form you can. \$\endgroup\$
    – greybeard
    Nov 11, 2023 at 16:04

2 Answers 2

1
\$\begingroup\$

Typically these cheap BLDC motors function very similarly and often even use the same control chips as brushless fans. DRV10970 is a typical kind of IC, though I expect there exist cheaper parts with similar functionality. In the other question there is a teardown that revealed LB11696.

They are not designed for accurate speed control or fast response, though with external control that can be possible. The PWM signal directly gates the phase outputs, adjusting the effective voltage delivered to the motor and thus the speed. This functions similarly as adjusting voltage on a DC motor.

Biggest limitation for external PID control is that there might be no brake functionality. If you speed up past the target speed, you need to wait for external load to slow the motor down. This tends to make the control response very asymmetric and load-dependent. Though depending on specifics of the control chip, toggling the direction pin or lowering the PWM value may cause braking.

\$\endgroup\$
1
  • \$\begingroup\$ Interesting. The intended application is a 4 wheel (4 motor) differential drive robot chassis. Given the gearbox friction losses and chassis / payload mass I don't anticipate breaking to be an issue (with respect to control loops or otherwise). The intended speed of the robot is a maxiumum of 0.3 ms^-1 \$\endgroup\$
    – Ben Bird
    Nov 11, 2023 at 15:47
0
\$\begingroup\$

The motors (or, at least the DF-Robot test motor) does provide suitable feedback to operate with a PID control loop.

With that being said, i'm pretty terrible at getting PID loops to work properly.

I characterised the motor with cubic regression, and got the following equations where x is the target rpm and y is the PWM duty cycle -

no load -

y = 6.592e-05 x^3 - 0.01093 x^2 + 0.6897 x + 1.538

load (me pinching the shaft fairly tightly with my fingers) -

y = 4.569e-05 x^3 - 0.006554 x2 + 0.567 x + 4.002

These aren't worlds apart and will be fine for the application. BLDC (with feedback) have much better low end torque than DC so this will probably work.

As a side note for anyone using these motors, the DF robot one requires the direction pin being toggled to wake up when you want it to go CCW (if starting from 0 RPM.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.