03-08-2012, 10:00 AM
A PID Controller for Real-Time DC Motor Speed Control using the C505C Microcontroller
1A PID Controller.pdf (Size: 144.5 KB / Downloads: 183)
Abstract
This paper presents a real-time DC Motor speed
controller design using a microcontroller-based network
system. The design architecture was developed using two
Phytec evaluation boards each having an Infineon eightbit
C505C-L microcontroller. The system detects the realtime
speed of the motor using the sensor device and then
transfers data to the first Phytec board’s microcontroller
using serial communication. This data is processed and
transferred to the second Phytec board’s microcontroller
using a Controller Area Network (CAN) communication
scheme. The second microcontroller uses the received
data to calculate the real-time control value to monitor and
keep the motor speed constant based on a command
signal. Data is then transferred back to the first Phytec
board’s microcontroller using CAN and is utilized to
change the motor voltage such that its speed is constant.
Introduction
Rapid progress in microelectronics and
microcontrollers in recent years has made it possible to
apply modern control technology to automobiles that need
real-time control. Automotive technology uses several
electronic control units (ECU) to control efficient and
reliable operation of key components namely, the engine,
transmission, anti-lock braking system (ABS), cruise,
steering, vehicle traction, and entertainment [1]. DC
motors control, many of these operations and therefore
there is a need for implementing effective control
strategies for digital control of these motors.
Input driver circuit:
The input driver can be directly developed from the
microcontroller port. One important factor is the load
current requirement of the motor. It is quite obvious that
the requirements of any practical motor are higher than
any microcontroller can supply. Thus, the current
amplification procedure is essential even though the
digital value of the motor voltage can be derived from the
output port. Transistors or integrated circuit (IC) chips can
carry out the amplification procedure. One such
implementation is done in [11] using an L293D driver.
This device can supply up to 600 mA current per channel.
The output port of the microcontroller can be directly
connected to this device for driving the motor.
Simulation and test results
To test the system, the reference speed was set to
about 4.5V (about 50% D). The motor speed was then
displayed on a desktop computer using the HyperTerminal
software, and transferred to microcontroller M2. The
controller software embedded within M2 calculates the
necessary duty cycle required for maintaining the motor
speed at the required constant value. Figure 6 shows the
actual output voltage waveform and the input set point.
The codes were generated using the DAvE and mVision2
software programs. The software was written in ‘C’
language.
Conclusions
A real-time PID digital controller has been developed
that controls the speed of a DC motor in a closed loop
manner. A CAN differential bus is used for transferring
information between a local microcontroller that senses
the motor speed and a remote microcontroller that
contains the logic of the digital controller. The proposed
scheme works as a remote controller, which
communicates with a local DC motor or its model using
the CAN protocol. The main investigation focused on
developing a system that corrects changes in motor speed
due to extraneous disturbances in an extremely rapid
fashion. Therefore, microcontrollers that had full duplex
CAN communication capability were chosen.