Design and Development of Microcontroller

advertisement
RESEARCH INVENTY: International Journal of Engineering and Science
ISSN: 2278-4721, Vol. 1, Issue 5 (October 2012), PP 26-33
www.researchinventy.com
Design and Development of Microcontroller Based Electronic
Speed Governor for Genset/Automotive Engine
1
Sushant R. Burje, 2Prof.S.A.Kulkarni and 3N.B.Dhande
1
Sinhgad College of Engineering, Pune, India
2
Sinhgad College of Engineering, Pune, India
3
Automotive Research Association of India, Pune, India
Abstract: The engine speed controller of a conventional diesel engine is called a Governor. In order to control
engine speed, the governor controls the amount of fuel using fuel rack. The fuel rack is connected to throttle
actuator lever and driven from microcontroller. The actuator motion is controlled to achieve set-point rpm so
required pulse width modulation duty cycle to drive actuator is calculated from digital PID algorithm. PIC
16F877A microcontroller based hardware is developed for the implementation of the controller. The system
broadly involves interfacing hardware and the software for PID algorithm. A continuous PID controller is
governed by an equation which describes the dynamic time varying behavior of the input or the error signal.
This is digitized using numerical approximations and is programmed in the microcontroller. This system is a
closed loop control system with feedback signal generated by a digital magnetic pickup, which gives a pulse
output which is TTL compatible. The PID algorithm along with the hardware achieves the speed control of the
diesel engine. The hardware and software are validated in real time by considering different speed settings.
Keywords: Electronic Speed Governor, PID, Throttle Actuator, PIC16F877A, Pulse width modulation.
I. Introduction
The basic task of electronic speed governor system is to prevent the engine from exceeding the
maximum revving speed specified by the engine manufacturer. Since the diesel engine always operates with
excess air because the intake flow is not restricted, it would overrun if there were no means of limiting its
maximum speed. Depending upon the type of governor control system, its functions may also include holding
the engine speed at specific constant levels such as idling or other speeds within a specific band or the entire
range between idling and maximum speed.
A diesel engine is the most common solution for the distributed power generating systems due to its
superior fuel efficiency compared to the other types of internal combustion engines. In conventional diesel
engine systems, a fly-wheel type governor which is mechanically synchronized with the engine crankshaft has
been widely used to control engine speed. However, the electronic governor gradually extends its use in the
various applications because of its superior control performance, simple structure, and maintenance free
characteristics. In industries, electronic governor with Proportional, Integral, and Derivative (PID) speed
controller is generally used for such applications.
Electronic speed governor has good speed control performance and is relatively inexpensive. With a
diesel engine, there exists no single control-rack position which would permit the diesel engine to maintain its
speed accurately within the operating speed range without a governor. At idle, for example, without a governor
the engine speed would either drop until the engine stalls, or it would continue to increase until the engine races,
culminating in self-destruction. The basic job of every governor is to limit the engine’s maximum speed. To
achieve stable response of engine the PID (Proportional Integral Derivative) algorithm is implemented. Engine
rpm is taken as controlled parameter and throttle angle is taken as controlled variable. The throttle angle is
adjusted through throttle actuator via pulse width modulation signal. The pulse width modulation signal is
calculated in PID loop. Every time the engine’s rpm error is processed in PID loop and required pulse width
modulation control signal is calculated. The closed loop system is achieved through feedback from engine rpm.
The total set-up of electronic speed governor is shown in Figure 1.
26
Design and Development of Microcontroller Based Electronic Speed Governor for Genset/Automotive
Engine
Figure 1: Electronic Speed Governor Setup.
II. Objective
The project is an endeavor towards an effective design and development of microcontroller based
electronic speed governor for genset/automotive engine.
The following are the main objective
1. To design drivers for both throttle actuator and magnetic pickup sensor.
2. To design hardware for the system using PIC16F877A microcontroller.
3. To develop an experimental setup for mounting of throttle actuator and magnetic pickup sensor.
4. Implement the PID algorithm in embedded C code.
5. Application of the designed algorithm in an embedded controller to verify on actual engine operation.
III. System Description
The following Figure 2 shows block diagram of working of electronic speed governor system. The
magnetic pickup sensor is mounted on engine flywheel. The engine rpm is measured in capture compare module
of the PIC microcontroller. The throttle actuator’s lever is directly connected to the engine fuel pump. The
throttle actuator is controlled from the pulse width modulation signal so it is directly connected to the RC2 pin
of the PIC microcontroller. The engine rpm is continuously measured and compared with the required set point
and when the error signal is generated it is directly processed in the PID algorithm. The PIC microcontroller
generates the required pulse width modulation duty cycle from the PID algorithm based on which diesel engine
gets stabilized at required set point. The working pulse width modulation period is calculated from initial trails
on the throttle actuator.
Figure 2: Block diagram of Electronic Speed Governor System.
In this project CCP1 (PWM) is used to control the position of throttle actuator. PWM stands for the
Pulse Width Modulation where the width of a digital waveform is varied to control the power delivered to a
load. The underlying principle in the whole process is that the average power delivered is directly proportional
to the modulation duty cycle as shown in Figure 3. The pulse width modulation is required to switching the load
devices through MOSFET based power stage or from any other components. The pulse width modulation has
ON time and OFF time and addition of both is period. The average voltage applied to the load is varied from the
pulse width modulation which directly depends upon the duty cycle. The time is inversely proportional to the
frequency because of which the required period given to the load is in the form of frequency
27
Design and Development of Microcontroller Based Electronic Speed Governor for Genset/Automotive
Engine
Figure 3: Pulse width modulation with different duty cycle.
IV. Design of Controller
The improved electronic speed governor system includes digital controller, drive circuit,
electromagnetic throttle actuator and the engine speed sensor. The system to be controlled (plant) is the diesel
engine. The electronic speed governor is a closed loop system in which feedback is taken from engine rpm. The
controller output is in the form of pulse width modulation duty cycle. When the rpm error is generated the
required pulse width modulation duty cycle is calculated from PID algorithm. The capture compare module in
PIC16F877A is used to calculate engine rpm. The PID update time is kept in proportion with the throttle
actuator response time. The key step of the electronic governor design is to choose the suitable actuator coupled
suitably with fuel pump rack. The requirements to actuator of diesel engine governor system are fast response,
high accuracy and reliability. Under diesel engine operating principle, the engine speed regulation is achieved
by regulating the movement of the pump rack. With electronic speed controller, the movement of pump rack is
mainly affected by the diesel engine speed change.
t
P=KPep+KPKI
e
P
dt + KP KD dep/dt + Pi (0)
(1)
0
where, Pi (0) is the nominal output.
A. System to be controlled
The system to be controlled is a diesel engine, speed-torque characteristics of which are mentioned in
below Figure 4. The PID algorithm is implemented on diesel engine to achieve required set point rpm. The
controlled parameter is engine rpm and controlled variable is engine throttle angle.
Figure 4: Base diesel engine speed torque characteristics.
The diesel engine having idle rpm is 780 with 0.58 kg/hr fuel flow. The diesel engine produces power
up to 52 kW and generates 223 Nm torque at rated engine rpm. The diesel engine works on mechanical
governor and having distributor type fuel pump. The above Figure 4 shows the behavior of diesel engine at
various loads, the red line shows the engine Torque in Nm. The engine load is directly proportional to the fuel
flow. The blue line in Figure 4 shows the fuel flow in kg/hr, which directly increases as engine torque increases.
28
Design and Development of Microcontroller Based Electronic Speed Governor for Genset/Automotive
Engine
B. Controller: Throttle Actuator
The Figure 5 shows the throttle actuator. As the actuator has two way connections it can controlled by
lever from both sides, accordingly fuel pump lever can be adjusted with appropriate torque. The actuator is an
electromagnetic servo device which can be integrated into a closed loop control system. An engine control
system can be described as follows; an electrical signal is generated by a magnetic speed sensor which is
proportional to the engine speed. The signal is sent into the electronic speed control unit which compares it to
the preset engine speed setting. When the magnetic speed sensor signal and the preset engine speed setting are
not equal, a change in current from the speed control unit to the actuator will change the magnetic force in the
actuator. The throttle actuator is prewired for 12 volt or 24 volt. The harness included with the actuator can be
used to connect the actuator to the speed control. For 12 volt operation it is preferable to connect four cables,
one to each of the coil wires with maximum current is 8 Amps.
A. Pump rack
D. Electromagnetic actuator
B. Return spring
C. Rack displacement sensor
E. Engine speed sensor
Figure 5: Throttle Actuator [1].
Table 1 Throttle Actuator Specifications
Available maximum torque
Angular Travel
Operating Voltage
Normal operating Current
Maximum Current
2.7 Nm
25 cw/ccw
12 Volt
0.9 Ampere at 12 Volt
6 Ampere at 12 Volt
The Table 1 shows the throttle actuator specifications. The arrangement of the linkage for actuation of
engine fuel control is an important application consideration. For proportional actuators to operate with linear
control systems, it is important to obtain a linear relationship between actuator strokes and fuel delivery. The
linkage configuration for diesel fuel systems is typically as illustrated in Figure 5. According to the current
speed and the preset value the rotation of the actuator shaft will then adjust the fuel to the engine and cause the
engine speed to be equal to the preset engine speed setting. Shaft rotation is proportional to the amount of
actuator current and counterbalanced by the internal spring. Since the design has non sliding parts and is totally
sealed, outstanding reliability results, a single compression spring is used to improve reliability. No maintenance
is necessary.
C. Controller: PIC16F877A Microcontroller
The nominal output in Eqn. (1) is taken from the potentiometer at no load condition. The analog to
digital conversion module of PIC16F877A is used to measure voltage from potentiometer. The pulse width
modulation duty cycle is calculated as per the voltage from the potentiometer. The engine rpm is measured in
capture compare module of PIC16F877A microcontroller. The updated values of engine rpm and the pulse
width modulation duty cycle are displayed on LCD. The engine rpm is continuously compared with the set point
and when error signal generates it directly processed into the PID algorithm. The pulse width modulation duty
cycle is calculated from the PID algorithm and from which PIC16F877A microcontroller moves the throttle
actuator lever in such a position where engine gets stable at the required set point.
29
Design and Development of Microcontroller Based Electronic Speed Governor for Genset/Automotive
Engine
Figure 6: Schematic circuit of PIC16F877A in Proteus.
The PIC16F877A microcontroller is having both analog to digital conversion module and pulse width
modulation is of 10 bit. The clock frequency of 4 MHz is used. The Proteus software is used to do the virtual
simulation before going to real hardware. The Proteus implementation is shown in above Figure 6.
D. System Feedback
The closed loop control system requires feedback to take controlled action. The PID controller
calculates the required pulse width modulation duty cycle from engine rpm feedback. The magnetic pickup
sensor used in this project is of variable reluctance type with 750 ohm resistance. The pickup sensor is directly
mounted on the flywheel of the diesel engine for feedback purpose. The magnetic pickup sensor gives output in
a peak to peak voltage which is proportional to the number of teeth on flywheel and engine maximum rpm. The
output voltage must be controlled such that it has to be in accordance with the controller requirements; because
of which Magnetic Pickup sensor driver circuit is used. The magnetic speed sensor indicates when ring gear
teeth or other ferrous projections, pass the tip of the sensor. The electrical impulse are indicated within the coil
and sent to speed control unit. The signal from the magnetic speed sensor, teeth per second (Hz), is directly
proportional to engine speed. The magnetic speed sensor is mounted in the ring gear case or flywheel bell
housing of the engine. The threaded hole for the speed sensor should be perpendicular to the centerline of the
crankshaft and centered over the ring gear teeth. When the engine is stopped, screw the speed sensor in until it
touches the gear tooth, then back it out ¾ of the turn and secure it with the locknut. Any ferrous gear may be
used as long as the frequency and amplitude of the resulting signal meet the speed control unit specifications.
The wire lead should be twisted for the entire length from the magnetic speed sensor to the control unit. The
leads may need shielding when it is longer than 3 meters.
E. Software Description
The MPLAB software is from Microchip and it is an Integrated Development Environment (IDE). It is
basically used for programming the ICs. In this project the coding is done in Embedded C language for that C
compiler is required so HITECH C compiler is used. The PID algorithm first written in embedded C language
for that initially new project is created in MPLAB IDE. After that PID code is build and compiled in MPLAB
IDE from that the generated .cof file is used for debugging purpose and the .hex file is used to download it in
PIC16F877A IC. It was largely used for real time debugging of PID code. The PIC16F877A is programmed
through MPLAB IDE and PICKET3.
The PROTEUS is the virtual simulation software from ISIS. PROTEUS is generally used to test the
behavior of the selected hardware in simulation. In PROTEUS the PID code was initially tested with different
logics on virtual hardware. The magnetic pick up sensor driver circuit checked in PROTEUS by observing its
output waveform on oscilloscope. The various inputs given to the magnetic pickup sensor driver circuit from
function generator were observed on controller. The actuator driver circuit is also tested with different Volts and
Ampere ratings in PROTEUS.
The PCB123 is the PCB design software from Sunstone Circuits. The actuator and magnetic pickup
sensor driver circuit were designed in PCB123. First the schematics were drawn and from that the layout work is
created. The both designs were in program through hole format so the components chosen were in same format.
All the driver circuit’s components were found in same specifications in PCB123. The controller board also
designed in PCB123 with same program through hole format.
30
Design and Development of Microcontroller Based Electronic Speed Governor for Genset/Automotive
Engine
V. Experiment Test Rig
To perform experiments hardware has to be mounted on the engine. The throttle actuator was calibrated
with respect to distributor fuel pump. The diesel engine and the dynamometer are coupled through shaft.
A. Actuator Mounting
The throttle actuator is mounted on the distributor fuel pump with actuator lever directly connected to
fuel pump lever. The bracket arrangement is made to fix the throttle actuator on the engine block. As the
actuator is having more weight so the bracket is designed in such a way that it can sustain actuator’s weight. The
fuel pump lever and the actuator lever travel are calibrated. The actuator lever’s minimum position properly
matches with fuel pump lever’s minimum position and actuator lever’s maximum position properly matches
with fuel pump lever’s maximum position. The actuator must be rigidly mounted as close as possible to the fuel
control lever of the engine. The vibration from the engine will not affect the operation of the actuator. The
preferred mounting is with the electrical connector at the top and the actuator upside down, on its back, or side
way should be avoided. The linkage arrangement of throttle actuator is always important so high quality rod end
bearings are used.
B. Magnetic Pickup Sensor Mounting
The magnetic pickup is mounted on the flywheel of diesel engine. The threading arrangement is given
by the engine manufacturer. The initial task is to match the threads of the magnetic pickup sensors and the
engine block’s thread. The magnetic pickup sensor is mounted in the ring gear case or flywheel bell housing of
the engine. The threaded hole for the speed sensor should be perpendicular to the centerline of the crankshaft
and centered over the ring gear teeth. The spot space should be present to provide a flat surface on which to
anchor the locknut. The speed sensor screw in until it touches the gear tooth, then back it out ¾ of the turn and
secure it with the locknut. The ferrous gear may be used as long as the frequency and amplitude of the resulting
signal meet the speed control unit specifications. The wire lead should be twisted for the entire length from the
magnetic speed sensor to the control unit. The leads may need shielding in case length is more than 3 meter.
VI. Procedure of Experiment
The experiments were conducted to design and develop electronic speed governor for genset/automotive engine.
Experimental setup consists of diesel engine, dynamometer, microcontroller, magnetic pickup sensor and
throttle actuator. The experimental procedure is as follows.






