-1-
The Design of the Electric Car Running on the Teeterboard
Li Xiaocui, Zheng Weiguo, Guo Shu, Liu Haojing
School of Computer Science and Technology,China University of Mining and Technology,
Xuzhou, Jiangsu, China (221116)
Abstract
This system uses two DC motors to control the two rear wheels of the cars, with a steering gear
controling the front wheel; It uses reflective infrared light electric launch - receiver to identify the
guide lines of the electric car and use solid tilting angle sensor to measure the angle of the
LPC2142 as the dominate core, deal with the output signal of the tracing angle
module and measurement module. Using the PID algorithm, DC motor speed reducer and gear
corners can be dynamicly controlled by the use of PWM technology, so that a electric car will travel
in the seesaw smoothly, achieving the equilibrium point whether with weight or not, then can
display movement-related information systems through the phased LCD.
Keywords: the electric car running on the teeterboard; microprocessor module LPC2142 chip; the
DC speed-down motor; the PID algorithm; PWM technology
1 System scheme
The realization method
Black tape is affixed in to the surface of the seesaw as the car’s tracing guide line, as shown in
Figure 1, Tracing probe is fitted on at the appropriate place in the car’s car traces along the
black line m-n to ensure itself will not fall from the board on both sides .The black line s-t is a location
identification as a car stopped in the B-side,so the most appropriate location can be made sure through
the actual testing of the running car and man-made observation of the state , then the car stop at the
black line s-t for 5 seconds,and the black line is the parking instructions line where the car should stop
when back to p-q .When Vehicle travells on the seesaw, it deviates from the horizontal position of the
point of view θ through the inclination sensor board, and converts it into a voltage signal through the
A / D conversion to the single-chip,then the single-chip microcomputer gives electric driving voltage
( )u t according to a certain real-time control algorithms, reducing the deviation the actual measured
value and the ideal value ( )e t (horizontal position) , so the car can balance in the C point.
This method can also be used when the weight of wood increases to subject to achieve the
balance. When the car is at the sector, adjust the car’s turning until the vehicle is on the board, then the
car can drive onto the seesaw. Single-chip uses internal timer function of the realization of time, and
displays it through LCD ]1[ by stages.
At the very start, when the speed of the car is high and it is detected that θ begins to
change, the speed slows down rapidly for adjustment.
The installation of front tracing department probe should be as close to the front wheel axle as
possible to prevent the wood resist when uphill.
The car body should not be too high, or it will not be easy to control. Seesaw fulcrum should
be made as smoothly as the friction is too large, it is easy to make a sudden vehicle
movement, causing destruction of equilibrium, then single-chip microcomputer will have little time to
control.
中国科技论文在线
-2-
Figure 1 the design of the see-saw board
Scheme verification
(1) The selection of microprocessor
A 32-bit ARM7TDMI-S microcontroller ]2[ is chosen as the system controller. It has excellent
performance, but has very low power consumption. It has a high instruction throughput and excellent
real-time interrupt response. A wide range of internal resources can reduce the complexity of the
external circuit and can be convenient and flexible to use, but it has a very high the LPC2142
is chosen as a system controller, which is used to support the tracking of real-time simulation and
embedded 32-bit ARM7TDMI-S microcontroller, especially suitable for the application of our system.
(2) The selection of the wheel installation
The four-wheel vehicle programscan be used. The two rear driving wheel respectively
controlled by two motors,while the front wheel axis were driven. Four-wheel vehicle car should be easy
to control both when forward and backward. In order to facilitate the turning in the former a point
sector, a front wheel steering control can be used on the base of second program, and so the front of the
steering can be controlled.
(3) The selection of motor
Stepper motor speed ]3[ can be physical displacement of the precise control. However, it has noise
in the run-time and the price’s high, and the quality is large, so it could both increase the car's inertia
when installed in the small car and make it not easy to control in the ,the DC
speed-down motor has superior speed characteristics,such as smoothly speed control to a regulate wide
range of large rotation torque, small size, light weight, simple assembly and easy to use. As a result of
its internal original impetus provided by the high-speed motor to drive reduction gear group, it can
generate more chosen DC speed-down motor reduces relatively larger, which is very
suitable for vehicle control.
(4) The selection of motor driver and speed control program
The darlington tubes from the H-PWM circuit will be used. Control darlington tube to work in the
duty cycle adjustable switching state and adjust the the duty cycle PWM signal in order to adiust the
motor speed through the procedures regulated.
This circuit’s efficiency is very high as a result of saturation in the pipe cut-off mode; H-type
circuit can be simple to ensure the realization of the speed and direction control; The PWM speed
control technology with electronic switch fast and strong stability which is widely used.
The L298 ASIC chips are chosen as drive motors,and L298 is a dual H bridge high-current
high-voltage power integrated circuits, using directly of TTL logic level control. Control over their
input to work at the state of that the switch duty cycle is adjustable, and then adjust precisely of motor
speed. electronic switches is fast and has a strong stability. Although when the car starts, as a result of
the sudden imposition of a relatively high voltage, the wheels may spin, but after repeated tests, L298
can achieve better control.
System design
(1) microprocessor module: LPC2142 chip;
(2) motor modules: two DC motor speed control the rear wheels respectively, while the steering
中国科技论文在线
-3-
control the front wheel axis;
(3) motor drive module: Select L298 ASIC chips drive motor;
(4) tracing modules: reflective infrared emission - RPR220 receiver and its signal conditioning circuit;
(5) angle measurement modules: the use of solid tilting angle sensor;
(6) display module: choose cm12232-1,with dot-matrix liquid crystal display graphics with“chinese
words storage”set inside and built-ASCII character;
(7) Power Supply Module: Dual Power Supply.
The system block diagram
Figure 2 System block diagram
2 Theoretical analysis and calculation
The problem analysis and model preparation
In the case of no weight, electric cars starts from the A-side, getting near the C in 30 seconds,
and in 60 seconds, the electric vehicles make seesaw in equilibrium and keep balance for 5 seconds in
the vicinity of C.
In accordance with the relevant knowledge, we have established a single-stage model of inverted
pendulum systems.
Make the car and seesaw a system, the initial balance system started to campaign under the motor
wheels and balance again until reached C, and maintain the equilibrium for 5 seconds. This process is
equivalent to a single-stage inverted pendulum control since the process of stabilizing.
Single-stage inverted pendulum movement and its vector control theory model is typical of the
study ,which have a wide range of research methods, through multi-authentication, PID control law is a
single-stage inverted pendulum control which is better and much more mature .
The vehicle and seesaw can still be seen as a single-stage inverted pendulum motion systems
even when See-Saw are in the case of weight . when added to the second block to add weight on the
board, it is equivalent to an external perturbation to the system, and PID control law can effectively
rule out the disturbance through proportional, integral, differential control session, allowing the system
to return to stability.
Model
CPU
LPC2142
Decode
LCD
Remote
Photoele Signal condit
Angle Signal condit
Moto
r
driv
R
e
a
r
-
w
Stee Fr
I
中国科技论文在线
-4-
Figure 3 straight single-stage inverted pendulum system
Figure 4 car - simplified map seesaw system
Under the light of a single-stage inverted pendulum system, car - See-Saw simplified system is
shown in Figure 4. When the initial total system potential energy is 0, and the quality of electric
vehicles is M and seesaw mass is m, the establishment of coordinate system is in Figure 3.
Trolley displacement s, velocity s� and acceleration s��. Plate length l , angle θ at some moment
(the angle of the horizontal and wood),with the force on the small car F, the direction along the boards
provided by the motor.
Based on mature single-stage mathematical model of the inverted pendulum, and in accordance
with the specific circumstances of the system by simplifying ,the system of reduced order equations of
motion are:
2
Ms+Mg =F
1 1 0
3 2
ml Mgs mgl
θ
θ
⎧⎪⎨ + + =⎪⎩
��
��
Model and control method for solving
As mentioned above, the control system will be designed as a PD controller, so that the car in
the seesaw can keep balance on the board and doesn’t need to be test running to remember the scope in
mind, and has adaptive capacity of external disturbances and need a certain period of time to
re-balance.
The relationship between PD controller’s input ( )e t and output u (t):
0
( )( ) ( ) ( )
t
p i d
de tu t K e t K e d K
dt
τ τ= + +∫
. It is a typical deviation of control by negative feedback
control.
And so, to complete the task title, the deviation volume ( )e t is from the angle sensor output
value, which is Voltage capacity that has linear relationship between angle of the voltage capacity,
using the formula C language programming to get the controller's output, which is the voltage value of
the motor’s output to the rear car to control vehicle movement to achieve the equilibrium.
中国科技论文在线
-5-
3 Detection and driver circuit design
Tracing the design of modules
The tube Photoelectric RPR220 is chosen. RPR220 is an integrated reflective photo electric
detectors ]4[ , the transmitter is a gallium arsenide infrared light emitting diodes, while the receiver is a
high-sensitivity, silicon planar transistor photoelectric. The plastic lens can improve the sensitivity.
Built-in visible light filter to reduce the impact of dispersion of light. It is proved that by tracing
RPR220 composed of modules better results can be achieved.
The seesaw plate design is shown in Figure 1 .in order to ensure the car can travel safely
on-board to detect the point of parking near the location of B, we have adopted a five Photoelectric
RPR220 signal conditioning on the tube and its circuit tracing component modules will be installed in
the front part of the probe, as shown in Figure 5,the comparator voltage and electro-optical coupler, the
output signal of the probe is greatly improved and signal to noise ratio and inhibited a sharp pulse and a
variety of noise interference to some extent. When the probe detects black line, probe output high, and
the instructions of small lights are on . probe 1,2,3 detection with the probe and the central axis line of
wood m-n, the distance between 1,2 probe m-n is slightly larger than the width to prevent excessive
deviation from the car and fell off the central axis of wood; probe 4,5 are to detect the black line s-t, so
that the car stopped in the forward direction; probe 6,7 black line used to detect p-q, so that the
direction of the car to stop in the back.
Figure 5 sensors installed tracing
Figure 6 tracing Figure
Done in the layout of the location of the photoelectric sensor, how to determine reasonable and
appropriate patrol line search strategy is the key to success. 5 probes used to determine deviation from
the black line of cars,and how to adjust the wheel speed to control the manner are shown in the table
below.
Table 1 The control manne
1/2/3 Level probe 4/5 Level probe Discriminant Differential drive
0/0/1 0/0or0/1or1/0 Body parallel with
the mn
the same motor speed
0/1/1 0/0or0/1or1/0 Body slightly left The right motor speed
中国科技论文在线
-6-
0/1/0 0/0or0/1or1/0 Left body The right motor to stop
rotating
0/1/0Æ0/0/0 0/0or0/1or1/0 Severe left body Right motor reverse
1/0/1 0/0or0/1or1/0 Body a bit more right The left motor speed
1/0/0 0/0or0/1or1/0 Body-right Motor to stop turning left
1/0/0Æ0/0/0 0/0or0/1or1/0 Serious body-right Left motor reverse
*/*/* 1/1 Car to the black line
st
Two motors to stop
Angle measurement module
The angle measurement device used is dip angle sensor of a gravity structure fixed in a small
car, so that when the car is in the horizontal position, the direction of the arrow label sensor (sensor
inside bob) geocentric vertical point.
When θ of the car in the range of inclination 10± D , Sensor output voltage has the linear
relationship with θ . To prevent the sensor output voltage signal significantly attenuated in the output
impedance or input impedance of single-chip, after the sensor-level voltage follower connected to
LM324 and then received a single-chip ADC output.
The realization of the block diagram of motor control
Block diagram of motor control
As a result of that they are all with the power steering gear to VCC and GND pin, its driver can
only give control signal, which can be directly used for control of SCM port signal lines, thus the
hardware is very simple, as long as the adoption of the design of optocoupler output isolation will be
able to directly control the steering gear.
When the line of control to the steering input of the PWM signal, the cycle of square wave pulse
signal for 20 ms. When the square wave pulse width changes, the angle of steering axis changes, and
angle changes with the pulse width is proportional to the change.
Two speed control of DC motor, respectively, control the two rear wheel speed and steering. Since
DC current is larger, in order to prevent electrical interference on the single-chip, optoelectronic
isolation is selected based on an L298N chip to drive two DC motors.
Power Supply Program
In order to prevent power-driven interface circuit for single-chip interference, dual power supply
system and signal transmission photoelectric isolator are used.
4 Conclusion
The actual test
(1) Test Equipment: See-Saw, stopwatch, tape measure
(2) the basic requirements for part of the test results
CPU
Optical Steeri
Optical L298N
DC motor
DC motor
中国科技论文在线
-7-
Table2 The basic part of the test results
Views 1 2 3
A to C of the time
(seconds)
Maintain a balance of time
(seconds)
From C to B time (seconds
Stay in B (seconds)
B back to A of the time
(seconds)
(3) the innovative requirements for part of the test results
Table3 The innovative part of the test results
Views 1 2 3
Whether the board Y Y Y
Whether or not to find a
balance
Y Y Y
Balance of time (seconds)
Whether the balance
between two parts
Y Y Y
Completion Time (seconds)
The results of analysis
Table 4 The results of analysis
Completion Remark
Item (1) Achieve
Item (2) Achieve
Item (3) Achieve
Item (4) Achieve
The basic
requirem
ents
Item (5) Achieve
Item (6) Basically completed
Posted in the board before the black line to
guide
Item (7) Achieve
Item (8) Achieve
Item (9) Achieve
Play a
part
Item (10) Achieve
Error analysis
(1) test of the error can not be avoided.
(2) At the establishment of mathematical model, the quality of the car is looked as a uniform
distribution of objects.
(3) The fulcrum of the seesaw is not smooth enough.
References
[1] Cao Guoqing. Digital circuits and logic circuits. China University of Mining and Technology Press. 2005
[2] Hu Hancai. Single-chip Microcomputer Principle and Interface Technology. Tsinghua University Press . 2003
[3] Huang Zhengjin. Electronic Design Competition Ossetia Analysis. Southeast University Press. 2003
[4] Yu Youwen. Sensor Principle and Applications in Engineering. Xidian University Press. 2003
中国科技论文在线