# PID controller of a servo motor

I am working on a project where I am using camera to determine the position of two joints of a planar two link manipulator. For motors, I am planning to use pneumatic motors in the project but as currently it is not available to me, I am using normal servo motor. I wish to make PID controller similar like servo motor using camera. Does this make sense?

Should I use continuous servo motor for this?

PID

Let me see if I understand you.

PID is used to control some output, such as position or speed or something else.  It does so by comparing the actual measurement of position or speed to the desired quantity, then applying new control outputs.

In your case, you want to control position of the camera.  If I understand what you are asking, you also want to use the camera to measure the actual position, then apply the PID.  If that is not correct, please clarify.

If that is correct, then you can use the camera image to provide feedback for PID, but it may not be easy.  You will need at least a little bit of image processing.

As for the type of servo to use, if a regular servo has enough range it will be easier to use it.  Most of the time a continuous servo is used only when the motor needs to turn more than 180 degreees.  If 180 degrees of rotation is not enough or if the positioning accuracy within that 180 degrees is not high enough, then you should use continuous rotation servos, or some other type of motor.

Proportional, Integral, Derivative Control

You can certainly create a PID using a normal DC motor and the camera as the “position feedback”. You’ll need the camera to recognize the angle of the link, have an intermediate program / code which controls the signal being sent to the motor controller, which affects the motor’s velocity and acceleration. If you don’t have a computer vision software, try OpenCV.

Proportional

I think you meant “proportional,” integral, derivative

PID can be used for much more than position

I am trying control the

I am trying control the position of the two link manipulator. In the final part of the project, electrical motors will be replaced by pneumatic actuators. That is why I am developing a position feedback system using the camera. The camera is in a fixed position looking down on the two link manipulator.

Thank you for your guidance. If I use DC motor then how can I control the motor? Sorry for asking noob questions. What kind of circuit do I need to control the DC using PID ?

Feedback

Controlling the motors is the easy part.  Getting the feedback from the camera is more challenging.  As CBenson mentioned, OpenCV would be a good option if you are using a computer that can run it.

What you will need to do, whatever system you use, is determine the position of the manipulator in the image.  Once that is done, it is the same as any other feedback control system.

What kind of system is the camera connected to?

DC motor control

If you want to use simple DC motors instead of servomotors, you will need a DC motor control chip or board.  Here is one:

https://www.robotshop.com/en/pololu-dual-dc-motor-driver-1a-4-5v-3-5v-tb6612fng.html

Proportional

Not noob at all.Camera ->

Not noob at all.

Camera -> Computer -> Computer Vision Software (ex. Open CV) -> Control Software (Might be optional) -> Motor Controller (USB for example) -> Motors

The question is if the computer vision software you select can send commands to an external motor controller. Easiest would be USB or serial. Consider Arducam might be an interesting option if you can’t use a full PC, though there’s a nice interface for a Raspberry Pi.

Airers

I can relate.  We need implantable semaphores

Also PID used for speed control of various motor’s like DC motor and used for position control

how to programming PID controller at servo UBTECH 12 HC with MPU6050?

thank you