The dynamometer is set to M mode torque alpha in which load is held constant with varying rpm.
The engine is held idle with no load.
The rpm of the engine is increased to the required set point by varying the potentiometer VR1.
When the engine rpm reaches the set point load is applied by dynamometer because of which rpm decreases
from set point.
The error generated by decrease in rpm is processed in PID because of which a new pulse width duration
duty cycle is assigned and engine rpm reaches back to the set point at loading conditions.
The above mentioned procedure is repeated with different set points.
A. Sample Results
Trails were conducted on electronic speed governor for different set points and loads.
Table 2 Trails conducted at set-point = 1200 rpm
Torque
Nm
0
0
15
25
30
Engine rpm
780
780
1192
1187
1182
PWM duty cycle
percent
0
55
61
68
76
31
Fuel flow
kg/hr
0.58
0.98
1.22
1.34
1.42
Modified
engine rpm
780
1200
1206
1198
1204
Design and Development of Microcontroller Based Electronic Speed Governor for Genset/Automotive
Engine
Table 3 Trails conducted at set-point = 1600 rpm
Torque
Nm
0
0
15
25
30
Engine rpm
780
780
1595
1589
1583
PWM duty cycle
percent
0
80
86
93
98
Fuel flow
kg/hr
0.58
1.20
1.35
1.48
1.62
Modified
engine rpm
780
1600
1598
1604
1598
The first trail was performed at three different loads with set point is 1200 rpm and the results are
shown in Table 2. The second trail was performed at three different loads with set point is 1600 rpm and its
results are shown in Table 3.
VII. Experimental Result Analysis
The electronic speed governor was tested on diesel engine at various loads. The diesel engine is
initially kept at no load condition and the performance of electronic speed governor is studied. The various loads
are applied on diesel engine by dynamometer and performance of electronic speed governor is studied. The
pulse width modulation duty cycle was calculated by electronic speed governor in PID algorithm with respect to
drop in engine rpm. Three trails were conducted for each set point. Table 4 shows average values of each trail at
set point 1500 rpm and Table 5 at set point 1000 rpm.
Table 4 Results at set point = 1500 rpm
Torque
Nm
0
0
15
25
30
Engine rpm
780
780
1487
1480
1478
PWM duty cycle
percent
0
76
84
89
94
Fuel flow
kg/hr
0.58
1.10
1.35
1.44
1.56
Modified
engine rpm
780
1500
1505
1498
1495
Table 5 Results at set point = 1000 rpm
Torque
Nm
0
0
15
25
30
Engine rpm
780
780
995
990
987
PWM duty cycle
percent
0
43
46
49
56
Fuel flow
kg/hr
0.58
0.85
1.13
1.22
1.35
Modified
engine rpm
780
1000
1001
1000
1006
From the above trials on diesel engine by using electronic speed governor, it is observed that:





