Motor Control

 

The task of a motor controller is to take the shaft of motor to the desired position by reading its actual position through feedback sensor. Since I could not find an adequate controller board or chip in our market, I had to develop my own. The above figure shows my digital controller constructed from discrete, widely available components. 

At first, I built an analog controller that could successfully direct a pan/tilt neck. Soon I understood that this cannot be used for the whole robot. The advantages of a digital controller against an analog one were its compactness, east filtering and having no dead-zone.

Since our controller is digital, motors can be easily actuated by rapidly switching them on and off. The speed of motor is proportional to the ratio of high to low duration. This technique is called Pulse Width Modulation (PWM) technique. 

We developed the controller based on a widely available microcontroller (89C51). Since a potentiometers generate an analog feedback signal, a simple Analog to Digital converter. Since our microcontroller did not support PWM, we built PWM generators ourselves using a programmable logic device called CPLD

 It's notable that in developed countries there are microcontrollers that support  both PWM and Analog to Digital Conversion and requires no extra chips. Since we used discrete modules, a common bus was required to their interconnection.

Our control algorithm was based on PI control. This means supplying a motor with a voltage equal to a weighted sum of position error and its integral. For integral computation, a history of past errors must be maintained. So we also used an external RAM chip in our design. The following figure depicts a sketchy schematic of our design.

 

 

Controller takes its commands from PC through its parallel port. Parallel port was used because of its simplicity for programming and no need for a complicated communication protocol. A software motor driver was written in both PC and microcontroller side in c language. Our designed controller could handle up to 12 motors simultaneously.

 


Back to Aryan's Page                        Back to the Main Page