Abs Project Report
Abs Project Report
Represented by:
Omneya Haytham Mohamed Ezz Eldin 7717
Basma Ayman Mahmoud 7408
Abdelrahman Moataz Noureldin 7714
Mechatronics
Faculty of Engineering Alexandria University Mechatronics
6
5- Mechatronics Design Process
8
5.1. Requirements
8
5.2. Electromechanical Design
9
5.2.1. Mechanical Design
9
5.2.2. Electrical Design
11
5.3. Software
14
5.3.1. Flow Chart:
14
5.3.2. code
16
5.4. Modeling and simulation
28
6- Final Product
38
7- Challenges
39
8- Conclusion:
39
[1]
Faculty of Engineering Alexandria University Mechatronics
1. OVERVIWE:
A brake is one of the most important parts of any type of vehicle. Brakes are used to
stope the wheel of the vehicle.
Here kinetic energy transferred to Heat energy. The kinetic energy increases with
the square of velocity.
1
𝐾. 𝐸 = 𝑚 𝑣 2
2
An anti-lock braking system (ABS) is a safety system that allows the wheels on a
motor vehicle to continue interacting tractively with the road surface as directed by
driver steering inputs while braking, preventing the wheels from locking up and
therefore avoid skidding.
On slippery surfaces, even professional drivers can’t stop the car without ABS as
quickly as an average driver can with ABS.
Advantages of ABS:
▪ Improve vehicle control.
▪ Allow steering while braking.
▪ Decrease stopping distance on dry and slippery surface.
Since initial widespread use in production cars, anti-lock braking systems have
evolved considerably. Recent versions not only prevent wheel lock under braking,
but also electronically control the front-to-rear brake bias.
[2]
Faculty of Engineering Alexandria University Mechatronics
2. History:
Early Systems:
In 1929, the ABS was first developed for Aircrafts by the French automobile and
aircraft pioneer, Gabriel Voisin, as threshold braking on airplanes is nearly
impossible.
In 1950s, an early system was Dunlop’s Maxaret system, and still in use in some
aircraft models.
These systems use a flywheel and valve attached to a hydraulic line that feeds the
brake cylinders.
In normal braking the drum and flywheel should spin at same speed , however, if a
wheel were to slow down, then the drum would do the same, leaving the flywheel
spinning at a faster rate. This causes the valve to open, allowing a small amount of
brake fluid to bypass the master cylinder into a local reservoir, lowering the pressure
on the cylinder and releasing the brakes.
The use of the drum and flywheel meant the valve only opened when the wheel is
turning.
In 1958, a Royal Enfield Super Meteor motorcycle was used by the Road Research
Laboratory to test the Maxaret anti-lock brake.
The experiments demonstrated that anti-lock brakes can be of great value to
motorcycles, for which skidding is involved in a high proportion of accidents.
In 1960, The first fully electronic anti-lock braking system was developed for the
Concorde aircraft.
[3]
Faculty of Engineering Alexandria University Mechatronics
Modern Systems:
In 1971,
1. The modern ABS system was invented by Mario Palazzetti (known as 'Mister
ABS') in the Fiat Research Centre.
2. General Motors introduced the “Trackmaster” rear-wheel only ABS as an
option on their Rear-wheel drive Candillac models.
3. Nissan offered am EAL (Electro Anti-lock System) as an option on the Nissan
President, which became Japan’s first electronic ABS.
In 1992, Homda followed suit with the launch of its first motorcycle ABS on the
ST1100 Pan European.
Figure 2.1
[4]
Faculty of Engineering Alexandria University Mechatronics
3. How it works:
The anti-lock brake controller is also known as the CAB (Controller Anti-lock
Brake).
▪ WHAT IT DOES
anti-lock brakes help you steer as you brake during an emergency.
Figure 3.1
Figure 3.2
Figure 3.3
[5]
Faculty of Engineering Alexandria University Mechatronics
The reason ABS results in faster braking compared to just applying the brakes is due
to the relationship between the slip ratio and the coefficient of friction. The slip ratio
is means of calculating the slipping behavior of the wheel. It is defined as:
𝑉 − 𝜔𝑅
𝜆=
𝑉
Where:
• λ : The slip ratio
• V : Translation vehicle velocity in m/s
• ω : Angular wheel velocity at point of contact with road in rad/s
• R : Radius of the tire
When the slip ratio is equal to zero, the translational velocity of the vehicle is equal
to the angular velocity of the wheel. This results in no slip and is the condition of
rolling. The car is in complete control of the wheel and therefore will respond to
changes in direction easily. Pure rolling.
When the slip ratio is equal to one, this means that the angular velocity of the wheel
is equal to zero, meaning that the wheel has stopped rolling. This results in the
wheels to only be slipping and so the car is skidding, losing all control of the vehicle
until it comes to a complete halt. Pure sliding.
Figure 4.1
[6]
Faculty of Engineering Alexandria University Mechatronics
The slip ratio relationship with the coefficient of friction can be seen in the following
graph:
Figure 4.2
As can be seen here, the coefficient of friction is not at its highest when the wheels
are locked and stopped rolling (λ = 1), but when it close to pure rolling. Although
the coefficient of friction varies significantly with change in road/tire materials, the
trend stated above still follows.
This relationship is very important because it ticks off 2 of the objectives of the ABS,
which are to stop the car earlier, and for the driver to have control of the car while
braking.
This is the case because a high coefficient of friction results in higher braking force,
causing higher deceleration and therefore the car comes to rest faster.
The high coefficient of friction also coincides with the slip ratio being close to pure
rolling. The closer the slip ratio is to pure rolling, the more control the driver has on
steering and changing direction of the car.
[7]
Faculty of Engineering Alexandria University Mechatronics
5.1. Requirements:
[8]
Faculty of Engineering Alexandria University Mechatronics
5.1.1.Mechanical Design:
[9]
Faculty of Engineering Alexandria University Mechatronics
[10]
Faculty of Engineering Alexandria University Mechatronics
▪ 4 RC Wheel with two dc motor in the back wheels of car and two
free wheels in front of car.
▪ Two gripper mechanisms that brake the front wheels.
▪ 3 velocity sensors are used.
5.1.2.Electrical Design:
Our circuit design:
[11]
Faculty of Engineering Alexandria University Mechatronics
(5) Battery
▪ power supply of car.
▪ 12v for motor.
[13]
Faculty of Engineering Alexandria University Mechatronics
5.3. Software:
5.3.1.Flow Chart:
System:
[14]
Faculty of Engineering Alexandria University Mechatronics
Braking Process:
[15]
Faculty of Engineering Alexandria University Mechatronics
5.3.2.Code:
ARDUINO:
#include <Servo.h>
//
##################################################################
## OBJECTS AND DEFINITIONS
##################################################################
##
// ######### OUTPUT PINS #########
// Servos
#define LEFT_BRAKE 4
#define RIGHT_BRAKE 5
// Braking mode indication LEDs
#define RGB_MODE_BLUE 12
#define RGB_MODE_GREEN 13
// Motor driver
#define IN1 7
#define IN2 8
#define IN3 9
#define IN4 10
#define EN1 6 // PWM
#define EN2 11 // PWM
#define LEFT_CLOSED 0
#define RIGHT_OPEN 100
#define RIGHT_CLOSED 0
// Brake mode
#define MANUAL 1
#define ABS 0
// Constants
#define PI 3.1415926535
#define WHEEL_DIAMETER 65.0 // in mm (changed to add decimal point)
#define NUMBER_OF_SLITS 20.0 // number of slits of encoder wheel (because
we interrupt on change, we double the number of slits)
#define WHEEL_SENSOR_NUM 3
// Time variables
unsigned long current;
unsigned long last = 0;
// Interrupt variables
volatile unsigned int left_wheel_steps = 0;
volatile unsigned int right_wheel_steps = 0;
volatile unsigned int back_wheels_steps = 0;
[17]
Faculty of Engineering Alexandria University Mechatronics
// Calculation variables
double slip_ratio = 0;
double vehicle_velocity = 0;
double left_wheel_velocity = 0;
double right_wheel_velocity = 0;
enum direction {
STOP,
FORWARD,
BACKWARD,
LEFT,
RIGHT
};
//
##################################################################
## SETUP AND LOOP
##################################################################
######
void setup() {
// Servo pins
leftBrake.attach(LEFT_BRAKE);
rightBrake.attach(RIGHT_BRAKE);
pinMode(LEFT_BRAKE, OUTPUT);
pinMode(RIGHT_BRAKE, OUTPUT);
[18]
Faculty of Engineering Alexandria University Mechatronics
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
pinMode(EN1, OUTPUT);
pinMode(EN2, OUTPUT);
// Bluetooth
Serial.begin(9600); // Default communication rate of the Bluetooth module
// Interrupts
// Hardware interrupts
attachInterrupt(digitalPinToInterrupt(LEFT_WHEEL), leftIncrement,
CHANGE);
attachInterrupt(digitalPinToInterrupt(RIGHT_WHEEL), rightIncrement,
CHANGE);
// Pin change interrupt
PCICR |= B00000010; // Pin Change Interrupt Control Register, setting bit 1
means we enabled port C interrupt
PCMSK1 |= B00000010; // Pin Change Mask 1 -> We are enabling pin A1 to
activate the PORT C ISR
void loop() {
if (Serial.available() > 0) { // Checks whether data is coming from the serial port
command = Serial.readStringUntil('\n'); // Reads the data from the serial
port
[19]
Faculty of Engineering Alexandria University Mechatronics
}
carMode(command);
//Serial.print(command);
command = ""; // reset the command, wait until new command given
// After executing command, check for connection to computer
// If not connected, reset the system and then wait for reconnection
// if (!connectionEstablished()) {
//systemReset();
//while (!connectionEstablished());
//}
}
//
##################################################################
## FUNCTION DEFINITIONS
##################################################################
#####
/*long mapf(long x, long in_min, long in_max, long out_min, long out_max) {
return (x - in_min) * (out_max - out_min) * 1.0 / (in_max - in_min) * 1.0 +
out_min * 1.0;
}*/
// ############ BRAKES FUNCTIONS ###############
// Interrupt ISRs
void leftIncrement(){
left_wheel_steps++;
}
void rightIncrement(){
right_wheel_steps++;
}
ISR(PCINT1_vect){
back_wheels_steps++;
}
// Speed is updated every 20ms, testing will show if this is too slow
void calculateSpeed(int wheel_sensed, double* wheel_velocity){
// Time variables
[20]
Faculty of Engineering Alexandria University Mechatronics
// Step variables
static unsigned long steps[WHEEL_SENSOR_NUM] = {0};
static unsigned long steps_old[WHEEL_SENSOR_NUM] = {0};
unsigned long diff;
int index;
case RIGHT_WHEEL:
index = 1;
break;
case BACK_WHEELS:
index = 2;
break;
default:
index = 0;
break;
}
[21]
Faculty of Engineering Alexandria University Mechatronics
// make the 20ms delay only occur at state change not everytime function is called
void brakes(int state) {
if (state) {
leftBrake.write(LEFT_CLOSED);
rightBrake.write(RIGHT_CLOSED);
//delay(20);
}
else {
leftBrake.write(LEFT_OPEN);
rightBrake.write(RIGHT_OPEN);
//delay(20);
}
}
void ABS_FUNC() {
slip_ratio = 1 - (left_wheel_velocity / vehicle_velocity);
if (slip_ratio < 0.1)
brakes(CLOSED);
else if (slip_ratio > 0.3)
brakes(OPEN);
}
// Try to only call the digitalWrite functions once during mode change
void brakeControl() {
switch (brake_mode) {
case MANUAL: // Manual mode. Engaged when brake button is pressed,
disengages when brake button is released
if (brake_command == "B")
brakes(CLOSED);
else
[22]
Faculty of Engineering Alexandria University Mechatronics
brakes(OPEN);
break;
case ABS: // ABS mode. When brake is pressed, uses ABS to prevent the wheel
from locking during travel
if (brake_command == "B")
ABS_FUNC();
else
brakes(OPEN);
break;
default:
break;
}
}
case FORWARD:
analogWrite(EN1, speed);
analogWrite(EN2, speed);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
[23]
Faculty of Engineering Alexandria University Mechatronics
case BACKWARD:
analogWrite(EN1, speed);
analogWrite(EN2, speed);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
break;
case LEFT:
analogWrite(EN1, speed);
analogWrite(EN2, speed);
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case RIGHT:
analogWrite(EN1, speed);
analogWrite(EN2, speed);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
default:
break;
}
}
[24]
Faculty of Engineering Alexandria University Mechatronics
carControl(STOP, 0);
}
[25]
Faculty of Engineering Alexandria University Mechatronics
last = current;
}
// Stops the vehicle early at low speeds OR when it is commanded to stop
if (brake_command == "s")
break;
}
brake_command = "";
brakes(OPEN);
carControl(STOP, 0); // after braking loop ends, make sure to send LOW
signal to all motor drive pins
}
}
int connectionEstablished() {
return digitalRead(STATE);
}
[26]
Faculty of Engineering Alexandria University Mechatronics
[27]
Faculty of Engineering Alexandria University Mechatronics
The presented model simulates the dynamic behavior of the vehicle under the
certain situation of hard braking and represents a single wheel.
Moreover, the model contains another model which is used for the vehicle’s wheel
speed calculation. Before the hard braking, the vehicle has a speed that
corresponds to the initial angular speed of the vehicle’s wheels.
Slip is zero when wheel speed and vehicle speed are equal, and slip equals one
when the wheel is locked.
A desirable slip value is 0.2. This means that the number of wheel revolutions
equals 0.8 times the number of revolutions under non-braking conditions with the
same vehicle velocity, resulting in maximization of the adhesion between the tire
and road.
Relative slip:
is the relative motion between the vehicle’s tire and the road surface where the
vehicle is moving on.
we set the desired slip to the value of slip at which the mu-slip curve reaches a
peak value, this being the optimum value for minimum braking distance.
Ctrl:
A variable. This disconnects the slip feedback from the controller, resulting in
maximum braking.
Ff:
The frictional force acting on the circumference of the tire.
Ff is divided by the vehicle mass to produce the vehicle deceleration, which the
model integrates to obtain vehicle velocity.
Bang bang controller is a feedback controller that switches abruptly between two
states.
Moreover, the following types are useful for the model building.
[28]
Faculty of Engineering Alexandria University Mechatronics
Where:
▪ ωv=vehicle speed divided by wheel radius. This equals the wheel angular speed
if there is no slip Vv=vehicle linear velocity Rr=wheel radius
▪ ωw=wheel angular velocity
▪ m*g/4 =the weight on the one wheel, where m= the vehicle mass
The bang-bang controller takes as input signal the result subtraction of the actual
slip from the desired slip. Depending on the sign of the error, the result has the plus
[29]
Faculty of Engineering Alexandria University Mechatronics
1 or minus1. The plus sign represents the on state and the minus represents the off
state. This on/off rate passes through the Hydraulic Lag block, which represents
the delay that occurs in the hydraulic lines of the brake system.
The next block is about integration of the filtered rate, in order to have positive
speeds.
The output of the Brake pressure block is the actual brake pressure. This signal is
multiplied by the piston area and radius with respect to the wheel (Kf). The output
signal is the brake torque applied to the wheel. The input block 2 represents the
accelerating torque of the road surface on the wheel. The model subtracts this from
the brake torque. This results to the net torque on the wheel. Then the model
divides the net torque by the wheel rotational inertia I. The output signal is the
wheel acceleration. After its integration, the output signal is the wheel velocity.
The friction coefficient, mu, multiplied by the weight on the wheel, W, give as an
output the frictional force, Ff, acting on the circumference of the tire. Ff is divided
by the vehicle mass to produce the vehicle deceleration.
[30]
Faculty of Engineering Alexandria University Mechatronics
The removal of the stop block would indicate that one of the assumptions made in
the model was that the vehicle speed will never be zero.
The model multiplies the frictional force on the wheel by the wheel radius (Rr) to
give the accelerating torque of the road surface on the wheel, which is one of the
inputs signs to the Wheel Speed block. Then a bar gathers the outputs Wheel
Speed, Vehicle Speed and Stopping distance together.
This constitutes the input signal to the next block, which is used for the calculation
of the Actual Relative Slip. The u(1) is the angular velocity of the wheel and
(u(2) + u(2)==0)*eps is the velocity of the vehicle, according to the slip ratio
formula.
5.4.4.Experimental results:
The graph shows the vehicle angular velocity and corresponding wheel angular
velocity. The y axis (vertical) is referred to the speed(rad/sec) and the x axis
[31]
Faculty of Engineering Alexandria University Mechatronics
(horizontal) to the Time(sec). What you can see is that during the braking, the
wheel speed is below the vehicle speed, which is going to zero in 14,0069 seconds.
The graph is referred to the slip. The y axis (vertical) has the values of the
Normalized Relative Slip, and the x axis (horizontal) is referred to the Time(sec).
We observe successive oscillations in the slips.
[32]
Faculty of Engineering Alexandria University Mechatronics
The next diagram combines the Stopping distance and the Slip values. The value of
slip, which is visualized with the purple color, is low at each period of time during
the braking, as the ABS is turned on.
[33]
Faculty of Engineering Alexandria University Mechatronics
Now we want to study the vehicle behavior without ABS. In order to do this, we can
set the model variable ctrl = 0 at the command line of MATLAB. By setting this
variable, we achieve the disconnection of the slip feedback from the controller and
as a consequence the maximum possible braking. We leave the desired slip at the
value of 0.2, as follows.
this will model the braking without ABS. The results are shown in the next figures.
[34]
Faculty of Engineering Alexandria University Mechatronics
The maximum braking described, is obvious observing the sharp decrease of the
blue curve represented in the figure of Vehicle speed and wheel speed above. The
wheel speed, according to the red curve, stays equal to zero at 6.86093 second, which
means that the wheels are blocked. The braking after that point,
is applied in a less than optimal part of slip curve. That is, when slip equals unit, as
the slip plot shows, the tire is skidding so much on the pavement that the friction
force has dropped off.
[35]
Faculty of Engineering Alexandria University Mechatronics
The plot below shows the distance traveled by the vehicle for the two cases, the hard
braking with (Purple curve) or without ABS (Red curve).
An interesting observation is that without ABS, the vehicle skids about an extra 100
feet, taking about three seconds longer to come to a stop.
The plot below shows the vehicle speed for the two cases, the hard braking with or
without ABS. The blue curve represents the vehicle speed with ABS and the red is
about the case without ABS.
[36]
Faculty of Engineering Alexandria University Mechatronics
[37]
Faculty of Engineering Alexandria University Mechatronics
[38]
Faculty of Engineering Alexandria University Mechatronics
6. Challenges:
7. Conclusion:
ABS has been so far developed to a system, which provides rapid, automatic braking
in response to signs of incipient wheel locking by alternatively increasing and
decreasing hydraulic pressure in the brake line Statistics show that approximately 40
% of automobile accidents are due to skidding. These problems commonly occur on
vehicle with conventional brake system which can be avoided by adding devices
called ABS If there is an ABS failure, the system will revert to normal brake
operation. Normally the ABS warning light will turn on and let the driver know there
is a fault.
[39]