As the load on the engine increases the duty cycle calculated from PID algorithm increases.
PID update time from coding matches with the actuator response time because of which engine gets
stabilize at set point without hunting.
The engine rpm calculation method is proven very accurate as the engine rpm measured by electronic speed
governor matches with the engine rpm calculated by dynamometer systems.
The rpm calculation and PID calculation are based on interrupt logic, so there are more chances of interrupt
latency but in coding these calculations solved in proper sequence which results in the stability of the
engine at set point.
The engine load, pulse width modulation duty cycle and the fuel flow from fuel pump are directly
proportional to each other.
32
Design and Development of Microcontroller Based Electronic Speed Governor for Genset/Automotive
Engine
VIII. CONCLUSION
The electronic speed governor gives satisfactory results for the tested set points at 1500 rpm and 1000
rpm. The diesel engine runs very stable at different loading conditions. Overshooting and undershooting of set
point was minimized because of PID algorithm. The diesel engine runs very stable at set point in both loading
and unloading conditions. On the microcontroller side both the actuator and sensor calibration is quite critical
and their control is very important in further development in this project.
 The electronic speed controller designed for Genset/Automotive engines is practically implemented on diesel
engine to stabilize the engine for required set point at various loading conditions.
 The driver was designed such that the output peak to peak voltage of magnetic pick up sensor was reduced
