PID micro-processor

Hi,

I am new to all this but i am trying to design a DC motor controller that could control 2 montors at the same time that has everything in it(2 decoder, 2 H-bridge, 1 voltage regulator, 1 processor). The problem is, i dont know what processor to use, i could: a) Find a PID micro-processor(do they even exists??) so i don't have to do so much programming and stuff. b) Find a micro-processor that has 2 internal decoder in it so i dont have to buy external decoder. Also, my budget is around 30 dollars for all parts. So, do any of you guys know anything about PID-processor, or processor with 2 internal decoder??

thanks

Reply to
Ben
Loading thread data ...

Look at the

formatting link
. You'll find microprocessors (PIC) preprogrammed for PID implementations.

Reply to
<Yovslu Brown>

I did this using an ATmega8 and 2 LMD18200. I also incorporated an RS485 transceiver and implemented the ROBIN protocol to use for passing control packets:

formatting link
You can see a few photos of the dual h-bridge on my rover here:

formatting link
The rover is 4WD, so I needed 2 of these dual h-bridges - you can spot them as they are the boards with the large heat sinks (blue and gold - old i486 heat sinks cut in half, drilled and tapped and fastened to the LMD18200s).

The PID algorithm works very well - very smooth control over the motors. I use a radio modem link to control the robot, and a Playstation II controller to command it. The nice thing about the PID algorithm is that I can change the PID parameters on the fly to obtain different driving characteristics, from fluid smooth almost like gliding over ice, to highly responsive, choppy, movement. I have a few of the Playstation II buttons programmed to select the different characteristics and can switch the settings at any time. Pretty neat.

One of the keys to good PID response is to have lots of encoder feedback. The motors I used had built-in encoders and generate over

4000 counts per each revolution of the output shaft. That is one of the reasons I'm able to control the motor response so well.

-Brian

Reply to
Brian Dean

Your Robot's photos are COOL!... I loved it.. How do you count the quadrature encoder signals (A/B) ? Do you use an external counter or use thr ATMega itsel? Do you provide schematics and source code of your motor controller/driver circuit?

Reply to
<Yovslu Brown>

Thanks!

I use the ATmega8. But ... I only interrupt on the "A" phase of the quadrature encoder. At that time, I sample the "B" phase to determine what direction the wheel is moving and either increment or decrement the pulse count. I do this primarily because at 4000 counts per phase per revolution, that is plenty of feedback. A common technique with quadrature encoders is to interrupt on both phases for twice the resolution. But 4000 was plenty, so I had no need to have 8000 counts per revolution. Another reason is that the ATmega8 has only 2 external interrupts which I allocated 1 for each encoder. Switching to the ATmega88 would give me many more external interrupts and allow me to interrupt on both phases, but that chip was not available at the time I built that motor controller. Plus, it's not necessary for this motor in this application.

I have not published the schematics nor the firmware. The schematic is pretty simple though - nothing tricky, just interfacing the appropriate control signals from the ATmega8 to the LMD18200 - driving it in locked anti-phase. Use the ATmega8 PWM outputs for the "direction" input, and another pair of general purpose I/O pins for the "enable" lines. Use a pair of A/D converter inputs for the current sense output from the LMD18200. Encoder 1 phase A to one of the extern interrupts, and encoder 2 phase A to the other. Use a pair of general purpose I/O from the encoder 1 & 2 phase B signals. RS485 transceiver goes to the ATmega8 UART, and an I/O line to control the RS485 driver enable line. It's all just software after that :-)

-Brian

Reply to
Brian Dean

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.