0
$\begingroup$

I need to build a conversion/mapping algorithm from a controller (PID etc.) output to the duty cycle in order to command my bldc motor via esc. I couldn't do it yet because l think l dont know the meaning of controller output. Anybody highlights my way?

$\endgroup$
0
$\begingroup$

Usually you would use a PID controller's output as a "substitute" for your (the operator's) output. If you bypassed the PID controller, what signal would you be providing to the ESC? It is easiest to put the input to the PID controller and the feedback to the PID controller in the same units as you would like the output to be.

In your case, I would use a input and feedback as speeds in percent, then the output of the PID controller should be speed in percent, which is easy to provide in PWM form. If you try to compare speeds in km/hr or m/s or something else like that, then you wind up having to convert that speed into a percentage anyways because you don't send "2 m/s" to a speed controller, you send a speed setpoint - either in rpm or percentage. Again, whatever units the ESC is using are the units you should be using for your PID control.

$\endgroup$
  • $\begingroup$ How are you getting speed feedback? What units is the feedback in? $\endgroup$ – Chuck Jul 30 '15 at 10:50
  • $\begingroup$ The ESC already has its own internal PID controller and it usually uses back EMF as speed feedback. So, do you need motor feedback? Yes and no; I'm not sure what your application is. If you are trying to do process control, assuming some variable load after the motor, then you will need motor feedback, but if you're trying to do something like a quadcopter, then you should have a stability/flight controller that gives you a reference speed that you can pass directly to the ESC. $\endgroup$ – Chuck Jul 30 '15 at 13:38
  • $\begingroup$ You are correct in that, if you do need feedback, it will be in RPM or rad/s or some other rotational speed units, in which case you will need to calibrate your feedback. In general, though, I believe that if you multiply the kV rating by the nominal battery voltage you get the motor's top speed in RPM. Using this value as a max, whatever you get from feedback can give you a percentage, which is equivalent to the duty cycle. $\endgroup$ – Chuck Jul 30 '15 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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