from 10 to 5 peak to peak voltages which are acceptable by controller.
 The driver was designed to meet the requirements of throttle actuator that is 12 Volt and 6.5 Ampere.
 The PID algorithm works very successfully and calculated pulse width modulation duty cycle as per the need
of diesel engine to run at set point with no load and partial load.
 The Engine was stabilized by proper functioning of calculated gains and update time for PID.
REFERENCES
Journal Papers:
[1] Jiang Fangyi, Gao Shilun, Zhang Jie and Huang Wei, “Development of Electronic Governor for Diesel
Engine Based on Embedded RTOS”, IEEE,2006, pp.218-221.
[2] Sung hoon Koo, Hyeong soon moon, “Development of electronic governor and simulator for the
generating diesel engine”, ICROS-SICE International Joint Conference Japan, IEEE 2009, pp.29002902.
[3] Seung-Hwan Lee, Jung-Sik Yim, “Design of Speed Control Loop of a Variable Speed Diesel engine
Generator by Electric Governor”, IEEE, 2008, pp.978-983.
[4] Dr. M. Meenakshi, Microprocessor Based Digital PID Controller for Speed Control of D.C.Motor, IEEE
First International Conference on Emerging Trends in Engineering and Technology, IEEE, 2008, pp.960965.
Book:
[5] Curtis D.Johnson, Process Control Instrumentation Technology, 8 th ed., PHI, 2006, pp. 439-480.
[6] Robert Bosch, Diesel Engine Management, 4th ed., Robert Bosch Gmbh, 2005, pp. 151-160.
[7] V Ganesan, Internal Combustion Engines, 2nd ed., Tata McGraw Hill, 2004, pp. 302-310.
[8] U.A. Bakshi, Elements of Electrical Engineering, 2nd ed., Technical Publications, 1998, pp. 162-195.
Proceedings Papers:
[9] David J. McGowan, D. John Morrow, Multiple Input Governor Control for a Diesel, Dual fuel
technologies generating set, IEEE transactions on energy conversion, vol. 23, NO. 3, IEEE, 2008, pp.851859.
[10] Qian Xiong, Jinliang Shi, Guorong Chen, Zeng Peng, “Research on Idle Speed Control for EFI Gasoline
engine with ETB”, 2009,pp. 222-226.
[11] Y.Gu & H.Y.Yu, “Digital Speed Governor System Based on TMS320F28335 Chip for a Gas Engine”,
2010 International Conference on Communications and Intelligence Information Security, IEEE 2010,
pp.40-43.
[12] Hans-Martin Streib and Hubert Bischof, “Electronic throttle control (ETC): a cost effective system for
improved emissions, fuel economy, and drivability”, SAE Technical Paper Series. Warren dale, PA,
960338, 1996, pp. 165-172.
33
Download