Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: sanketjog on July 02, 2009, 10:58:13 PM
-
Can anyone post the schematic circuit of a DC motor controller consisting a PID controller.
-
A PID controller is done in software. you have to use encoders to measure speed or distance.
example: controlling the rpm of a motor.
collect the number of encoder pulses over a set period of time say 50ms
the amount of pulses will tell you the rpm.
Now you analyze the "feedback" (encoder pulses)
P (proportional): how far from the desired rpm was the motor running?
I (integral): total error. After each sample add the proportional error to this term.
D (derivative) compares the error of the current feedback, to the previous (change in P) error now - error before.
To make the controller work you have to assign constant values for these kp, ki, and kd. These values are dependent on your motors, and must be found experimentally.
the end equation is
for 8-bit pwm
input = kp*P+ki*I+kd*D
//this prevents values from being out of range
if (input >255) input = 255;
else if (input <0) input = 0;
motor_pwm = input;
hope that helps.
-
Can anyone suggest me which PIC shall i use to accept PWM signals from two encoders ? I tried PIC 16F876 but it has only 3 timers.
-
Can anyone suggest me which PIC shall i use to accept PWM signals from two encoders ?
the pwm signal is from the microcontroller not the encoder
-
Actually i am suppose to control the velocity,distance and acceleration of two d.c motors. I am planning to use Pic33 series Mcontroller. Can any experienced person post the interfacing diagram for two D.C. motors using PIC33...
Thanks in advance !!!
-
Before someone can give you a schematic you have to tell us what type of motors you have (current draw) and or what motor driver chip you would like to use.
Can any experienced person post the interfacing diagram for two D.C. motors using PIC33...
Thanks in advance !!!
And I'm going to infer you didn't mean I was not experienced enough to help you.
-
I've used a dsPIC33F to do PID motor control before.
If you look at the datasheet, it has a built-in Quadrature Encoder Interface and Motor Controller PWM modules to help you with what you want to do.
You will need to go through the datasheet first and then ask further questions here. Don't just ask people for a complete solution.
-
Hi friends... I have heard lot of people using the same IC PIC33.
But to my knowledge there are many other IC like Philips LPC2294 and others have similar functions and I guess more powerful.
Can we discuss why PIC33 is a favourite amoung many people. Or has any one worked on a better IC.
-
The block diagram I've sketched is attached please take a look at it and give your views on it.
So is it feasible to realise this using the specified components?
Also please do reply the specific pic33 microcontroller that can be used to realise it.