Sae Final Sp01
Sae Final Sp01
Sae Final Sp01
Advisors:
Professor John Ayers, Ph.D.: [email protected]
Professor Jim Cowart, Ph.D.: [email protected]
Glossary
Ackerman’s Principal – While turning, the outer tire follows a larger radius than
the inner tire. To account for this the control arm must connect to the upright
along an imaginary line that connects the spindle and the center of the rear axis
Autocross – A competition for automobiles that tests driving skill and speed.
Bump Steer – Toe-in/out of a tire caused by its vertical displacement
Caster Angle – Caster is a line from ball joint to ball joint seen from the side view
Camber – The tilting of the tires about the horizontal axis perpendicular to the
direction of rotation
Center of Gravity – Location where force would be if the mass of the vehicle was
lumped
Chicanes – S–turn in a race track
Coil-on-plug system – Ignition firing scheme where an individual coil is used for
each cylinder
Droop – Negative displacement of the wheel
Five-link suspension – A suspension system with four points of attachment to the
frame
Four-link suspension – A suspension system with five points of attachment to the
frame
Front Roll Center – Point that the front of the vehicle desires to roll about,
determined by front suspension geometry
Jacking – When the tires skip as the vehicle turns
Jounce – Positive displacement of the wheel
Kingpin inclination – An imaginary line drawn from the center of the top ball joint
to the center of the lower ball joint, looking at the suspension from the front of the
car
LED – light emitting diode
McPherson struts – Suspension type where the shock is one of the suspension
arms
Proto-board – An experimental device for prototyping electronic circuits
Nomenclature
σ - stress (lbs/in2)
P - force (lbs)
A - area (in2)
M - moment (lb•in)
I - moment of inertia (in4)
c - distance from force (in)
Pcr - critical force (lbs)
Abstract
TABLE OF CONTENTS
Glossary...........................................................................................................................................................................2
Nomenclature..................................................................................................................................................................4
Abstract............................................................................................................................................................................5
Introduction......................................................................................................................................................................8
Background............................................................................................................................10
Market Research....................................................................................................................13
Discussion.....................................................................................................................................................................14
Suspension Design................................................................................................................14
Static weight.......................................................................................................................24
Lateral load transfer due to lateral acceleration..................................................................25
Longitudinal weight transfer due to negative acceleration...................................................26
Maximum loads achieved...................................................................................................27
Maximum Tractive Forces...................................................................................................27
Factor of Safety Development............................................................................................28
Design Overview.................................................................................................................29
Safety Considerations.........................................................................................................39
Manufacturing considerations.............................................................................................39
Modifications.......................................................................................................................40
Engine Intake Design.............................................................................................................41
Motivation...........................................................................................................................41
Engine Considerations........................................................................................................41
Powerplant Selection..........................................................................................................42
Additional Engine Decisions...............................................................................................44
EFI Requirements...............................................................................................................45
Pulse Width Determination.................................................................................................48
Valve Train Timing..............................................................................................................52
Engine Intake Manifold Design...........................................................................................52
Testing................................................................................................................................59
Engine Control Design...........................................................................................................61
Fuel Injection......................................................................................................................61
Engine Control System.......................................................................................................62
Engine Control Overview....................................................................................................65
Crankshaft Sensor (Variable Reluctance Sensor)...............................................................65
Variable Reluctance Sensor (VRS) Interface Circuit...........................................................66
MAP Sensor........................................................................................................................67
Manifold Absolute Pressure (MAP) Sensor Circuit..............................................................68
Rich/Lean Adjustment Circuit..............................................................................................69
Ambient Air and Throttle Position sensors..........................................................................70
Driver Circuits.....................................................................................................................70
Fuel Injector Driver Circuit..................................................................................................71
Ignition System...................................................................................................................71
Ignition Coil Driver Circuit...................................................................................................72
Cylinder Compression Detector..........................................................................................74
Microcontroller....................................................................................................................76
Implementation.......................................................................................................................80
Patent Opportunities...............................................................................................................82
Budget...........................................................................................................................................................................83
Suspension............................................................................................................................83
Engine Intake.........................................................................................................................84
Engine Control........................................................................................................................85
Timeline.........................................................................................................................................................................87
Conclusion.....................................................................................................................................................................88
References....................................................................................................................................................................90
Acknowledgements.......................................................................................................................................................91
Appendix........................................................................................................................................................................92
Appendix A – Figure List........................................................................................................92
Appendix B – Timeline...........................................................................................................93
Appendix C – Tire Data..........................................................................................................94
Appendix D – Valve Timing....................................................................................................95
Appendix E – String Model.....................................................................................................96
Appendix F – Microcontroller..................................................................................................97
Port Schema.......................................................................................................................97
Microcontroller Code...........................................................................................................98
Appendix G – PCBoards Circuit Layout................................................................................108
............................................................................................................................................108
Appendix H – RC Compression Damping.............................................................................109
Appendix I – RC Rebound Damping.....................................................................................110
Appendix J – Simulations of Cylinder Compression Detector...............................................111
Appendix K – Thank you to all of our Sponsors....................................................................112
Introduction
This coordinate system is used throughout the car’s design. However, this
coordinate system is local to front and rear suspension systems with the front
suspension and steering combined.
One way to build a successful first year car is to study the winning
competitors. Ideas were first generated during a visit to the May 2000
competition in Pontiac Michigan. Research continued through Internet sources
and enabled us to obtain a good idea of what features current winning designs
include. Winning designs such as Texas A&M produced brainstorming sessions
to develop an improved suspension design for the 2001 FSAE car. Creativity
and “thinking out of the box” are great tools when constructing preliminary
designs. Input from sources such as faculty, car clubs, classmates and friends
also supplied us with many ideas and solutions.
Since time was limited the team had to focus on basic implementations
rather than design ideals. Thus, the team met time deadlines and the projected
budget. It was our responsibility as Formula SAE car club members to fund
much of the project independently of our senior design projects. This underlying
factor was considered throughout the design process and limited us to reusing
components from previous years in some situations. The final design was a
combination of design constraints, creativity and communication.
The Engine Control System designed by the EE/CMPE and ME teams is
an electronic fuel injection and ignition system. The electronic fuel injection
system delivers fuel to the engine’s intake manifold, and the ignition system
delivers spark to each cylinder at the appropriate time. Both of these systems
must be controlled so that they will vary as needed with different temperature,
engine speed and load conditions. This process is accomplished using various
sensors, feedback to a microprocessor, and computer code in the
microprocessor.
Gasoline engines that are currently in use incorporate a variety of different
fuel injection systems. Virtually all automobiles use electronic fuel injection
systems to deliver fuel to the cylinders. Three common types of electronic fuel
injection (EFI) systems used today are throttle body injection (TBI), multi-port fuel
injection (MFI) and sequential fuel injection (SFI) systems. Throttle body
injection systems deliver all of the fuel for the engine at the same point at the
intake manifold inlet through one large fuel injector. This is somewhat like a
hybrid between fuel injection and a carburetor.
The most common types of fuel injection systems today are multi-port fuel
injection and sequential fuel injection. These are both systems where the fuel is
delivered to each individual cylinder by using separate fuel injectors for all the
cylinders. These injectors are located in the intake manifold runners in close
proximity to each individual cylinder. In multi-port fuel injection, the injectors are
actuated in groups (also known as bank firing). In sequential fuel injection, the
injectors are actuated individually just before each cylinder’s combustion stroke.
For sequential fuel injection, the engine stroke position must be known. This is
usually accomplished through the use of a camshaft position sensor. If bank
firing is used, there is no need for a camshaft position sensor to give an
indication of the engine’s stroke position. Sequential Fuel injection offers the
lowest exhaust emissions and the most efficient use of fuel, so it is usually
preferred over multi-port fuel injection by automobile manufacturers.
Background
challenge is to design and fabricate a prototype car that best meets these goals
and intents.
Each design will be compared and judged with other competing designs to
determine the best overall car. The cars will be judged both statically and
dynamically. Each car must be inspected before being permitted to enter any
aspect of the competition to ensure safety. The static events include
Presentation, Engineering design, and cost and manufacturing analysis.
Dynamic events are judged in areas of acceleration, skid-pad, autocross, fuel
economy, and endurance events. The combined total of both static and dynamic
events is 1000 points.
The desired dynamics of the vehicle can be summed up by two objectives.
The first objective is to maintain maximum lateral, positive, and negative
accelerations in a specified range of operating conditions. The second is to
produce a reliable engine management system that out performs other methods
of aspiration, spark, and fuel delivery. While the two objectives correspond to the
competition, each is designated as separate senior design projects.
Market Research
According to cost, the best low-end solution is the Accel 74022A closed
loop injection controller for 4, 6, 8, and 12 cylinder engines that are 600cc or
higher. This system allows for re-programmability of fuel injection and costs
$880, but does not include ignition control. A more advanced commercially
available solution is the Haltech E6K. This device is programmable and provides
multiple feedbacks and more engine control, but at a much higher price. There
are additional solutions at different costs between these two extremes.
Discussion
Suspension Design
displacement verses both camber and roll center. We decided that these two
characteristics were the most important factors since they are essential in the
handling of the car. After reviewing our results, we were able to narrow our
system down to three possibilities. In the following table (Figure 3), all seven
SLA geometries are illustrated. The geometric setup shown third is the
suspension system that we are using.
Suspension Set-Up Wheel Camber Roll Center
Displacement
Negative
None
Positive
Always Negative
Always Positive
Always Positive
Positive Majority of
the Displacements
Always Negative
Negative Majority
of the
Displacements
Figure 3 – Suspension Setup Types
One of the most difficult parts of designing a suspension system is
compromising. There is no optimum suspension for all conditions; therefore, for
every improvement there is a sacrifice. The key is to decide what is most
important for your particular application. In our case, we had to account for a
race on a smooth track that contains many tight turns but can be subject to a
variety of weather conditions.
To fulfill our goal of maintaining the largest accelerations possible, we
examined the many components of a suspension design (the definitions of these
terms are conveniently defined during the discussion). The first heavily debated
design component examined was the roll axis, a line that connects the front and
rear roll centers, around which the car body rotates when lateral forces are
applied. The roll center is defined as the effective center that the body will
appear to rotate about. For roll centers with small radii, one could image a box
suspended by two short strings at two corners suspended as something of a
pendulum. The longer the string, the larger the pendulum, and the more minute
the angular displacements the box will achieve. As shown below, the body roll
Theta 1 is greater than Theta 2 with a longer roll center located below ground
level.
Car Body
L,rc1
Ground
L,rc2
Theta 2
Theta 1
Theta 1 > Theta 2
a string calculator (see Appendix C). However, the software does not analyze
the dynamic response associated with a mass-spring-damper system, and is
used purely as an efficient tool to generate geometrical changes with wheel
displacement in all the specific geometrical areas considered in the design.
In order to understand the importance of the roll axis of a vehicle, the
dynamics had to be first examined. Essentially, the roll of the vehicle is a result
of the moment formed by the distance of the CG (center of gravity) from the roll
axis. The three factors that affect the roll axis of the vehicle are the front and
rear roll centers, and the CG. When a car goes into a turn, a lateral force is
exerted at its center of gravity. If the roll center is below the CG, a moment is
formed and the car appears to lean during the turn.
One of the difficulties involved with roll center selection is that it changes
with wheel displacement. One approach is to choose the region in which you
want to keep the roll center within for all displacements. The three basic regions
for the roll center location are the same height as the CG, below the ground, and
between the ground and the CG. It is usually not desirable to have your roll
center change between regions since this makes handling less predictable.
Another method is to design a suspension in which the roll center stays constant,
such as using parallel links, but this involves sacrificing other aspects of
handling.
At first analysis, it appeared the best arrangement would be to have the
CG and both roll centers on the same plane. This would create no moment and
would result in no body roll during cornering, but there were a few problems
involved. The first was that “jacking” could develop on high velocity turns.
“Jacking” happens when the tires skip around the turn, which is not desirable
since contact with the ground is not maintained and the ability to fulfill the
maximum lateral acceleration fails. The second problem involves the tune-ability
of the system. A problem with no roll is that the shocks are not being
compressed very much, and thus, the absorption of corning forces through the
suspension has been limited. A car with some degree of body roll can be
adjusted via spring rates of the shocks and anti-roll bar, but a car with no roll
3
2
1
(in)
0
-1 0 2 4 6 8
-2
-3
Roll Center Height(in)
Our main controlling factor of the roll axis was the front suspension
geometry. The front is critical since that is where the steering is taking place.
The only sufficient geometries are those that incorporate both positive steering
and handling aspects. We can only change the rear suspension to a limited
extent since the rear wheels must be powered by an existing drive train. One
major suspension limitation was that we decided to reuse the old spindles. This
choice was made for two basic reasons. One, we found the setup suitable and
two, to simply keep cost down.
Wheel Displacement
3
2
1
(in)
0
-4 -2 -1 0 2 4
-2
-3
Camber (degrees)
3
2
1
(in)
0
-0.4 -0.3 -0.2 -0.1 -1 0 0.1 0.2
-2
-3
Toe-In/Out (degrees)
Another aspect that must be considered is the caster angle. Viewing from
the side, caster angle is the angle between the steering axis and the vertical
plane. The combination of the caster angle and kingpin inclination greatly affects
the handling of the car. Both are very important since they influence the steering
forces during lateral acceleration and the self-centering effect of the steering. As
with Toe, it is desirable to minimize both the caster angle and the kingpin angle
for all wheel displacements. The combination of the two has a large effect on the
rate of camber change during wheel displacement.
The final design uses pneumatic trail to provide steering center effect at
higher speeds. Pneumatic trail differs from the mechanical trail defined by the
KPI and caster angle by specific tire characteristics. Pneumatic trail is a result of
the tire patch area shape. The patch area roughly forms a triangle, thus
providing a wedge effect with the ground and provides a horizontal centering
force. Both types of trails act as weather vanes to the steering wheel but have
varying effects at over a given range of speed. Mechanical trail is dominant at
low speeds while pneumatic trail at high speeds. Skid warning is also maintained
by minimizing mechanical trail, and since the effect of pneumatic trail is non-
linear with vehicle speed, the driver will be able to sense when there is a
significant decrease in pneumatic trail. This provides an important source of
driver feedback at higher speeds, and the vehicle will exhibit under steer and feel
“loose”.
Wheel Displacement
3
2
1
(in)
0
-0.04 -0.02 -1 0 0.02 0.04 0.06
-2
-3
Caster Angle (degrees)
Wheel Displacement
3
2
1
(in)
0
-4 -2 -1 0 2 4
-2
-3
Kingpin Angle (degrees)
These parameters are coupled so that changing one aspect will change
any combination of geometries, the key to designing the suspension, as
mentioned before, is to compromise. The following data has been chosen as the
suspension parameters:
• Wheel base=65”
• Front: 4-Link, SLA, non-parallel double A-arms
• Track=50”
• Roll center height=1.8-6.5”
• Camber=-2.7->2.5°
• ,
• Toe-in=-.36->.08°
• No caster
• KPI=3°
Static weight
The load transfer calculations use the following parameters (see Figure
13) to model the forces generated. The static forces are calculated using a driver
weight of 175 lbs, vehicle weight of 520 lbs estimated from previous vehicles,
front-to-rear weight distribution 50/50, and left-to-right weight distribution 50/50.
The static roll centers are geometrically determined using a string computer then
checked using SuspensionGen software. The height of the CG is estimated from
the average of the moment of inertias of major components.
The lateral forces generated act through the center of gravity and are
summed as a torque, or moment, to determine the vertical force on a tire. The
moments are summed about the roll center axis when roll centers are determined
at a static height. The two moments are summed to find Ftire and then split front
to rear by multiplying by the bias ratio. The lateral acceleration has been set to a
high value of 1.5 times the force of gravity, 1.5 g’s. This number is used as a
safety factor since the car will not encounter more than 1.2 g’s of force.
Front Rear
L1 = Lcg – Lrc,f = 6 L3 = Lcg – Lrc,r = 4 L5 = 11
L2 = front track/2 = 25 L4 = rear track/2 = 25.8 L6 = WB*front bias =
32.5
F1 = a1*(Fz,sfl + Fz,sfr) = F2 = a1*(Fz,srl + Fz,srr) =
L7 = WB*rear bias =
521.25 521.25 32.5
Ft = (F1*L1 + F2*L3)/(L2 + L4) = 102.6082677
Figure 15 – Vertical Tire Force Calculation
components of the forces developed are high, since these forces will be used
when determining component materials and dimensions as an added margin of
safety.
The following forces are developed in the push-rod member during full
spring compression and max damping setting on the Fox Racing shock:
F=n*(k*x + c*velocity) where k is the spring constant, x is displacement, c is the
damping coefficient, and n is the rocker ratio. The damping force is obtained
through the manufacturer’s supply of damper dyno charts found in appendixes H
& I and the spring rate is 350 lb/in with maximum x displacement of two inches.
To use a worst case scenario we will assume the vehicle bottoms out, that is max
displacement of two inches is achieved, the damping is set at max 12 clicks
closed, and the rocker ratio is three.
F = 3(350 * 2 + 900 ) = 4800 lbs
Design Overview
In order to compute the thickness necessary for each arm, the maximum
forces had to be computed. After the forces were found, we used the largest one
to calculate the diameter needed. A factor of safety of three was used. The
relationship between the force in the arm and its area is as follows:
P Mc
σ= = (2)
A I
The area can then be used to compute the needed diameter. The forces were
found using standard static analysis equations. The four defining equations are
as follows:
∑F x =0 (3)
∑F y =0 (4)
∑F z =0 (5)
∑M o =0 (6)
They state that the sum of the forces in x, y, and z directions must be
zero. The last equation states that the sum of the moments about any point in
the system must be equal to zero. The figure below shows the forces involved
and their relationship to each other.
forces, the diameter needed for the A-arms was then calculated. The A-arms
were treated as a pin-pin beam, since they are connected with ball joints on each
end. Ball joints do not act against moments, similar to the behavior of a pin.
The Bernoulli-Euler buckling criterion is defined as equation 1, where I is
the moment of inertia. For a round member:
1
I = π r4
2 (7)
Using equation 2, we determined the thickness needed for each type of material
that we had considered. Also shown is the weight of an arm of the needed
diameter. The results are shown in the figure below (see Figure 23) for the 14-
inch arm. The results are based on a maximum force of 900 lbs and a factor of
safety of 3. Therefore, the force calculated for a pin-pin beam is less than 2700
lbs of force.
One of the critical factors we used to determine the best material was the
strength to weight ratio of each material. We computed this by dividing the
amount of force in the member by the weight required to hold that load. This
determined that AZ91 alloy magnesium is the best of the three materials. In the
end, other factors weighed into the decision of what material to use and AZ91
was not selected for the steering arms or the push rods. Further detail on this
topic is discussed in the steering arm and push rod sections. AZ91 was selected
for the front and rear uprights as well as the A-Arms.
Front Uprights
Upper A-arm
Steering Arm
Front Upright
Push Rod
Lower A-Arm
The front uprights are based on the design of the previous car. They are
made of AZ91 magnesium to cut down on the weight of the vehicle. We modified
the design heavily to incorporate a more adjustable steering arm. The uprights
are the centerpieces of the suspension system; they transfer the forces from the
tire to the A-arms. Their geometry is very important to the handling
characteristics of the car.
Magnesium was used for the uprights since they are a part that is cast to
the specific form that is needed. Casting was an excellent option since the
uprights are not a simple shape that can be easily machined. They also can be
cast very close to the exact shape needed. This leads to minimal machining
which saves both cost and time.
Rear Uprights
Upper A-Arm
Rear Upright
Push Rod
Drive Shaft
Lower A-Arm
Suspension
Link
We are reusing the previous cars rear upright design for our car. We
chose to do this was since we are reusing the rear differential of the old car. The
differential used severely limits the options for rear suspension design. The
upright must only travel within the range that the drive shafts can handle. The
suspension characteristics of the rear end were modified, but this was done in
other ways. Although the uprights are the same the mounting points on the body
are different which leads to a different geometrical configuration. We did this to
Rockers
Shock
Rocker
Support
Brace Push Rod
Figure 26 – Rockers
The rocker design is a prototype rather than a final model. The final
model will be based on the dynamic vehicle testing to optimize the wheel to
shock travel ratio that can be changed from 1.3:3 to 3:1.8 in .5 increments. The
design permits the use of a single two-inch travel spring and damper unit to
perform in a spring rate range of 150 lb/in to 583 lb/in while retaining the required
two inches of wheel travel.
This variable system is a design common to some teams and combines
manufacturing time savings with material cost savings by using only one rocker
to do the same work as six individually cast rockers.
Push rods
Push Rod
The pushrods are the member that transmits the vertical force of the tire to
the spring/damper unit. As a result this member is subject to buckling loads in a
pin-pin configuration. The calculations and results of the pin-pin calculations
were shown previously.
If weight was the only factor we considered then we would have used
AZ91 for the push rods. We ended up using aluminum push rods for a number of
reasons. A major reason is the availability of materials. Aluminum is readily
available, but magnesium would have to be cast to a specific length. The
availability factor also leads us to aluminum since we want components that can
easily be repaired or replaced at the race. Repairs are very difficult with
magnesium since it is not a weldable metal. Aluminum allowed us more
versatility since we could make new arms quickly. We wanted to be able to
change the rod lengths if needed to adjust the system. Aluminum is much less
expensive than magnesium.
The push rod design is based on keeping the system highly adjustable.
The push rod is a rod with a left-handed thread on one side and a right-handed
thread on the other. With this setup twisting one way enlarges the length of the
rod and twisting the other decreases the length. A nut is tightened on each end
to prevent it from adjusting while racing due to vibrations. The steering arms are
designed with this same setup.
Steering Arms
Ideal
Ackermans
Steering
Steering
Arm
Like the pushrods, the steering arms are loaded to buckle in the pin-pin
configuration as well. The force developed in this configuration is tabulated in
the A-Arm force calculations section. The diameter on the rod is calculated using
modulus of aluminum and required length of 12”.
Process controls are the events that can be attributed to some malfunction
or undesirable handling effect. For example, if the nose of the vehicle dives
during braking, the cause of this problem could be attributed, but not limited to,
low front damping, too soft spring rate, or high center of gravity. The process
sheet is divided into front and rear suspension, steering components, and
possible solutions to the problems listed. The method behind the sheet is to limit
total time wasted during competition trying to tune the car to the current track
conditions, or analyzing a problem.
Stiff Movement
• Probable Cause: High spring rate
• Possible Solution: Reduce spring pre-load, adjust rocker ratio, and replace
spring with different spring rates
High Friction
• Possible Solution: Re-grease rocker and damper bushings, inspect links
for stiff rod-ends, verify misalignment angle to be less than 11°, re-torque
rocker bolts to 20 ft-lbs and verify rocker clearance for .050” clearance
Nose Dive
• Probable Cause: Light front spring rate
• Possible Solution: Adjust pre-load, replace springs with higher rate, adjust
rocker ratio
Rear Steer
• Probable Cause: Differential torque bias
• Possible Solution: The Torsen differential bias can be adjusted with
different shims, otherwise a common behavior with torque-sensing
differentials
• Probable Cause: Improper rear alignment
• Possible Solution: Calibrate using caster/camber and toe-in/out device
Over/Under steer
• Probable Cause: Ackerman angle
• Possible Solution: Increase the Ackerman steering angle if the vehicle
under-steers, decrease for over-steer
Safety Considerations
Manufacturing considerations
Modifications
We had only a few major modifications of the design of our system. The
modifications were for various reasons, which include safety, aesthetics,
interference issues, and ease of manufacture. The design of the front uprights
was modified in order to increase the turning ability of the car. Material was
removed from the top of the upright where the oversteer stops and steering
mounts were going to be. The stops were placed directly on the rack. The
steering mounts are located on the side of the upright so they don’t interfere with
the turning of the tire.
The height of the steering rack was modified to allow for more room for the
driver. At the original location, the driver would have difficulty getting his feet into
the vehicle. We added two inches changing the clearance from 7 to 9 inches.
Luckily this change only modified the suspension dynamics minimally. In fact,
none of the changes are large enough to be noticeable to the performance of the
car.
Motivation
The reason that a fuel injection system was needed for our vehicle was
that the carburetors for motorcycles are not designed to take lateral forces. If the
motorcycle carburetor was used in our car, as hard turns were performed the
lateral forces in the turn would cause the fuel to spill from the carburetors and the
engine would be starved. This system is sufficient in motorcycle applications
since when a motorcycle turns, it leans such that lateral forces are transmitted in
the vertical plane of the bike. Therefore the lateral acceleration experienced in a
four-wheeled car is a vertical acceleration on a motorcycle with respect to the
position of the engine. The SAE rules also require that all fluids, such as fuel,
need to be contained, therefore the spilling of fuel is illegal.
In the early stages of brainstorming ideas came up to solve this. Engine
positioning was considered as a solution to the problem. However this still poses
the same problem when the car experiences hard accelerations and braking.
Another possible solution was to use an automotive carburetor, but it would be
difficult to find a carburetor that would be suitably sized for our engine. The use
of a fuel injection system was the best option for our situation.
Engine Considerations
The engines that are used in a Formula SAE race car are 4-stroke piston
engines with no more than 610cc of displacement. Most teams use mid-size
motorcycle engines because of their compatibility with the SAE rules. However
other engines can be used, as long as they meet the SAE requirements. Teams
may choose to supercharge or turbo-charge their engines. The only other major
restriction is the fuel type; SAE allows the use of 94 and 100 octane Sunoco
gasoline or M85 (methanol) fuel. These are the major constraints that are
considered when designing the drive train.
Powerplant Selection
manufactures. The engines from Yamaha and Kawasaki have shown evidence
of failure under hard loading in a short period of time. These engines also have a
high cost for repairs and parts. The Suzuki manufacture has had great success
in recent months with their new 600GSXR engine in races. However due to its
recent development the cost associated with this was still high, and would not
allow for two engines under the budget. The engines produced by Honda have
had very good success and are well respected by racers.
These 600cc engines have been in development for almost 15 years now,
with four different generations of these engines. The last generation of engines
is known as the F4, which are only two years old. This engine produces the most
horsepower out of all of the Honda motors and is known for is reliability.
However it too is still costly due to is recent development and availability. For us
to afford two engines for the project we looked at the Honda F3. This motor is
also known for its power and reliability. The F3 and F4 engines are similar but
have different dimensions, the power is also decreased with the F3, but the
torque is higher than that in the F4. The F4 engine is rated at 92-95 Hp and the
F3 is rated at 88-90 Hp, these power ratings are from the manufacturer. The
increase of torque over the F4 is due to the shorter piston stroke and this
increase was an important consideration due to the fact that it would help the
cars performance. Another note was that some of the components for the F3
and F2 engine were the same. This was a consideration due to the abundance
of F2 engine components from previous teams.
The decision to use the Honda CBR 600 F3 engine was the most practical
option to meet the driving conditions and budget constraints for the team. The
F3 engine is rated at 90 Hp, which is a significant increase over previous year
models and only a 5-7 Hp decrease in power from the F4 model. The high torque
rating from the F3 also would work better for the car performance due to the
layout of the competition. The power output is also comparable to other
manufactures engines. The extra parts from previous teams also were a deciding
factor in the choice of engines.
Under the rules from SAE, we have options as far as induction and fuel.
For the induction, we can use natural aspiration or forced aspiration systems. A
naturally aspirated induction system for the engine would be a tube or scoop to
pull air to the carburetor or fuel injection system. A forced aspiration set-up
would utilize a supercharger or turbo-charger to intake air to the carburetor or
fuel injection system. The benefit, if properly tuned to that particular engine, is
between a 30% and 40% power increase due to the extra air fed to the engine.
In looking at the previous teams both at UConn and elsewhere, there has
been difficulty in finding a turbo-charger small enough to match the engine’s
displacement. When forced induction is used the compression ratio needs to be
lowered to handle the extra air mass being delivered. This would require internal
engine modifications to lower the compression, such as different pistons.
Another difficulty has been the tuning of the turbo to produce maximum power. It
has been noted by other teams that their vehicles have also not been able to
achieve decent fuel economy when forced induction is used. In looking at the
power output numbers from the dynamometer in last year’s competition, more
horsepower was created with natural aspiration induction. Therefore, we have
decided that we would use a naturally aspirated system and avoid the problems
of forced induction.
The other decision was as to what fuel type and octane to use. The SAE
offers three choices on fuel; they are Sunoco 94 and 100-octane gasoline and
M85 (methanol). Looking at the pros and cons of gasoline and methanol we
were able to select our fuel type. Methanol is rated at about 118-octane, and has
a higher energy associated with it than gasoline. However methanol is corrosive,
and can do serious damage to internal engine components, which leads to power
losses if the components are not replaced. With this side effect considered it
was clear that methanol would be risky to use. This was also based on an
already tight budget. Now the choice was which octane level to use. The engine
we will be using has a compression ratio of 11:1. This number is relatively high
EFI Requirements
The EFI system uses particular constraints to properly control the engine.
Therefore, before the computer code can be written the engine’s fuel needs, the
air/fuel ratio, and injecting timing must be known. Other system configurations
need to be addressed also to properly design the computer to the engine and
competition requirements.
The fuel required by the engine can be determined based on the engine's
displacement. An engine is essentially a pump and the displaced mass the
pump creates is what the engine needs to intake. Therefore, the first variable
that needs to be determined is the mass of the air that the engine displaces.
This can be done using the Ideal Gas Law.
pV = mRT ηv
This law will be used to model one cylinder to determine its requirements; this is
due to each cylinder having its own injector.
Before the mass of air can be calculated, there are some variables that
need to be determined. These variables are the pressure in the cylinder on the
intake stroke, the volume of the cylinder, and the temperature of air within the
cylinder. When an engine is at idle, the pressure in the manifold is at about 1/3
atm. When the engine is at WOT, the pressure increases to 1 atm. So when the
engine is running at these conditions, the pressure in the cylinder is at the
respective pressure based on the throttle positions. For the cylinder pressure in
this calculation, we are assuming that the throttle is wide open, and the resulting
pressure is 1 atm. The reason for assuming WOT is that maximum power will be
produced around this position of the throttle. The cylinder volume is determined
by summing the piston displacement volume and the cylinder clearance volume.
The volume the cylinder displaces can be determined by dividing the total engine
displacement by the number of cylinders. In this case the engine has a total
displacement of 599cm3 with 4 cylinders, which make the displaced volume of
one cylinder 149.75cm3. The clearance volume is the volume in the cylinder
above the piston when it is at top dead center (TDC) and the volume of the
cylinder head. To determine this the following equation is used:
CR =
(Vdisp + Vclearance )
Vclearance
This can be applied, using the compression ratio (CR) and the known
displacement of the piston. For our engine, a 11:1 compression ratio was listed
by the manufacturer, which made the clearance volume equal to 13.623 cm3.
Using the determined volume the total cylinder volume can be calculated and is
equal to 163.373 cm3.
The temperature determination is a variable that is tough to control in this
type of situation; the weather conditions usually dictate the air temperature.
When the engine is operating at WOT, the temperature of the air in the cylinder
can be assumed to be equal to that of the ambient air. This assumption is due to
the fact the air velocity is so great that it does not sit in the manifold to be heated.
Also additional heat shields and cooling ducts can be added to insure this
assumption. The EFI computer will have an air temperature sensor to input the
temperature for the current conditions. For the mass of air determination here,
the temperature will be equal to 70oF, room temperature. This assumption is
based on the temperature when the injectors will be experimentally tested for
verification.
The final variable needed for the Ideal Gas Law is the volumetric
efficiency, η v. The volumetric efficiency is the measure of the efficient volume of
air that is actually being inducted to the cylinders. This measurement is
essentially a percentage of air volume inducted. As engine speed and throttle
position increase, this value for η v will increase as well. For the injector testing
this variable will be equal to one, normalizing the equation. This assumption is
also based on the throttle position set at WOT. The change in engine speed
versus volumetric efficiency can be viewed in the following plot. This graphical
representation will also be used for the microcontroller programming.
Now that the assumptions for the Ideal Gas Law have been made the
mass of air can be calculated. The units for this will be in metric for ease of use;
therefore the constant R will be equal to 8.314. The mass of air was determined
to be equal to 0.006769 kg.
To determine the mass of the fuel, the stoichiometric ratio must be used.
The stoichiometric ratio is also known at the chemically correct ratio, and this is
the ratio of air to fuel. For gasoline the operation limits are roughly 11:1 (rich)
mixture to a 20:1 (lean) mixture. The stoichiometric ratio for optimum operation
and lowest emissions is 14.5:1. At this ratio it is represented by letting λ = 1.
This is what the initial calculations will be based on. However for fuel economy
purposes a ratio of 20% lean can be used for fuel mass calculations, this would
be about a 17:1 mix. For maximum performance the fuel mixture would be
richened about 10% to achieve max power, this would be a ratio of 13:1.
Using the stoichiometric ratio it was determined that the mass of fuel
needed at λ = 1, to be equal to 4.6686 E -4 kg. This mass can now be
converted to a volume using the specific weight for gasoline, which is equal to
45.9 lb/ft3. This value will need to be converted to metric units. The volume of
fuel needed for one cylinder at stoichiometric conditions is 0.63497cm3. The
change in the volume of fuel compared to stoichiometric ratio can be seen in the
graphical representation below.
1.2
Volume of Fuel (cm^3)
1
0.8
0.6
y = 9.2065x-1
0.4
0.2
0
0 5 10 15 20 25
Stiochiometric Ratio
This is the volume that each injector will discharge every cycle at the appropriate
time. The equation posted on the graph is for the represented curve. This will be
used also in the future programming to fine tune the air/fuel ratio for different
engine requirements and driving conditions. The injection timing will be
discussed later.
dependent and this voltage input is used to open the pintle and allow fuel to flow
by. The duration of the voltage signal is a variable, which controls the volume of
fuel discharged. The fuel pressure is another variable consideration. To
determine the pulse width for the injectors, a test rig was designed to represent
the fuel delivery system. This can be seen in the layout below.
Using this test rig, a particular pulse width can be produced from the
signal generator. This signal from the generator will be a square wave. This
signal will be transmitted through the fuel injector drivers. The drivers will then
send the conditioned signal to the injector. As for the fuel delivery to the injector,
this will be done just as it would in an actual car set-up. The fuel will be delivered
from the tank via a high-pressure fuel pump (95-psi max.) to the injector. The
pressure at the injector will be regulated, to control the pressure input. The fuel
pressure regulator is critical to maintain a constant pressure at the injector. This
will also allow us to vary the pressure during the test. Most fuel injection systems
operate at a fuel pressure of 40 psi. However it is recommended that the fuel
pressure should not exceed 60 psi, this recommendation was made by the fuel
injector manufactures due to internal component design limits.
The actual fuel volume will be determined by firing the injector for a given
number of injections, the total volume of fuel will be collected and divided by this
number to determine the volume of fuel per injection. The fuel will be collected in
the beaker shown in the diagram. The ice pack that surrounds the beaker is
used to minimize the amount of fuel vaporized during the injections. This will
result in a more accurate fuel volume per injection measurement.
The fuel injector calibration test was preformed as discussed before.
From this test, an equation was developed for programming the microcontroller
to regulate the fuel delivered by inputting a certain pulse width. To achieve this,
a number of different pulse widths were used and the volume of fuel was
determined. The results of the test proved to be a linear as shown in the graph
below.
3.00E-02
2.00E-02
1.00E-02
0.00E+00
0 5 10 15 20
PW (ms)
The equation that was determined from this calibration test is only suitable for the
injector used during the test. If injectors with a different flow rate are used this
test should be preformed again with those injectors to insure proper fuel delivery
per injection.
As mentioned earlier the duration of the pulse width and the fuel pressure
inputted to the injector have an effect on the volume of fuel discharged. In an
automotive application, the fuel pressure will vary with respect to the manifold
pressure and therefore also with respect to engine load. This is because a fuel
injector works on the principle of differential pressure across the injector. And
this differential pressure is the systems operating pressure. In an earlier section
it was noted that as throttle position increases the manifold pressure begins to
increase, therefore to maintain a constant differential pressure the absolute fuel
pressure must increase. The fuel regulator will control the absolute fuel pressure
from a vacuum tube from the intake manifold. The diagram below shows the
layout of the fuel rail, fuel regulator and manifold.
width is constant, it could mean that the engine would be starved for fuel. This
starvation will cause the engine to operate at lean conditions causing power
losses and possible engine damage if the ratio is very lean.
The timing of the valves is an important variable that is needed for fuel
injection systems. This timing of the valves is the point at which the intake and
exhaust valves for each cylinder open and close. This measurement is based on
the position of the crankshaft, and is measured in degrees. Using the
manufacture’s specifications from the owner’s manual, a linear valve-timing
diagram can be produced. This is a graphical representation using linear bars to
indicate when each of the individual valves is opening and closing with respect to
one another. A valve timing plot was developed for the Honda F1 engine and
can be viewed in appendix D. This tool will allow the EFI program a
measurement of when to fire the injectors in either the bank firing or sequential
firing method.
Since a new fuel injection system will be utilized a different intake manifold
will be required to deliver the fuel and air to each of the cylinders. The manifold
will consist of a throttle plate, restrictor, plenum, runners, and fuel rail. The main
focus of the design will be the restrictor, plenum, and runners, since this is where
the majority of tuning will be done. Calculations can be made to optimize these
components for maximize engine performance. A typical 4-cylinder intake
manifold would look like something like the figure below.
Ai = inlet area
m=
( PAV )
( RT )
where m = mass flow rate
A = cross sectional area
The next portions of the intake that need to be studied are the plenum and
intake runners. These two work together to deliver the air to the engine. Inside
the intake manifold the air flowing through can experience pulsations or waves.
This occurs due to the air flowing in and hitting a closed valve then traveling back
up the intake runner. This resonates can be used to help increase performance
if the runners and plenum are designed correctly. The runners need to be a
certain length so that as the pulse waves travel away from they engine, they
bounce back at the proper moment in which the intake valve opens again. This
is called a tuned induction or “ramming” and can result in considerable power
improvement of 10–20%. The length of the induction pipe will influence the
engine speed at which maximum benefit is obtained from the pulsating flow. This
can be seen in the following plot of the pipe length versus engine speed (Stone
pg. 310).
The pipe variables are representatives of the intake runners, and the resonator is
the plenum. The other model for the resonant frequency is that of the organ
pipe, and is represented by the following equation
C
fp =
4L
L = l + 0.3d
where L = effective length
l = pipe length
d = pipe diameter
Either of these can be used for the determination of the resonate frequencies.
This tuning technique benefits both volumetric efficiency and power. However
the resonates frequency will only be good for particular engine speeds. The
intake can experience more than one resonating frequency. Therefore, a focus
needs to be made to ensure that these resonating frequencies are present at
particular engine speeds, mainly at speeds the engine will be run at during the
competition.
To confirm that the runner lengths were correct, the effective length was
determined and used in the pipe organ equation. This proved that the effective
length was in fact 0.35 m, and that the airflow would resonate at about 230 Hz.
Using this frequency and the effective length in the Helmholtz equation, the
plenum volume could be determined. The plenum volume was calculated to be
4.7646E-4 m3 or about 29 in3. This was verified by a rule of thumb measure that
stated that the plenum volume should be about the volume displaced by the
engine.
Other design considerations are the intake runners from the plenum.
From the plenum air needs to be funneled into each of the intake runners. There
is a tendency in intake design to just connect the two. But at this junction a
boundary layer is present. Therefore to help minimize the boundary layer
experienced at the mouth of the runners, the runners are tapered or flared. This
shape is sometimes called a velocity stack. This runner shape at the mouth
minimizes the boundary layer by helping the air to flow more smoothly. With the
reduction of the boundary layer the runner is less prone to choking the flow.
These runner shapes at the mouth can be seen in the following figure.
As far as the rest of the intake systems components they do not need as
much attention to maximize the performance. The throttle plate needs to have a
matching bore to the front end of the venturi to minimize airflow losses. The
throttle plate also needs to have a linear opening motion. If this motion is not
achieved then, when the engine is run the driver will not be able to adequately
control the engine speed and output. A throttle with non-linear motion will result
in maximum engine speeds with out have fully opening the throttle plate. This is
undesirable for driving conditions.
The fuel rail is the last point of concern for the intake system. The fuel rail
will provide fuel to each of the injectors through a common pipe. The only
concern for the fuel rail is adequate fuel delivery for the injectors. Therefore the
volume of the rail needs to be examined to insure it will hold enough fuel to
provide the injectors adequately under hard accelerations. However this should
not be too big of a concern with a fuel regulator that has a quick time response to
meet the need for a higher fuel pressure in the rail. To ensure that the fuel
pressure did not drop significantly when the throttle was opened quickly, a
pressure gauge was installed on the inlet of the fuel rail. It was determined that
the fuel injectors would be delivered fuel at 50 psi based on the fuel regulator
setting. To adjust the fuel pressure an adjustable fuel regulator was used, but it
was decided that this would provide to many problems in tuning without any
performance enhancing characteristics. It was also suggested that mild steel or
stainless steel be used for the construction of the fuel rail, instead of aluminum.
This is because after a hot shutdown steel gathers far less heat, which could lead
to fuel boiling in the rail and causing vapor lock (sdsefi.com/tech).
The intake layout was based on the space constraints of the car its self.
The air intake for the system was placed above the driver’s head and just under
the main roll bar. This can be seen in the following photograph, Figure 39. The
rest of the intake manifold would also need to fit within the main roll bar brace.
This is to protect the manifold from being hit in the event of an accident.
Therefore the manifold would have to incorporate some bends to meet these
constraints. The use of bends in the manifold layout is not very critical, minor
bends do not have a significant effect on the airflow through the manifold. It was
decided that the intake runners would be bent 35 degrees to originate the plenum
in a vertical plane with respect to the runners. Also by bending the intake runners
35 degrees the injectors could be mounted to the runners so that they fired
directly at the base of the intake valves. This design consideration would help to
ensure that all the fuel is injected to the cylinder.
Intake Runner
Fuel Injector
With the plenum in the vertical plane, this would also then allow the air
intake runners to be originated parallel to the main roll bar brace. This would
result in the fewest number of bends and maximize the space above the engine
head. With this location placement the manifold would receive the most external
cooling effect from the open air. The last consideration was to place a vacuum
port on the end of the manifold as close as possible to the fuel regulator vacuum
port. Placing the vacuum ports as close as possible would help to minimize any
delay effects noticed when the manifold pressure changed especially under hard
accelerations.
Testing
When it was time to test the system on the engine, we used an engine
dynamometer to decrease testing time. Before engine testing could begin with
the intake manifold, a series of leak checks were necessary. With the fuel
system plumbed to the fuel rail, fuel was delivered to check for any leaks. A fuel
leak can pose a potentially dangerous situation especially when the engine is
running. The fuel rail was leaking around the injectors. The fittings were
tightened and this proved to be unsuccessful. After looking at the injector o-
rings, which seated the injectors to the fuel rail, they looked to be ineffective.
The o-rings were replaced with smaller inside diameter and thicker o-rings, which
provided a tighter seal at the fuel rail. This proved to be the solution to the fuel
leaks, and engine testing could begin safely. With the engine running the
manifold needed to be checked for adequate vacuum pressure. This was to
ensure that the manifold had no leaks in any of the welds, which could decrease
the engine's performance. The vacuum gauge showed that the manifold held 10
in Hg, which is within manufacture's specifications. Below is a picture of the
intake on the dyno during testing.
Throttle
20mm Restrictor
Plenum
Intake
Runners
Fuel Rail
Fuel Injection
We decided to design our own electronic fuel injection (EFI) system similar
to commercially available systems, instead of purchasing a complete system.
This approach allows us to design the EFI system to the exact constraints of the
Honda engine with the specific features that we desire. One of these desired
features is the ability to set the system to either performance or economy mode.
Using the performance mode, we can produce maximum power only when
needed. The economy mode would be used to reduce fuel consumption during
certain portions of the competition.
A number of different designs were considered before the final control
system scheme was chosen. Initially, the fuel injection was going to be
controlled using multi-port fuel injection, which involves firing all the injectors at
once, and the spark would be delivered to pairs of companion cylinders using a
waste spark system. Our design was developed originally for a Honda F4
engine, but our final design uses a Honda F1 engine and the ignition coils from a
Honda F4 engine.
Since the engine we originally expected to receive was a Honda F4
motorcycle engine, which has a coil-on-plug ignition system (an individual coil for
each cylinder) the waste spark system is redundant and inefficient since it is not
necessary to fire two ignition coils at once. The F4 system has no camshaft
position sensor so the engine position with respect to which cylinder is on a
power stroke is not readily available. This system does not lead to a
straightforward design for sequential fuel injection
The EE/CMPE team devised a scheme to obtain the engine’s power
stroke position from the voltage difference found at two companion ignition coils
primary windings during the inductive discharge. The way that this is
accomplished is to start the engine in a waste spark mode while using multi-port
fuel injection. At start-up the only information available is the overall engine
position from the crankshaft position sensor. This is only half of the information
needed for sequential fuel injection.
A four-stroke engine’s cylinders go up and down twice for each complete
cycle. This means that the engine is either on the first or fourth cylinder
compression stroke when the crankshaft is at 0°. Therefore, it is necessary to
start the engine in a waste spark mode. The first and fourth spark plugs are fired
simultaneously just before 0°, and the second and third spark plugs are fired
simultaneously just before 90°. Once the engine is running, the primary voltage
drop across two ignition coils will be measured simultaneously. This will be
performed at the 1-4 or the 2-3 cylinder pairs. This has been successfully
simulated using MicroSim PSpice software (see Appendix J).
The inputs to the fuel injection control system are engine speed, engine
load, throttle position and ambient air temperature. The fuel injector is an
electromechanical device that is activated by a voltage pulse, which induces a
current in the injector’s solenoid opening the injector and allowing fuel into the
intake manifold. The amount of fuel injected is controlled by the pulse duration
(or pulse width) of the voltage signal. The pulse duration is required to change
with respect to the load on the engine (i.e. with a higher load, the amount of fuel
supplied increases and therefore the pulse width is increased). As engine speed
changes, the frequency of the pulses also changes in direct proportion to engine
speed.
Throttle position refers to the position of the throttle plate. The throttle
plate is located at the opening of the intake manifold. It opens in order to let
more air in as the accelerator is depressed. When the engine load increases,
more air is allowed in as the throttle is depressed. If the throttle is opened, the
fuel injection system will increase the pulse width to supply more fuel. Ambient
air temperature affects the air to fuel ratio. When the temperature is lower the
density of the air changes and more fuel is required to achieve the stoichiometric
ratio.
The crankshaft sensor determines engine speed and position. On the end
of the crankshaft there is a sensor wheel with seven teeth followed by a gap
known as the missing tooth region. The sensor mounted on the engine case will
send a signal as each tooth passes. The frequency of these signals will tell the
speed of the engine. When the gap is encountered, the exact position of the
crankshaft is known. Knowing the position of each piston is not enough to find
the exact position of the engine. Since the pistons are moving in pairs, the
crankshaft sensor will not tell us which of the cylinders is on a power stroke and
which is on an exhaust stroke.
To find this a different approach was taken. When the car is first started
the position of the engine needed for proper sequential fuel injection is not
known. Starting in a waste spark mode is a solution to this problem.
In a pair of companion cylinders, one of the cylinders is in the power stroke and
the other is in the exhaust stroke. When the pair of spark plugs fire, the spark to
the cylinder in the power stroke is the only spark that will induce combustion.
Since the other cylinder is in its exhaust stroke no combustion will occur in that
cylinder. At this time the injection is performed in a bank-firing mode.
When the spark plugs are fired there is a transient voltage present at both
ignition coils. The size of the voltage is directly proportional to the pressure in
each cylinder. When the pressure is greater, the voltage is greater.
When a cylinder is in its compression stroke, the piston comes to the top
of the cylinder compressing the fuel mixture. This creates a pressure on the
order of 8-40 atmospheres (ATMs) from idle to high engine speeds. When a
cylinder is in its exhaust stroke, the pressure in the cylinder is only 1-3 atm.
There is a vast pressure difference between the two cylinders, so there is a
difference in the transient voltage present at the ignition coils. This voltage
difference can be used by a comparator whose output will indicate which cylinder
has the greater voltage, and thus, which cylinder is in the power stroke. Once
the correct engine position is known, the injection and ignition system can be
synchronized and fired sequentially.
The inputs to the ignition control system are engine speed, crankshaft
position, and engine load. Engine speed is used because as speed increases
the frequency of the sparks will increase. The frequency of the sparks is directly
proportional to engine speed. Crankshaft position is required as an input to the
ignition system because the position of the pistons determines when the spark
plugs should fire. Engine load is used because as the engine load is increased
there is a need to adjust the timing. All of these inputs are sent to a
microcontroller. Based on these inputs, the microcontroller is coded
appropriately to send the required pulse to the driver circuits.
The driver circuit is placed to act as a switch, which provides 12 volts to
the primary ignition coil based on the position of the pistons. Then the 12-volt
supply voltage is applied at the primary coil, and then transformed (step-up)
voltage resides at the secondary coil. The interruption of the voltage supply at
the primary coil causes an inductive discharge at the secondary coil. This
amount of voltage at the secondary coil fires the spark plug. The high voltage at
the secondary coil induces a large transient voltage at the primary coil during the
secondary discharge. In order to protect the microcontroller, and to source
enough current to the ignition coil, an insulated gate bipolar transistor (IGBT) is
placed as the driver circuit for the ignition coil.
The Manifold Absolute Pressure (MAP) sensor measures the amount of
pressure or vacuum in the manifold. This sensor tells the engine load. With
more pressure, the engine load increases. With greater load on the engine,
more fuel is required. This is an input to the microcontroller and will be a factor
when setting the voltage pulse width for the fuel injectors.
The Throttle Position Sensor (TPS) returns the position of the throttle
plate. When the TPS measures a wider opening, this indicates a greater engine
load. When the TPS changes rapidly a hard acceleration is indicated causing a
need for more fuel. The TPS senses the position by using a potentiometer that
turns when the position of the throttle plate changes. Since this is a
potentiometer, there will be a change in voltage at different positions. This
voltage is then returned to the microcontroller.
The crankshaft position sensor detects the speed and position of the
engine. The Variable Reluctance Sensor (VRS) reacts to variations in flux
density created by a rotating multi-toothed wheel with a missing tooth region.
The sensor contains a coil of wire, a magnet, and a pole piece. The changing
flux field induces an alternating current (AC) voltage in the VRS. One AC cycle is
generated for each tooth on the wheel, and no signal is produced for the 1/8 of a
revolution when the missing tooth region passes the sensor. It can then be
determined that one revolution has occurred when the missing tooth region is
encountered. The VRS sensor in the Honda F1 engine generates a 0.6V signal
at cranking speeds, and a 40V signal at 6000 RPM.
saturation (due to a 1V internal drop in the Op Amp). The Op Amp has a gain of
(R3+R4)/R3 which is 21. This amplifies a small signal of 0.6V to 12.6V, and since
the Op Amp saturates at 5V, its output is 5V. The resulting wave is a close
approximation to a square wave at low engine speeds, and virtually a square
wave at higher engine speeds. This results in a TTL signal that is a series of 7
pulses corresponding to the teeth of the VRS followed by a gap that corresponds
to the missing tooth region of the VRS. This signal allows the microcontroller to
recognize both engine speed and position.
MAP Sensor
The MAP sensor detects the pressure in the intake manifold. Knowledge
of this pressure is vital for proper engine performance since the amount of fuel
necessary for any given engine load is determined by the pressure in the intake
manifold. The MAP sensor’s output is a voltage whose level depends on the
manifold pressure in the engine. As engine load increases, the MAP voltage will
decrease. The MAP sensor’s output voltage range is 1V - 6V for an 8V supply.
Based on the voltage present at the MAP sensor, the corresponding
pressure can be deduced by means of a pressure-voltage graph exclusive to the
particular MAP sensor being used
The MAP sensor signal is proportional to the fuel that is necessary at any
given engine speed. The MAP sensor operates as follows:
The previous relationships depict how intake manifold pressure and load
affect the MAP sensor output. The spark timing is varied based on the engine
speed and the pressure in the intake manifold. The intake manifold pressure and
MAP sensor voltage have a linear relationship. Using the pressure-voltage
relationship of our sensor, the pressure in the intake manifold can be determined
by the MAP sensor voltage. This pressure along with the RPM of the engine is
used to determine a parameter known as the spark-angle (θspk). Spark-angle is
determined from the θspk vs. RPM graph or from look-up tables developed by the
ME team during dynamometer testing. Spark-angle is simply the number of
degrees of rotation left in the crankshaft before the piston gets to the top of the
cylinder.
The rotary switch allows the user to select how rich or lean the engine is to
run. When the switch is turned clockwise the pulsewidth is increased making the
engine run richer. When it is turned counterclockwise the pulsewidth is
decreased to make the engine run leaner. Using a 6V supply and six resistors of
1.8kΩ in series creates a voltage divider circuit in -1V/step increments to ground
with a current of 6V/(6 x 1.8 kΩ ) = 0.55mA. As the contact within the switch
alternates between each step, the output voltage changes in 1 volt incrememnts.
This voltage is then sent to the microcontroller to determine how much to
increase or decrease the fuel. It is understood from the circuit diagram that
between R1/2 is 5V, R2/3 is 4V, R3/4 is 3V, R4/5 is 2V, and R5/6 is 1V. These
five steps will be mapped to rich, semi-rich, stoichometric,semi lean, lean,
respectively.
The final two sensors used are the Ambient Air Temperature sensor (AAS)
and the Throttle Position sensor (TPS). The AAS is a thermistor, a device that
changes resistance with air temperature, which is used by the microcontroller to
make corrections or adjustments to fuel volume. The TPS is a potentiometer, a
device that changes resistance when its center terminal changes position. The
TPS is mounted on the intake plate to determine the position of the plate. During
a hard acceleration, there can be a delay if the MAP sensor is not quick enough
to pick up the pressure change in the intake. The TPS voltage is used by the
microcontroller improve the throttle response.
Driver Circuits
The outputs from the microcontroller for ignition and fuel injection control
are interfaced to the engine using driver circuits. These circuits are designed to
source enough current to the ignition coils and injector solenoids. The
microcontroller will also use the outputs of a comparator circuit to detect which
cylinder is in a compression stroke. That information is used to inject fuel
sequentially, and to fire only the appropriate ignition coil depending on which
cylinder is on a compression stroke.
Ignition System
Driving the ignition coils presents a distinct design problem due to the high
current and voltage levels present at the ignition coils. The ignition coils are
actually transformers that step 12V up to as much as 50kV. Pairs of inductors
that are in close proximity form a transformer. The transformer steps up, or steps
down the primary voltage based on the turns ratio of the inductors, given by
Ns
n=
Np
,
where Ns and Np are the number of turns in the primary and secondary windings.
The voltages and currents in a transformer are proportional to the ratio of turns.
Ns Ip
n= =
Np Is
When the current changes in one inductor, it induces a voltage in the other
inductor. This effect is known as self-inductance. The induced voltage is given
by
di
V = L
dt
where L is the inductance in Henrys.
Self-inductance is used to fire the spark plugs in an internal combustion
engine. When the voltage supply is interrupted at the primary side, it causes the
di
magnetic field developed in the primary side to collapse V = L as the high
dt
secondary voltage arcs across the spark gap. The resultant secondary current in
turn induces a voltage in the primary windings.
The current drawn by the Honda F4 ignition coils we will use is 7.1A as the
primary side charges, and the induced voltage at the primary side of the ignition
coil caused by the secondary discharge is in the 150V to 200V range (depending
on the compression level of the cylinder). These are both orders of magnitude
too high for the microcontroller to handle. This requires a driver circuit between
the microcontroller and the ignition coils.
The device that best handles these conditions is an insulated gate bipolar
transistor (IGBT). This is a combination of a bipolar transistor and a field effect
transistor (FET). This device can source large amounts of current, and it can
handle the high voltage transients found at the primary side of the ignition coil
during secondary discharge. This specialized transistor has been used
extensively as an automotive ignition coil driver. IRGS14C40L’s were selected
for our ignition coil drivers since they are specifically designed for coil-on-plug
ignition systems.
One important control variable is the charge time for the primary ignition
coil. The time to fully charge the ignition coil must be known in order to deliver
the spark at the right time. Since the interruption of the primary voltage triggers
the secondary discharge, the coil should be fully charged when the spark is
needed. This is accomplished by working backwards from the necessary time for
ignition spark. The microcontroller will turn on the ignition driver circuit at a time
just before the spark is actually needed. The time must be at least sufficient to
fully charge the ignition coil for the control system to maximize engine
performance.
The primary ignition time to saturation (full charge) was found by first
measuring the inductance and resistance of the ignition coils. Then the charging
of the ignition coil primary was simulated as an inductor in series with a resistor
using MicroSim Pspice software. The time to saturation for our ignition coils is
approximately 6ms.
The ignition coil primaries of number one and four cylinders are connected
to two voltage dividers to reduce the voltage to acceptable levels for the Op Amp.
Using the voltage divider rule for two series resistors,
R2
VR2 = * Vcyl ,
R2 + R1
the transient voltages at the primary ignition coils are lowered from 150V to 15V
and 200V to 20V using R2 = 10R1 and R4 = 10R3. Using 1nF capacitors in parallel
with R2 and R4, we added two low-pass filters (LPF) to the circuit to spread the
voltage spikes out in time for easier comparison. The cut off frequency of the
LPF must be set above 166 Hz, which is the frequency of the spark events at
10,000 RPM when both coils are being fired simultaneously. The equation is
1
fc =
2πRth C
The cutoff frequency is determined to be 175 kHz, which is well above our limit.
This results in a TTL signal corresponding to the compression cycles of number
one and four cylinders. An example of the logic of the Op Amp output is:
This signal is then sampled at the same time as the firing of the ignition
coils one and four in order to determine where the engine is in regards to power
and exhaust stroke on either cylinder. The schematic is shown on the next page
as Fig. 46.
Microcontroller
The microcontroller first starts out by calling the subroutine FIND_14. This
subroutine is a capture of the crankshaft signal. The capture command gives the
period of the signal. At cranking speed, the duration of the open tooth region is
approximately 25ms. When the captured time reaches this value, the position of
the cylinders are known.
For the first 50 revolutions of the engine, the pulse width of the fuel supply
is a constant 3ms. This is because the engine needs extra fuel on startup and
the MAP sensor is not used yet. After the position of the engine is determined, a
subroutine, FUEL_SPARK, is called. FUEL_SPARK first sends five volts to
appropriate output pins connected to the driver circuits of cylinders 1 and 4 for
the 3ms fuel supply. The subroutine then counts three teeth on the crankshaft
wheel, which corresponds to the position of cylinders 2 and 3. When the third
tooth is found 5 volts is sent to the corresponding pins of the driver circuits for
cylinder 2 and 3 for a 3ms fuel supply. To determine the position of cylinders 1
and 4 again, the subroutine is set up to count three more teeth and generate an
interrupt after the third count. FUEL_SPARK is now called whenever this
interrupt is generated.
After the 50th revolution, the duration of fuel supply is determined based on
the manifold pressure. The subroutine FUELMASS is called after the 50th
revolution. FUELMASS calculates the mass of fuel and determines the fuel
supply pulse width depending on the manifold pressure. The subroutine then
performs an A/D conversion of the MAP sensor voltage. The linear relationship
between manifold pressure and MAP sensor voltage is y = -111x + 135200,
where x is the MAP voltage and y is the manifold pressure. The mass of fuel
(mg) is then calculated using the Ideal Gas Law equation:
η PV
RT
M ass=
( 1 )
14.5
The pulse width is determined from the linear equation y = 486x + 400, where x
is the calculated fuel mass (mg) and y is the pulse width (in microseconds). This
equation was obtained from the injector calibration tests mentioned earlier.
The volumetric efficiency η from the ideal gas law equation is determined
by implementing a look up table. The volumetric efficiency is a correction factor
to change the amount of fuel at different times. A perfect engine would have an
efficiency of one. To obtain this value, manifold pressure and engine speed are
needed. To determine engine rpm, the subroutine RPM is called. RPM performs
a capture of the crank sensor signal to determine the frequency of the engine,
which gives engine speed. The manifold pressure is obtained from the stored
value in the FUELMASS subroutine.
The lookup table gives different volumetric efficiency values for different
manifold pressures and different engine speeds. These tables are for engine
speeds from 1000rpm to 10000rpm and for manifold pressure from 0.1 atm to 1
atm. Each speed and pressure has corresponding volumetric efficiency values.
To determine the appropriate volumetric efficiency the subroutine RPMCHECK is
called. RPMCHECK obtains the rpm value determined in the RPM subroutine
and finds what table is to be called. The table with the rpm value closest to the
actual rpm is chosen. Once the correct table for rpm is called then the pressure
is used to determine the volumetric efficiency. This is done the same way in
which the rpm table was determined. The microcontroller finds which pressure in
the table is the closest to the actual pressure. When it finds the correct pressure
the volumetric efficiency is found.
A subroutine called RICHLEAN adjusts the fuel mass based on the
driver’s settings. The RICHLEAN subroutine performs an A/D conversion on the
voltage from the five-position switch. For the rich end the fuel mass is adjusted
by a factor of 1.4 and by a factor of 0.6 for the lean end. The linear relationship
between driver control voltage and adjusting factor is y = .0009x + 0.401, where x
is the driver control voltage and y is the adjusting factor. The subroutine
calculates the adjusting factor using this equation. The mass of fuel calculated in
the FUELMASS subroutine is multiplied by this factor to determine the adjusted
fuel mass.
Implementation
The actual engine control system we implemented differs from the original
design in a number of ways. The engine we used was a Honda F1 instead of a
Honda F4. The ignition system we designed was not implemented for the
competition, and therefore the cylinder compression detector was not
implemented either. Two sensors were eliminated from the final system as well.
The throttle position sensor and the ambient air temperature sensor were both
omitted. The justification for these changes follows.
The implementation was done incrementally to effectively test each
system. Each interface circuit was built and tested on a proto-board before the
total system was assembled. The microcontroller was then tested on a proto-
board with a signal generator to emulate the crankshaft sensor, and LED’s
representing the outputs of the microcontroller. Following the bench testing, the
complete fuel injection system was tested on the engine using the Honda ignition
system instead of our own ignition system. The reason for this was that the
Honda F1 engine was already equipped with a working ignition system, so this
would eliminate one variable from our initial testing. We would only need to
diagnose one system in the event of a problem.
The testing and tuning of the fuel injection system was much more time
consuming than expected. This lead to a lack of time for testing the ignition
system on the vehicle, instead our ignition driver circuit was only tested on the
bench. There were concerns about implementing an ignition system at the last
minute, when a reliable system was already present. The durability of our
system was a concern since there was not ample time to test it. This combined
with not having accurate dynamometer data to tune the ignition system, lead us
to believe that we would not increase the performance or reliability of the engine
by the addition of our ignition system. We opted to use the Honda ignition
system for the competition.
The throttle position sensor was not used because we decided that the
added benefit would not be worth the required time to implement it. This input
would only affect hard accelerations when the throttle is opened quickly. This
Patent Opportunities
After completing a patent search it was apparent that there were not any
current patents on a system for performing sequential fuel injection without the
use of a camshaft sensor. There were two earlier patents from 1996 and 1997
(US # 5,668,311 and US# 5,493,496) for determining which of two companion
cylinders is under compression for systems using waste spark. Delphi
Automotive Systems has a system that they produce called Compression Sense
Ignition that provides this particular feature. This system, like the previously
patented systems, is for a waste spark system that uses one ignition coil for two
cylinders. The description of their system mentions that it could possibly be
adapted to coil on plug systems, but it does not indicate that they have already
accomplished this.
It seemed apparent that this type of system would be fairly straightforward
to implement on a coil-on-plug application like the F4 Honda engine we were
originally scheduled to receive. The idea being that the primary ignition
waveform will be different for a cylinder firing under compression than it will be
for a cylinder firing when there is no compression present. So, if the pair of
companion cylinders A and B is fired simultaneously, then the two primary
waveforms can be compared through the use of a comparator circuit. The
comparator can be set up such that it’s output will be 5V for cylinder A on
compression, and 0V for cylinder B on compression. This information can then
be used by the microcontroller to send fuel sequentially, and fire the ignition coils
only when they are needed (every second revolution for each cylinder). See
appendix J for simulations and circuit diagram.
Budget
Suspension
Engine Intake
Again, through the reuse of parts and those that have been paid for by
sponsors, the cost of the intake system for fuel injection was minimized. Below is
the portion of the budget that is for mechanical aspects of the engine.
Engine Control
Listed below in Figure X is the final engine control budget. As seen below,
the final engine control budget of $1220.61 is very close to the projected of
$1132.00, so we did an excellent job of estimating. Although the ignition system
we designed was not implemented, all the components necessary were ordered.
Timeline
A timeline for the spring semester was created at the end of the fall
semester and updated throughout the spring semester. It was originally broken
down into two teams (microcontroller and circuitry, respectively) and the main
tasks that were needed to complete the project. The main bulk of the
components were ordered early in and during the spring semester of 2001. The
original proposed completion date of April 26, 2001 could not be attained due to
monthly delays in getting the F1 engine, which delayed experimental results
needed to finalize electronic fuel injection design and coding. Considerable time
was spent on this project to ensure that we would finish on time. This timeline
has been included in appendix B.
Conclusion
We think the University of Connecticut will be well represented at this year’s SAE
student design competition.
References
Bosch, Robert. Automotive Handbook. Bosch; Stuttgart, Germany. 4th ED, 1996.
Metzger, Daniel L. Electronics Pocket Handbook. 3rd ED Prentice Hall PTR; Upper
Saddle River, NJ, 1998.
Milliken, William and Douglas. Race Car Vehicle Dynamics. Society of Automotive
Engineers; Warrendale, PA, 1995.
Staniforth, Allan. Altair SuspensionGen User’s Manual. Altair Computing Inc.; Troy, MI.
Version 1.13, 1998.
Thomas, Roland E. and Rosa, Albert J. The Analysis and Design of Linear Circuits.
Prentice Hall PTR; Upper Saddle River, NJ, 1998.
Acknowledgements
• Society of Automotive Engineers, University of Connecticut Chapter
• Dr. John Ayers for continuous help, technical and non-technical support
• Dr. Jim Cowart for guidance and technical support and answers to
questions concerning automotive theory
• UConn Engineering Machine Shop personnel Tom, Rich, and Serge for
their help and support with the project
• Mr. Peter Boardman for his advice and facilities support
• Mr. Marty Wood for his help getting us started with Formula SAE and
support throughout the project.
Appendix
Appendix A – Figure List
Appendix B – Timeline
Appendix F – Microcontroller
Port Schema
Microcontroller Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cblock Bank0RAM
SCALER ; register associated with looptime
RTIMEH ; captured rise time of crank signal (high byte)
RTIMEL ; captured rise time of crank signal (low byte)
FTIMEH ; captured fall time of crank signal (high byte)
FTIMEL ; captured fall time of crank signal (low byte)
TIMEH ; calculated pulse width (high byte)
TIMEL ; calculated pulse width (low byte)
RPMREGH ; rpm register (high byte)
RPMREGL ; rpm register (low byte)
SECH
SECL
W_TEMP
STATUS_TEMP
CONTROL
FALLTIMEH
FALLTIMEL
RISETIMEH
RISETIMEL
MAXH
MAXL
Y1INT1
Y1INT2
Y1INT3
Y2INT0
Y2INT1
MAPREGH
MAPREGL
CHARGETIME
REVCOUNT
RLREGH
RLREGL
Y3INT1
Y3INT0
HIGHH
HIGHL
TIMERH
TIMERL
TRANSCHECK
ADDH
ADDL
FMASS
endc
include math.inc
Mainline
call Initial ; call to initial all registers
call FIND_14 ; find engine position
MainLoop
nop
nop
goto MainLoop ; go back up (loop)
Initial
MOVLF 4,SCALER
MOVLF 0,CONTROL
MOVLF 50,REVCOUNT
bcf STATUS,RP0 ; set register access to bank 0
MOVLF B'00001101',T2CON ; set up timer2 to use 4MHz clock
bsf INTCON,PEIE ; Timer2 set up (pg. 60)
clrf PORTD ; clear portd
bsf STATUS,RP0 ; set register access to bank 1
bsf PIE1,TMR2IE ; Timer2 set up (pg. 60)
MOVLF B'10000000',ADCON1 ; select PORTA/E pins, right justified
MOVLF B'00001011',TRISA ; set I/O for PORTA
MOVLF B'00000100',TRISE ; set I/O for PORTE
MOVLF B'11111001',PR2 ; set up timer2 to use 4MHz clock
MOVLF B'00000101',TRISC ; Make RC2/CCP1 an input (pin 17) and RC1/CCP2 (pin 16)
an
output
MOVLF B'11110001',TRISB ; declare bit 0 of RB0/INT (pin 33) as an input
clrf TRISD ; make PORTD pins output pins
bcf STATUS,RP0 ; back to bank 0
MOVLF B'11000000',INTCON ; enable global, peripheral interrupts.
return
CRANKPULSE
bcf PIR1,CCP1IF ; clear to set up for falling edge
bsf PIE1,CCP1IE ; set to set up for falling edge
MOVFF CCPR1H,RTIMEH ; move captured time to defined register (high byte)
MOVFF CCPR1L,RTIMEL ; move captured time to defined register (low byte)
bcf CCP1CON,0 ; clear bit 0 to capture falling edge
MOVFF CCPR1H,FTIMEH ; move captured time to defined register (high byte)
MOVFF CCPR1L,FTIMEL ; move captured time to defined register (low byte)
clrf CCPR1H ; Clear all times after pulse width is found
clrf CCPR1L ; Clear all times after pulse width is found
movf RTIMEH,W ; move rise time (high) to W register
subwf FTIMEH,F ; subtract high bytes and store in F register
movf RTIMEL,W ; move rise time to W register
subwf FTIMEL,F ; subtract low bytes and store in F register
btfss STATUS,C ; if a borrow occured then decrement
decf FTIMEH,F ; decrement if borrow occured
call RPM
return
RPM
MOVFF FTIMEH,AARGB0
MOVFF FTIMEL,AARGB1
MOVLF 0,BARGB0
MOVLF 16,BARGB1
call FXM1616U
MOVLF B'00000011',BARGB0 ; high byte, putting 1000 in
MOVLF B'11101000',BARGB1 ; low byte, putting 1000 in
call FXD3216U ; converting from usecs to secs
MOVLF B'00000011',BARGB0 ; high byte, putting 1000 in
MOVLF B'11101000',BARGB1 ; low byte, putting 1000 in
call FXD3216U ; converting from usecs to secs, max # obtainable is 4295
(16bit)
MOVFF AARGB2,SECH
MOVFF AARGB3,SECL
MOVLF 0,AARGB0
MOVLF 60,AARGB1
MOVFF SECH,BARGB0
MOVFF SECL,BARGB1
call FXD1616U
MOVFF AARGB0,RPMREGH
MOVFF AARGB1,RPMREGL
return
;;;;;;;;;;;;; Send spark when missing teeth show up (falling edge) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;; Rectified and clipped crank signal goes into RB0/INT (pin 33) ;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;; Using Timer1 here also ;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;; Call CRANKPULSE here, want to find rpm only after missing teeth have passed ;;;;;;;;;;
;;;;;;;;;;;;; Clipped signal goes to RC0/T1OSO/T1CKI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;; Timer1 is set up as timer initially ;;;;;;;;;;;;;;;;;;;;;
FUEL_SPARK
clrf INTCON ; disable all interrupts
MOVLF B'10000001',PORTD ; Send fuel to cylinder 1 and 4 (pins 0
and 7 of PORTD)
clrf T1CON ; stop timer 1
clrf TMR1H ; clear Timer1 (High Byte)
clrf TMR1L ; clear Timer1 (Low Byte)
btfss REVCOUNT,7
call load3ms
btfsc REVCOUNT,7
call PWVALUE
clrf PIR1
bsf T1CON,TMR1ON ; start clocking timer
check btfsc PIR1,TMR1IF ; keep sending fuel as long as time is
not up (no interrupt)
nop
btfss PIR1,TMR1IF ; proceed to send spark if interrupt has
occured
goto check ; repeat
nop
clrf T1CON
clrf PORTD ; stop sending fuel only after interrupt
has occured
bcf PIR1,TMR1IF
MOVLF B'00010010',PORTD ; Send spark to cylinder 1 and 4 (pins 1
and 4 of PORTD)
clrf TMR1H
clrf TMR1L
MOVLF B'10011100',TMR1L ; To generate 100us delay between on
and
off time for coils
MOVLF B'11111111',TMR1H ; To generate 100us delay between on
and
off time for coils
clrf PIR1 ; clear peripheral interrupt flag
bsf T1CON,TMR1ON ; Start clocking TMR1 again
check1 btfsc PIR1,TMR1IF ; Keep charging coil until 100us are up
nop
btfss PIR1,TMR1IF ; skip next instruction if interrupt has
occured
goto check1 ; repeat
nop
clrf T1CON ; Stop timer 1
clrf PORTD ; remove signal from PORTD, sparks
explode
bcf PIR1,TMR1IF
clrf TMR1L ; new clear timer 1
clrf TMR1H ; new clear timer 1
MOVLF B'11111110',TMR1L ; Set up timer to generate overflow after
3rd count (rising edge)
MOVLF B'11111111',TMR1H ; Set up timer to generate overflow after
3rd count (rising edge)
clrf PIR1 ; clear peripheral interrupt flag
movlw 0x0E ; external clock set up
movwf T1CON ; external clock set up
bsf T1CON,TMR1ON
check2 btfsc PIR1,TMR1IF ; skip next command if 3rd tooth has not
been counted
nop
btfss PIR1,TMR1IF
goto check2 ; repeat
nop
clrf T1CON ; stop timer
call LOAD_23
bcf PIR1,TMR1IF
clrf TMR1L ; clear timer
clrf TMR1H ; clear timer
btfss REVCOUNT,7
call load3ms ;load 3ms into timer1
btfsc REVCOUNT,7
call PWVALUE
clrf PIR1 ; clear peripheral interrupt flag
bsf T1CON,TMR1ON ; start timer
check3 btfsc PIR1,TMR1IF ; keep sending fuel until .03s are up
nop
btfss PIR1,TMR1IF ; skip if interrupt has occured
goto check3 ; repeat
nop
clrf T1CON ; stop timer1
clrf PORTD ; remove fuel supply
MOVLF B'00001100',PORTD ; send spark to cylinder 2 and 3 (pins 2
and 3 of PORTD)
bcf PIR1,TMR1IF
clrf TMR1L ; clear timer1
clrf TMR1H ; clear timer1
MOVLF B'10011100',TMR1L ; To generate 100us delay between on
and
off time for coils
MOVLF B'11111111',TMR1H ; To generate 100us delay between on
and
off time for coils
clrf PIR1 ; disable peripheral interrupt flag
bsf T1CON,TMR1ON ; start timer1
check4 btfsc PIR1,TMR1IF ; Keep charging coil until 100us are up
nop
btfss PIR1,TMR1IF ; Do not repeat if interrupt has occured
goto check4 ; repeat
nop
clrf T1CON ; stop timer1
clrf PORTD ; remove signal from PORTD, sparks
explode
bcf PIR1,TMR1IF ; clear timer1 interrupt
MOVLF B'00000001',CONTROL
call CHECK_7
btfss REVCOUNT,7
decf REVCOUNT,F ; decrement REVCOUNT
nop
MOVLF B'11000000',INTCON ; re-enable global and peripheral
interrupts, RB0 interrupt is disabled
permanently
return
;;;;;;;;;;;;;;;;;;;;;;load_23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LOAD_23
MOVLF B'01100000',PORTD
return
;;;;;;;;;;;;;;;;;;;;;load3ms;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
load3ms
clrf TMR1L
clrf TMR1H
MOVLF B'01001000',TMR1L ; generate 3ms
;;;;;;;;;;;;;; Subroutine to count 7th tooth, timer1 is running after FUEL_SPARK is exited ;;;;;;
CHECK_7
bcf STATUS,RP0 ; bank 0
clrf T1CON ; Stop timer 1
clrf TMR1H ; new clear timer 1
clrf TMR1L ; new clear timer 1
MOVLF B'11111111',TMR1H ; Set up timer to generate overflow after
4th count (rising edge)
MOVLF B'11111110',TMR1L ; Set up timer to generate overflow after
4th count (rising edge)
bsf STATUS,RP0 ; enter bank 1
clrf PIE1 ; disable peripheral interrupt
bcf STATUS,RP0 ; bank 0
clrf PIR1 ; clear peripheral interrupt flag
movlw 0x0E ; external clock set up
movwf T1CON ; external clock set up
bsf STATUS,RP0 ; enter bank 1
bsf PIE1,TMR1IE ; enable timer1 interrupt
bcf STATUS,RP0 ; bank 0
bsf T1CON,TMR1ON ; start clocking TMR1 (counter)
return
FIND_14
btfsc CONTROL,0
goto last
start clrf T1CON ; stop timer1
clrf CCP1CON ; CCP module is off
clrf TMR1H
clrf TMR1L
clrf INTCON
clrf PIR1 ; clear peripheral interrupt flags
bsf STATUS,RP0 ; enter bank 1
clrf PIE1 ; disable peripheral interrupts
bcf STATUS,RP0 ; bank 0
MOVLF H'04',CCP1CON ; capture falling edge
bsf T1CON,TMR1ON ; start timer
cap btfss PIR1,CCP1IF
goto cap
MOVFF CCPR1H,FALLTIMEH ; move captured time (high byte)
MOVFF CCPR1L,FALLTIMEL ; move captured time (low byte)
bcf PIR1,CCP1IF ; clear flag
MOVLF H'05',CCP1CON ; capture rising edge
bcf PIR1,CCP1IF ; safety clear, avoid false interrupt
cap1 btfss PIR1,CCP1IF
goto cap1
MOVFF CCPR1H,RISETIMEH
MOVFF CCPR1L,RISETIMEL
bcf PIR1,CCP1IF
clrf CCP1CON ; CCP module is off
clrf T1CON ; stop timer1
movf FALLTIMEH,W ; move rise time (high) to W register
subwf RISETIMEH,F ; subtract high bytes and store in F
register
movf FALLTIMEL,W ; move rise time to W register
subwf RISETIMEL,F ; subtract low bytes and store in F
register
btfss STATUS,C ; if a borrow occured then decrement
decf RISETIMEH,F ; decrement if borrow occured
nop ; cushion
nop ; cushion
btfsc RISETIMEH,6
call FUEL_SPARK
btfss RISETIMEH,6
goto start
last nop
return
FUELMASS
clrf INTCON ;disable interupts
MOVLF B'01000001',ADCON0 ; select analog input on PORTA, bit 0
MOVLF 15,CHARGETIME ;
keep decfsz CHARGETIME,F
goto keep
bsf ADCON0,GO_DONE ; stored in ADRESL and ADRESH
DELAY
btfsc ADCON0,GO_DONE ; tests if conversion is complete
i.e
GO_DONE (O or 1?)
goto DELAY ; repeat above test if GO_DONE = 1
bsf STATUS,RP0 ; bank 1
movf ADRESL,W
bcf STATUS,RP0
movwf MAPREGL ;load adresl into mapregl
movf ADRESH,W
movwf MAPREGH ;load adresh into mapregh
MOVFF MAPREGL,AARGB1 ; move
MOVFF MAPREGH,AARGB0 ; move
MOVLF B'01101111',BARGB1 ; store 111 for slope
MOVLF 0,BARGB0 ; store 111 for slope
call FXM1616U ; 32 bit output, AARGB0 is empty
MOVLF B'00100000',Y1INT3 ; move 135200
MOVLF B'00010000',Y1INT2 ; move 135200
MOVLF B'00000010',Y1INT1 ; move 135200
movf AARGB1,W ; subract (straight line equation)
subwf Y1INT1,F ; result stored in Y1INT1
movf AARGB2,W
subwf Y1INT2,F
btfss STATUS,C
decf Y1INT1,F
bsf STATUS,C ; fix
movf AARGB3,W
subwf Y1INT3,F
btfss STATUS,C
decf Y1INT2,F
MOVLF 0,AARGB0
MOVFF Y1INT1,AARGB1
MOVFF Y1INT2,AARGB2
MOVFF Y1INT3,AARGB3
MOVLF B'00000001',BARGB0 ; move 300
MOVLF B'00101100',BARGB1 ; move 300
call FXD3216U ; call math, 16 bit output
MOVFF AARGB3,AARGB1
MOVFF AARGB2,AARGB0
MOVLF 150,BARGB1
MOVLF 0,BARGB0
call FXM1616U ; 32 bit output
MOVLF B'00011111',BARGB1 ; store 287
MOVLF B'00000001',BARGB0 ; store 287
call FXD3216U ; 8 bit out put
MOVFF AARGB3,AARGB1
MOVFF AARGB2,AARGB0
MOVLF 0,BARGB0
MOVLF 14,BARGB1
call FXD1616U
MOVFF AARGB1,FMASS
MOVFF REMB1,AARGB1
MOVLF 0,AARGB0
MOVLF 10,BARGB1
MOVLF 0,BARGB0
call FXM1616U ; 32 bit output
MOVFF AARGB3,AARGB1 ; maximum is 13*10 = 130
MOVFF AARGB2,AARGB0 ; 0 here always
MOVLF 14,BARGB1
MOVLF 0,BARGB0
call FXD1616U ; 16 bit output, whole number value for
remainder
MOVLF 50,BARGB1
MOVLF 0,BARGB0
call FXM1616U ; 32 bit output, max value is 450 in
AARGB2,
AARGB3
MOVFF AARGB3,ADDL ; to be added to timer
MOVFF AARGB2,ADDH ; to be added to timer
MOVFF FMASS,AARGB1
MOVLF 0,AARGB0
MOVFF Y3INT1,BARGB1 ; rich/lean value
PWVALUE
MOVLF 255,TIMERH ;calculating of values
MOVLF 255,TIMERL
movf Y2INT0,W
subwf TIMERH,F
movf Y2INT1,W
subwf TIMERL,F
btfss STATUS,C
decf TIMERH,F
clrf TMR1H
clrf TMR1L
MOVFF TIMERH,TMR1H ;loading of values
MOVFF TIMERL,TMR1L
return
;;;;;;;;;;;;;;;;;;;; This subroutine determines fuel amount correction from driver controls ;;;;;;;;;;
RICHLEAN
clrf INTCON ; disable global interrupts
MOVLF B'01001001',ADCON0 ; select bit 1 of PORTA
MOVLF 15,CHARGETIME ; capacitor chargetime
keep1 decfsz CHARGETIME,F
goto keep1
bsf ADCON0,GO_DONE ; stored in ADRESL and ADRESH
DELAY1
btfsc ADCON0,GO_DONE ; tests if conversion is complete
i.e
GO_DONE (O or 1?)
goto DELAY1 ; repeat above test if GO_DONE = 1
bsf STATUS,RP0 ; bank 1
movf ADRESL,W
bcf STATUS,RP0
movwf RLREGL
movf ADRESH,W
movwf RLREGH
MOVFF RLREGH,AARGB0
MOVFF RLREGL,AARGB1
MOVLF 0,BARGB0
MOVLF 5,BARGB1
call FXM1616U
MOVFF AARGB3,AARGB1
MOVFF AARGB2,AARGB0
MOVLF 10,BARGB1
MOVLF 0,BARGB0
call FXD1616U ; 16 bit output AARGB0 and AARGB1
MOVLF B'10111101',Y3INT1 ; move 701 (y-intercept)
MOVLF B'00000010',Y3INT0 ; move 701 (y-intercept)
movf AARGB1,W
addwf Y3INT1,F
movf AARGB0,W
btfsc STATUS,C
incfsz AARGB0,W
addwf Y3INT0,F
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IntService
movwf W_TEMP ; Copy W to RAM, set aside W and STATUS
swapf STATUS,W ; Move STATUS to W without affecting Z bit
movwf STATUS_TEMP ; Copy to RAM (with nibbles swapped)
Poll
btfsc PIR1,TMR2IF ; Don't call Timer2 if interrupt hasn't occured,
call
bcf PIR1,TMR2IF ; Timer2 if interrupt has occured (i.e clear
interrupt flag)
Project Sponsors
Yard Apes Parker Medical
Landscaping
CFR Welding