Author Topic: Motor controller circuit  (Read 3102 times)

0 Members and 1 Guest are viewing this topic.

Offline sanketjogTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Motor controller circuit
« on: July 02, 2009, 10:58:13 PM »
Can anyone post the schematic circuit of a DC motor controller consisting a PID controller.

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: Motor controller circuit
« Reply #1 on: July 03, 2009, 12:11:08 AM »
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.

Offline sanketjogTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Motor controller circuit
« Reply #2 on: July 03, 2009, 06:45:44 AM »
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.

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: Motor controller circuit
« Reply #3 on: July 03, 2009, 10:49:53 AM »
Quote
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

Offline sanketjogTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Motor controller circuit
« Reply #4 on: July 04, 2009, 11:45:28 AM »
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 !!!

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
    • Tim's Workshop
Re: Motor controller circuit
« Reply #5 on: July 04, 2009, 11:55:29 AM »
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.

Quote
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.

Offline arixrobotics

  • Full Member
  • ***
  • Posts: 119
  • Helpful? 3
    • TalasTronics WCIT KL2008 Fund Raising
Re: Motor controller circuit
« Reply #6 on: July 05, 2009, 06:15:24 AM »
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.

Offline Suraj

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: Motor controller circuit
« Reply #7 on: July 06, 2009, 03:26:23 AM »
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.

Offline sanketjogTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Motor controller circuit
« Reply #8 on: July 07, 2009, 09:42:27 PM »
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.
« Last Edit: July 07, 2009, 09:43:40 PM by sanketjog »

 

SMF spam blocked by CleanTalk