1
\$\begingroup\$

I got a few motor similar to the image below from a old scanner and I want to apply them in a robotic arm to move the arm because BLDC motors have a large torque I then control with arduino. Well, in order to do that I came across that maybe I would need to control their position moving at 60 rpm would be a reasonable speed (PID controller right?). Also the specification of a similar motor is at the link below to more informations. https://www.nidec.com/en/product/search/category/B101/M102/S100/NCJ-42M-FeH/

Questions Where I can find a step-by-step instructions to build my own PID like hardware needed, electrical circuit used, etcc?

enter image description here

I really appreciate your support guys!!

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

http://robotsforroboticists.com/pid-control/ seems to have a fairly simple PID pseudo code implementation. Also, it has some info into how to tune the gains.

In any type of control you gonna need to vary the input, in the case of DC motors is changing the supply voltage (or PWM). And you need feedback of the output, for motor is a tachometer or encoder, check the motor datasheet if one of the pins from the assembly would provide feedback on the rotation speed.

Transform that feedback into RPM and use that value as, in the PID example above, actual_value. Transform output so it can be used as your PWM bias.

I also suggest using unwinding for the integral error and output. Simply use if/else conditions to avoid those variables to exceed a threshold you defined.

To control the motor you can feed the PWM output into the gate of a N channel MOSFET, and connect negative terminal of the motor and ground throught the mosfet terminals.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Thanks Otavio, If I undestand the model you refered is like the link but using a sensor feedback... simple-circuit.com/arduino-brushless-dc-motor-controller in order to control the position and not the speed do I need to convert the rpm feedback into angle? \$\endgroup\$ Commented Apr 17, 2020 at 17:29
  • \$\begingroup\$ Controlling angle on BLDC motor won't be simple, they have high spindle speeds and the rotor is free, so any torque will change the angle set. My suggestion would be to use a stepper motor as they are built for that. If not possible a high ratio reduction might do the trick, i would look for something like 100~200:1, planetary ones are good as they are usually not reversible. And yes, if trying to control angle you can use the same PID algorithm, but you gonna need a encoder to translate the current angle (you can get one from mouse wheels) \$\endgroup\$ Commented Apr 19, 2020 at 15:21
  • \$\begingroup\$ Hello otávio, thanks for your support! Yes, I know stepper motor is better to control the posistion but my idea is to use bldc because they are cheaper and can hold heavier weights. yes, as they have high spindle speeds I must have to use a ratio reduction and also a encoder as you mentioned. I was thinking about to acomple the 0 degre of the rotor gear to a ratio reduction and 180 degres a potenciometer, the problem of the mouse wheels I saw is that it does not stop when reaches 361 degres but the potenciometer does. more ideas? \$\endgroup\$ Commented Apr 20, 2020 at 17:31
  • \$\begingroup\$ You are right @BrunoPimenta, the mouse wheel will be a relative encoder; you will need to keep track of the angle in your code. There are several options for angle feedback, it all depends on how much you wanna pay. Some DC assemblies, like the one from your photo, already have a build-in encoders. The motor on the photo have 6 pins, try checking what signal is in each. Using a potentiometer will work but it gonna have error and noise can make the control unstable, so use some digital filters, overspinning the motor will also snap the potentiometer, so I suggest some hardware to prevent that. \$\endgroup\$ Commented Apr 21, 2020 at 18:28
  • \$\begingroup\$ I'll definitely do that! I'll Bring the results up next time! Thanks!! \$\endgroup\$ Commented Apr 22, 2020 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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