The second most important milestone was achieved with the invention of steam engines. Vehicles now can be driven automatically. Followed by steam engines invention of the Internal Combustion engine happened. These engines are used to convert potential energy in the form of water/heat or petrol into mechanical energy which is then transferred to wheels to move vehicles faster. In recent times there is an increased demand for vehicle safety, environmental concerns and intelligent control. Software were also introduced into vehicles to control mechanical aspects more accurately, and Electrical engines are invented to address environmental concerns. Even though we have come across a long way of invention but still there is plenty of room available for improvement as new challenges are coming across. Therefore, it is essential to understand what the vehicle is constituted of and how it will behave provided different scenarios in the outer environment.
Analysis of Vehicle dynamic response requires implementing vehicles' different subsystems in the form of mathematical representation to understand different forces acting on vehicles. As these mathematical representations are quite complex, we need a tool where we can implement these equations easily and simulate them in a faster way. There are different simulators available that can help us to achieve the same.
Along with the above benefits, MATLAB also has advanced toolboxes to understand this topic in further details.
Keywords: Vehicle Dynamics, state space, Bicycle Model, Ackerman’s criteria, OEM, ADAS, Understeer gradient.
Knowledge of vehicle dynamics is helpful to peruse a carrier in the tire, suspension, braking and transmission design. In the Automotive industry to develop ADAS applications. For example, Lane Keep Assist, Lane centering, Automatic cruise control and many more. So Engineering students from Computer science, electronics/electrical and mechanical branch & all those who are enthusiastic about the automotive industry can take this course.
Along with basic scripting knowledge of MATLAB and Simulink, introductory knowledge of linear algebra and planar geometry will be required to understand the topics throughout. Understanding and state space representation of equations will be described while discussing the demo for each subsystem.
We will start our first lesson by identifying the most important aspects which contribute to vehicles' behavior when it’s on the move. The below section will provide more regarding them. Before explaining the subsystems of vehicles, let us understand a few terminologies involved in vehicles' motion.
Since vehicles can travel either to the left or to the right study of motion along the Z-axis is not required to consider.
To simplify the mathematical models involved and describe concepts in their simplistic form we will focus on subsystems that are applicable to both commercial and passenger vehicles. From a broader perspective, the performance of a vehicle can be affected due to 7 different subsystems,
Figure 1: Vehicle Dynamics Subsystems
To understand the need for lateral dynamics let us take an example, that car is traveling on a circular road.
The force vector shown on the line of the circle can be separated into two components, one component normal to X-Axis and another along the X-axis. The amount of force along the X-axis will be responsible to pull the vehicle towards the center of the circle. Because of which driver will feel that vehicle is going outside of the road. This phenomenon was first observed in the 17th century and a study for Vehicles traveling on the circular road with constant velocity and constant steering was started. To prevent the vehicle from going out of the road, an equal amount of force is needed which will push the vehicle outwards, called centrifugal force.
This behavior in which it appears like the vehicle is going to leave the road due to less steering is called understeering. In a similar way, the oversteering phenomenon can be observed. The output of the lateral or steering subsystem decides how the vehicle will behave in the lateral direction, while in motion. The lateral dynamics of vehicles can be studied by building a kinematic model, by building meaning implementing geometric equations in MATLAB. To understand these kinematic equations we will be referring to planar geometry, where we consider vehicle motion in the (X, Y) axis.
Even if take passenger vehicle, which has 4 wheels, components involved in modeling 4 wheels are complex as the four different delta angles of wheels and their dimensions will have an impact.
Figure 2: Ackerman Criteria for Steering Angle
So, to make the initial study simpler we will make a few assumptions.
With this assumption, we can combine the left and right parts and consider that the vehicle has only two wheels one on the front side and another at the back.
This model is called a bicycle model as it looks like a bicycle. And as we can observe the complexity involved in the model is also reduced. The bicycle model has a “Two” degree of freedom (Y, ?). Where theta being angle with respect to Y-axis or Yaw of vehicle.
The assumption involved mainly considering both left-hand and right-hand side wheel takes same steering angle, hence represented with a single wheel. However, the steering angle provided to left- and right-hand side wheels are slightly different due to the radius they must cover.
As seen in the image, R corresponds to the radius to be covered resulting in the wheel angle delta provided using steering. Ackerman’s equations will help in analyzing scripted bicycle models on different curvatures. And length “a” is the length of the shaft from the center of gravity to the front wheel. “b” is the length of the driving shaft from the center of gravity to the rear wheel.
Just now we had introduced a subsystem of vehicles that affects the behavior of vehicles during lateral motion. Our second subsystem contributes in the longitudinal direction. As shown above, the longitudinal subsystem is made up of 3 parts.
The torque output performance of the engine can be studied using parameterized models and maps of thrust to exhaust for every paddle position on the accelerator proposed as outputs.
The engine serves as a vehicle's power source. Understanding of engine characteristics is tightly coupled with the transmission. In layman’s term engines are characterized by power it provides generated torque at different speed or throttle/accelerator position.
Torque= Generated power X Speed of vehicle
Also, to determine acceleration performance it is important to analyze the power/weight ratio of vehicles. Which can be determined by using Newton’s second law of motion. We shall study braking performance implementing the same law of motion.
Since vehicles may travel on a surface which is having a certain amount of slope. It is very important to ensure that the maximum amount of torque produced by the vehicle is transferred to the wheels. Gears were invented to satisfy this need. These parts having teeth are used to convert the rotational motion of the shaft to a translational one so that it can be provided to wheels. Gears are also used to change the direction of power distribution, which helps in driving a vehicle in the reverse direction.
Above are a couple of examples to understand the importance of transmission to move vehicles in the longitudinal direction. Now let us consider a case, where while traveling in turn vehicle’s outer wheel shall move faster than the inner wheel. It is because the outer wheel needs to travel more distance than the inner wheel as the radius of the curve is different.
To satisfy this constraint differential torque distribution is used by the Transmission unit. We will study how gears help in providing different torque to wheels on each side to meet this demand. This differential torque distribution can be demonstrated using the Simulink Simscape product from the MATLAB family of work products. The image is shown here, enlists a few block sets involved in modeling.
Figure 3: Simscape/Fundamental Blockset
As the basic requirements are satisfied with lateral and longitudinal dynamics. The third subsystem focuses on the comfort provided to passengers while moving. Vehicle suspension functionality is to support the body of the vehicle over its chassis. In mechanical terms suspension of a vehicle helps in defining vehicle Ride, Roll and handling. The vehicle is categorized as good or bad comfort based on two aspects. How easy the vehicle is to steer; does it provide a comfortable acceleration and braking experience to the driver.
For example, consider the vehicle is traveling at a speed of 100kph speed. And the driver applies the brake. Now due to inertia, if the vehicle stops very aggressively then it might give an uncomfortable experience to passengers sitting inside, meanwhile, it is also important to stop the vehicle at a minimum distance as possible.
To increase rolling capacity one of the mechanical methods used is “Anti Roll Bar”.
Steering Step Response or vehicle Cornering test is used where the vehicle is driven at different high speeds and the steering wheel is rotated suddenly in one direction to check if the vehicle left the ground.
This series will focus on modeling active and passive suspension models and their differences.
Newton's first law states that if a body is at rest or moving at a constant speed in a straight line, it will remain at rest or keep moving in a straight line at constant speed unless it is acted upon by a force. And as tires are the point of contact to this physical world, we shall study all resultant forces acting on tires, as they will contribute the most in the direction of motion of the vehicle. Study of tire model includes,
Tires face friction with the road. And as the tire pressure inside it is not uniformly distributed, the displacement of each tire shall differ under similar circumstances. Tire modeling simply corresponds to an in-depth study of lateral and longitudinal forces acting upon the wheel when the vehicle is on move.
Parameters such as tire width, thread design, vehicle load on the tire define how tire behavior will be. One such parament thread design and its effect are explained below. Lateral Displacement:
Due to this behavior of pressure inside of the tire and its threaded manufacturing, the tire builds up with lateral force tire heads in an angle different than the angle at which the vehicle is leading. This difference in angle is called “Slip Angle”. This slip angle is shown as alpha in the image above.
A good chassis design contributes to vehicles safety by absorbing forces during accidents. It is very important that drivers or passengers’ compartments in vehicles shall stay intent during the crash to protect them. Although from a manufacturing perspective there can be more aspects to look after, here in the study of dynamics, we enlist a few parameters of the vehicle which are defined by vehicle chassis.
Vehicle Length, vehicle width, front overhang, rear overhang, Front and rear axle center, the mass of vehicle etc. Front Over Hand is a distance from the front axle center to the front tip of the vehicle and the same for the rear overhand on the rear side.
Figure 4: Vehicle Parameters for Dynamic Modelling
To analyze the effects of different forces on vehicles on the move it is important to understand the road model. In newtons words, the road model represents forces that the vehicle shall come across to move forward with the desired speed. These forces can be classified as
Therefore, Force produced by transmission of vehicle > Air drag + Friction force for the vehicle to move in the forward direction. In upcoming blogs, we can model the road dynamics and determine the amount of acceleration required scripting these equations in MATLAB.
Figure 5: Different Road Surfaces
To conclude our analysis we continue programming these subsystems in MATLAB, we also need to verify the results we obtain to confirm the model efficiency and our understanding including assumptions we will make. As these prepared dynamics models fall into two categories,
To validate mathematical representations writing a script to control the input variables such as desired vehicle speed or curvature will help. The flow of calling “.m” files is mentioned below:
Understanding and design of vehicle model help in verification if the algorithm follows the kinematics constraint in order to make the driving experience safer and comfortable.
The second approach, the Simulink models can be validated using different inputs. One such example is to use different drive cycles to analyze the behavior of vehicles. Drive cycles contain different velocity points with respect to time. If the velocity change with respect to time is called “Modal Drive cycles”. We can conclude our analysis by observing the model’s response to these drive cycles.
Hi friends, how are you doing? Today will integrate all of what we have learned so far in this series to build the first project based on ladder logic programming. Because we all are interested in industry, we pick one industrial project, Bottle Filling and Capping Projects, which is very common today. The problem we are going to solve today is bottle filling and capping. We have learned all basics of ladder logic including contacts and coils operation, logic gates, rising and falling edges, timers, and counters. So, today we will utilize all of these components to implement a complete ladder program of filling and capping problems.
For simplifying the operation of the process of filling and capping, fig. 1 shows the process flow which simply contains the main motor that drives the conveyor belt on which the bottles are running starting by hitting the start button. The conveyor belt starts running driven by motor M1 and the bottles move until sensor S2 detects one bottle, then motor M1 stops and the belt does so. At the same time, valve V1 opens to let water get dropped into the bottle until it reaches specific level thanks to level sensor S1. Then valve V1 closes and motor M1 goes on moving. Then when sensor S3 sees a bottle, the piston P1 is activated for capping the bottle and so on.
Fig. 1. The Filling and Capping Process
As you can see, for every single process in the industry, there are inputs and outputs. The inputs represent the sensors and user requests like starting and stopping the process. While the outputs are represented by actuators like motors, valves, and pistons. Table 1 lists the inputs and outputs of the filling and capping process. It shows the process consists of four inputs and three outputs including the function and description of each item.
Table 1: The list of Inputs and outputs of the Process
Before going to ladder programming, we should design the logic of the operation to build guidelines on which we can develop the ladder logic. According to the operation description we stated aforementioned above, we can express the logic in lines as follows:
As you see in these few lines, we just wrote the philosophy of the filling and capping process’s logic. And the process keeps repeating until user requests stop. So now let’s move to convert this written logic into ladder logic rungs and enjoy for sure simulating the process in our lab to verify the logic we designed is correct or we need to amend.
Before getting starting the filling and capping programming, we need to design the list of inputs and outputs of the program and their initial states. Table 2 shows a list of the inputs and outputs with their addresses and initial states.
Table 2: The Inputs and Outputs list with Addresses and Initial States
Figure 2 shows the first network in the designed ladder program. My friends, do not feel it a complicated because the fact is that, it is really simple. First of all, the start button to run the conveyor belt motor coil and latching is considered for letting the belt resumes running even after releasing the start button. Also, you should ask yourself during design two questions. The first is when the motor of the conveyor belt will be running and when to stop it? The answer to these two questions will end up with completing this network. For instance, the first question which inquiries about when to start the conveyor belt can show that the belt should be running by hitting the start push button to represent the request of the user to run the process. But, while the filling process is in progress marked by the activation of sensor S2, the conveyor should stop waiting for the filling process to complete by closing the valve when reaching the filling level limit noted by sensor S1. So, closing the valve is another signal that starts the conveyor once again. On the other hand, the conveyor belt should stop when the stop is requested by the operator in addition to sensor S2 that indicates a presence of a bottle in the filling station. So, you can notice two parallel branches to run the conveyor belt, one by start push button and one for latching. In addition, another parallel branch is added to run the belt by showing the completion of the filling process thanks to the signals of valve V1 status.
Fig. 2: Ladder Logic Network 1
Now, let’s have a look at the valve and ask ourselves the same question as what we have done with the motor of the conveyor belt (M1). what makes the valve V1 get closed and what causes it to open? For those causes to open the valve are the signal of sensor S1 that tells the bottle that is being filled is already filled and all set to move to cap station in addition to the latching consideration. So, we have two parallel branches, one branch for the sensor S1 and the other one from the valve status contact for latching. Those parrel branches connected in series to show “AND” logic with the sensor S2 to make sure of the presence of a bottle in the filling station. On the other hand, the stop push button represents an ending request received at any time from the user to close the valve.
Fig. 3: Ladder logic network 2
Now, the process goes on and the bottle has just left the filling station and has reached to capping station. That has been recognized thanks to sensor S3 that detects a bottle that has just arrived at the capping station. As a result, the piston should be activated. Firstly, a timer has been utilized to let the piston activated for some amount of time that is enough to let the capping process be comfortably completed. So, in-network 3 shown in fig. 4, a timer which is of off-delay type is utilized to activate the capping piston for plenty of time to let the capping process be completed as shown in fig. 5.
Fig. 4: Ladder Logic Network 3
Fig. 5: Ladder Logic Network 4
And finally, in-network 5 shown in fig.6, the falling edge signal of the piston denotes the completion of the capping process. So, a counter which is of type count-up timer is triggered to count up to determine the number of the processed bottle so far. The preset value has been set to a specific value i.e. 100 which can be used to perform maintenance or end a batch process for 100 bottles to be filled and capped.
Fig. 6: Ladder Logic Network 5
After translating the writing logic to a ladder program that is composed of a couple of rungs, the second compulsory step is to verify the syntax of the ladder program and make sure that the program is free of error. So, we show you in fig. 7 the compilation results to show there is no error with the written code so far. By doing this verification, we are all set now to upload the program to the controller and check the logic and operations.
Fig. 7: Compiling the Designed Ladder Logic Program
It is time to go to our lab and open the simulator to check the design and written ladder code. Figure 8 shows the initial state of the program before starting the process. It is clear that the conveyor belt is stopped and the status of all sensors, pushbuttons, actuators are as their aforementioned initial states.
Fig. 8: Initial State of the Inputs and Outputs Before Starting the Process
Now, let’s hit the start push button to start the process and watch what is going on. Figure 9 shows good news!!! By hitting the start button, the process correctly started and the motor M1 that drives the conveyor belt starts spinning. But, how about checking to release the start pushbutton by leaving our hand to see what’s going on?
Fig. 9: The status After Hitting Start the Process
WoW!!, well done, latching is working as shown in fig. 10 as the conveyor continues spinning even after releasing the start button thanks to applying the latching technique.
Fig. 10: Conveyor Still Running Even after Release start Push Button Thanks to Latching
Once a bottle is presented at the filling station, sensor S2 is activated. Consequently, the conveyor stops waiting for the filling process to complete. But, when does the filling process ended and how to know it’s done already to go further?
Fig. 11: Conveyor Stops when a Bottle Presents at S2 for Filling
Well! Sensor S1 is there to watch the level to which the liquid reaches in the bottle that is being filled. Once the limit is reached, sensor S1 is activated telling hey here we go, the filling process is over and now we ready to go further to the next step which is the capping station as shown in fig. 12.
Fig. 12: The Valve is Closed by reaching the Limit Level and S1 is ON
Because the valve is closed after the filling limit is reached, the conveyor continues spinning and sensor S2 is deactivated showing the bottle has been filled and left the filling station. However, the conveyor belt keeps running thanks to the latch again as shown in Fig. 12.
Fig. 13: The Conveyor belt Goes Running by Closing The Valve V1
Let’s now my friends check what’s happening by reaching the capping station? Astonishing !!! as we put there our agent to tell us a bottle has arrived for capping which is sensor S3, once that happened, sensor S3 is activated and hence activates the piston to retract and keep retracted for a sufficient amount of time to let the capping process be completed thanks to using a timer of type off-delay timer. So first fig. 14 shows in network number 3, the timer is activated and starts counting the time that is preset to 2 seconds and in the same time activates the piston to keep retracted during that time based on the nature of operation of an off-delay timer.
Fig. 14: The Piston is Activated by Reaching at Capping station When S3 is ON
And finally, the counter is utilized to count the processed bottles which are triggered by the falling edge of the piston denoting completion of a filling and capping process.
Fig. 15: The Counter Counts up Every item After the Capping Process
By reaching this line in our tutorial, I would like to congratulate you that you are now all set to think about complete basic problems in the industry and design the logic to solve them and write the ladder code. Is here the end station of our ladder logic tutorial? For sure no, we still have a lot to move forward from the basic level to become experts. So wait for the next tutorial in which we go deeply into details of math and logic functions and data processing.