Saturday, December 4, 2010

PID Velocity Motor Controller

Over the last few days I have been working on a simple PID velocity DC motor controller that will be my entry to the Trossen Robotics contest. While it is not a project that is new or novel I feel that documenting and sharing the creation of the full system from top to bottom better fits the contest's judging criteria.

This post will serve as an update on the progress I have made on the project thus far.

My setup for development consists of a MINI robocontroller from Vanadium Labs, DC Gearmotor from Pololu and wheels from BaneBots. The MINI robocontroller is simply being used as a convenience at the moment allowing me to focus on software rather then hardware. I will be replacing it with a custom PCB in the near future.

PID Controller Development Setup

Below is chart with a step response from the controller running the motor at a velocity of “100 encoder counts per control loop”. I have not yet spent the time to properly tune the PID loop by adjusting all the gains. The result is a typical P only response with an overshoot, large settling time and eventually a small error band.

Step Response With Only A Proportional Gain

My next steps for this project include:

Create a small custom PCB for the controller.

Add serial communication/interface to set or get PID parameters and velocity set points needs to be created. This will allow a master microcontroller or computer (or anything else that talks serial) to offload motor control to this controller.

Write a Python application for tuning PID parameters and displaying step response. This ties into the serial communication control. The idea here is to provide a GUI interface that allows a user to easily and quickly set or update PID gains an instantly view the step response. This could also be extended to automatically iterate over a large set of gain combinations allowing the user to compare many step responses at once.

Build a simple differential drive rover for testing the complete controller. This rover will also serve as a platform for future projects and experimentations.

No comments:

Post a Comment