Simulink for Mechanical & Electrical Engineers - Challenges Final Project
- Aim
- To study, analyze and make a detailed report on BAJA All Terrain Vehicle (ATV) model using Simulink & compare between its different modes.
- Objective
- Prepare a technical report explaining the model properties & comments on the results.
- Theory
- All-terrain vehicle
- The ATV is commonly called a four-wheeler in Australia, New Zealand, South Africa, parts of Canada, India, and the United States. They are used extensively in agriculture, because of their speed and light footprint.
- An all-terrain vehicle (ATV), also known as a light utility vehicle (LUV),[1] a quad bike, or simply a quad, as defined by the American National Standards Institute (ANSI); is a vehicle that travels on low-pressure tires, with a seat that is straddled by the operator, along with handlebars for steering control. As the name implies, it is designed to handle a wider variety of terrain than most other vehicles. Although it is a street-legal vehicle in some countries, it is not street-legal within most states, territories, and provinces of Australia, the United States, or Canada.
- By the current ANSI definition, ATVs are intended for use by a single operator, although some companies have developed ATVs intended for use by the operator and one passenger. These ATVs are referred to as tandem ATVs.
- The rider sits on and operates these vehicles like a motorcycle, but the extra wheels give more stability at slower speeds. Although most are equipped with three or four wheels, six-wheel models exist for specialized applications. Multiple-user analogs with side-by-side seating are called utility terrain vehicles (UTVs) or side-by-sides to distinguish the classes of vehicles. Both classes tend to have similar powertrain parts.

- BAJA SAE
- Baja SAE is a Collegiate Design Series competition run by the Society of Automotive Engineers International (SAE International). Teams of students from universities all over the world design and build small off-road cars. The cars all have engines of the same specifications. As of 2018, the engine has been an unmodified Briggs & Stratton Model 19 Vanguard engine single-cylinder with a displacement of 305cc and a power output of approximately 10 bhp (7.5 kW).
- The goal in Baja SAE racing is to design, build and race off-road vehicles that can withstand the harshest elements of rough terrain. The vehicles used in Baja SAE racing are often similar in appearance to dune buggies. Before 2007, the events were called "Mini Baja."

- Simulink ATV Models
- BAJA ATV Model - cvtModel.slx (without dashboard)
- Following is the simulation model for BAJA ATV Model without the dashboard :

- In the above model the simulation blocks used & their purpose are as follows:
- Signal Builder – The Signal Builder block allows you to create interchangeable groups of piecewise linear signal sources and use them in a model.
- Goto – The Goto block passes its input to its corresponding From blocks. The input can be a real- or complex-valued signal or vector of any data type. From and Goto blocks allow you to pass a signal from one block to another without actually connecting them.
- Simulink PS Converter – Converts the Simulink input signal to a Physical Signal.
- Generic Engine – Represents a system-level model of spark-ignition and diesel engines suitable for use at the initial stages of modeling when only the basic parameters are available.
- Solver Configuration – The Solver Configuration block specifies the solver parameters that your model needs before you can begin the simulation.
- Mechanical Rotational Reference – The Mechanical Rotational Reference block represents a reference point, or frame, for all mechanical rotational ports.
- Engine Sensor – It’s a Subsystem model consist of the following simulation blocks & their purpose are as follows :
- Ideal Rotational Motion Sensor – The Ideal Rotational Motion Sensor block represents an ideal mechanical rotational motion sensor, that is, a device that converts an across variable measured between two mechanical rotational nodes into a control signal proportional to angular velocity or angle.
- Mechanical rotational Reference – The Mechanical Rotational Reference block represents a reference point, or frame, for all mechanical rotational ports.
- PS-Simulink Converter – Converts the input Physical Signal to a Simulink output signal.
- Scope – Display signals generated during simulation.
- PS terminator – Use this block to terminate physical signal outputs.
- CVT – It’s a Subsystem model consist of the following simulation blocks & their purpose are as follow:
- Inertial – The block represents an ideal mechanical rotational inertia.
- Ideal Rotational Motion Sensor – The Ideal Rotational Motion Sensor block represents an ideal mechanical rotational motion sensor, that is, a device that converts an across variable measured between two mechanical rotational nodes into a control signal proportional to angular velocity or angle.
- Mechanical rotational Reference – The Mechanical Rotational Reference block represents a reference point, or frame, for all mechanical rotational ports.
- PS-Simulink Converter – Converts the input Physical Signal to a Simulink output signal.
- Goto – The Goto block passes its input to its corresponding From blocks. The input can be a real- or complex-valued signal or vector of any data type. From and Goto blocks allow you to pass a signal from one block to another without actually connecting them.
- PS terminator – Use this block to terminate physical signal outputs.
- Variable Ratio Transmission – Represents a variable ratio gearbox such as implemented by mechanical belt CVT, electric, or hydraulic transmissions.
- Simple Gear – Represents a fixed-ratio gear or gearbox.
- Vehicle Body – CVT – It’s a Subsystem model consist of the following simulation blocks & their purpose are as follows -
- Inertia – The block represents an ideal mechanical rotational inertia.
- Double Shoe Brake – Represents a brake arranged as two pivoted rigid shoes symmetrically installed inside or outside a drum and operated by one actuator. The actuator force causes the shoes to exert friction torque on a shaft connected to the drum.
- Gain – Element-wise gain (y = K.*u) or matrix gain (y = K*u or y = u*K).
- Tyre – Represents the longitudinal behavior of a highway tire characterized by the tire Magic Formula.
- PS terminator – Use this block to terminate physical signal outputs.
- Vehicle Body – Represents a two-axle vehicle body in longitudinal motion. The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile.
- PS Constant – This block creates a physical signal constant:
- PS-Simulink Converter – Converts the input Physical Signal to a Simulink output signal.
- Integrator – The Integrator block outputs the value of the integral of its input signal with respect to the time.
- From – The From block accepts a signal from a corresponding Goto block, then passes it as output. The data type of the output is the same as that of the input from the Goto block. From and Goto blocks allow you to pass a signal from one block to another without actually connecting them.
- Scope – Display signals generated during simulation.
- Inputs for the Model
- Following are the variable inputs to the model.

- The variable m1, m2 stands for the mass input for the inertial at input shaft and output shaft at CVT Transmission system.
- The variables ‘speedVector’ & ‘torqueVector’ are the engine parameters for the Generic Engine, which provides us the relation between torque and rpm of the engine.
- Using Signal Builder block we have given throttle and brake input, and also the CVT ratio is changed with time.

- Workflow/Process of the Model
- The initial condition of the engine block is already set according to the engine parameters we have, and then according to the throttle input engine changes its parameters of speed, torque, and others. For this model, the engine parameters are provided by using the variables ‘speedVector’ & ‘torqueVector’.
- After getting the throttle input, it provides the rpm, torque, and various factors depending upon the engine parameters.
- The output from the Generic Engine is the pass through the engine sensor block where it records the rpm of the engine during the simulation,

and then it is forwarded towards the CVT Transmission.
- In the CVT block, it takes the two inputs one from the engine and another from the signal builder block which provides the CVT ratio.
- In the CVT block, there are two ideal rotational sensor blocks & two inertia blocks each for input and output shafts respectively, and then there is the Variable Ratio Gear which changes its gear ratio during the simulation according to the given CVT ratio.

- Now after the signal from the CVT block it passed through the simple gear block which we can say acts as a differential gearbox before passing to the vehicle body(tires).
- In the vehicle body block, it requires two inputs one from the engine which we get through the simple gear block and another is the brake input.

- Since our model is designed on basis of a TWD (Two Wheel Drive) vehicle, the input engine signal from the simple gear is provided to both rear wheels of the vehicle body.
- Since there will be rotational inertia of the shafts so it is then connected to the engine input signal before it reaches the tire.
- The other input brake is provided to the Double Shoe Brake block, but before it reaches there it passes through the gain block which we can say acts as an intensifier for the brake input, in short, its multiples the input force, in this scenario the gain factor is 1000.
- As the brakes are indirectly connected to the input power of wheels, hence the output from the double shoe brake block is connected to the engine input signal before it reaches the tire.
- Here there is another vehicle body block (inside the vehicle body block on the main system) which accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile, with the help of the vehicle dynamics data provided to the block it distributes the normal forces on the tires accordingly.
- We also get the velocity of the vehicle as in output from the vehicle body block.
- As the velocity signal passing through the integrator block, it also provides the distance covered by the vehicle.
- In end we have the results of the simulation in three scope data in which one has engine rpm, another has the rpm of primary and secondary shafts of CVT transmission, and the other has velocity, distance, throttle & brake values of the vehicle.
- Results
The simulation runtime is 200 seconds.
- Initial velocity/rpm of engine is defined as the 1750 rpm, then as the throttle value is constant input the rpm of engine changes accordingly.
- And since the throttle value is constant through the complete simulation after a certain duration engine rpm becomes constant.
- As the primary shaft is connected to the engine it looks similar to the engine rpm but due to the inertia and other factors the primary shaft rpm will not be the same as the engine rpm and it will have some losses.
- Hence primary shaft will not be the same as the engine but will have similar rpm with considering some losses.
- And according to the CVT ratio the secondary shaft speed is achieved.
- We can verify that the Throttle value & Brake value are constant during the complete simulation.
- Initially, the velocity of the vehicle is increased rapidly and then after a certain point when the engine reaches its constant rpm, the velocity of the vehicle becomes constant.
- As we know integration of the velocity gives us the distance travel by vehicle. Hence during the initial simulation time, the distance traveled looks like a parabolic curve, and then as velocity becomes constant the distance traveled becomes a straight line.
- BAJA ATV Model - cvtModel.slx (with dashboard)
- This model is the same as the earlier model only the difference here is, we can change the throttle and brake value during the simulation is running and then we can observe its results.
- Following is the simulation model for BAJA ATV Model with dashboard –

- In the above model the simulation blocks used & their purpose are as follows:
- Circular Gauge – Display an input value on a customized gauge.
- Knob – Set a value to tune parameters or variables.
- Constant – Output the constant specified by the 'Constant value' parameter
- Goto – The Goto block passes its input to its corresponding From blocks. The input can be a real- or complex-valued signal or vector of any data type. From and Goto blocks allow you to pass a signal from one block to another without actually connecting them.
- Simulink PS Converter – Converts the Simulink input signal to a Physical Signal.
- Generic Engine – Represents a system-level model of spark-ignition and diesel engines suitable for use at the initial stages of modeling when only the basic parameters are available.
- Solver Configuration – The Solver Configuration block specifies the solver parameters that your model needs before you can begin the simulation.
- Mechanical Rotational Reference – The Mechanical Rotational Reference block represents a reference point, or frame, for all mechanical rotational ports.
- Engine Sensor – It’s a Subsystem model consist of the following simulation blocks & their purpose are as follows:

- Ideal Rotational Motion Sensor – The Ideal Rotational Motion Sensor block represents an ideal mechanical rotational motion sensor, that is, a device that converts an across variable measured between two mechanical rotational nodes into a control signal proportional to angular velocity or angle.
- Mechanical rotational Reference – The Mechanical Rotational Reference block represents a reference point, or frame, for all mechanical rotational ports.
- PS-Simulink Converter – Converts the input Physical Signal to a Simulink output signal.
- Scope – Display signals generated during simulation.
- PS terminator – Use this block to terminate physical signal outputs.
- Signal Builder – The Signal Builder block allows you to create interchangeable groups of piecewise linear signal sources and use them in a model.
- CVT – It’s a Subsystem model consist of the following simulation blocks & their purpose are as follow:

- Inertial – The block represents an ideal mechanical rotational inertia.
- Ideal Rotational Motion Sensor – The Ideal Rotational Motion Sensor block represents an ideal mechanical rotational motion sensor, that is, a device that converts an across variable measured between two mechanical rotational nodes into a control signal proportional to angular velocity or angle.
- Mechanical rotational Reference – The Mechanical Rotational Reference block represents a reference point, or frame, for all mechanical rotational ports.
- PS-Simulink Converter – Converts the input Physical Signal to a Simulink output signal.
- Goto – The Goto block passes its input to its corresponding From blocks. The input can be a real- or complex-valued signal or vector of any data type. From and Goto blocks allow you to pass a signal from one block to another without actually connecting them.
- PS terminator – Use this block to terminate physical signal outputs.
- Variable Ratio Transmission – Represents a variable ratio gearbox such as implemented by mechanical belt CVT, electric, or hydraulic transmissions.
- Simple Gear – Represents a fixed-ratio gear or gearbox.
- Vehicle Body – CVT – It’s a Subsystem model consist of the following simulation blocks & their purpose are as follows:

- Inertia – The block represents an ideal mechanical rotational inertia.
- Double Shoe Brake – Represents a brake arranged as two pivoted rigid shoes symmetrically installed inside or outside a drum and operated by one actuator. The actuator force causes the shoes to exert friction torque on a shaft connected to the drum.
- Gain – Element-wise gain (y = K.*u) or matrix gain (y = K*u or y = u*K).
- Tyre – Represents the longitudinal behavior of a highway tire characterized by the tire Magic Formula.
- PS terminator – Use this block to terminate physical signal outputs.
- Vehicle Body – Represents a two-axle vehicle body in longitudinal motion. The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile.
- PS Constant – This block creates a physical signal constantly.
- PS-Simulink Converter – Converts the input Physical Signal to a Simulink output signal.
- Integrator – The Integrator block outputs the value of the integral of its input signal with respect to the time.
- From – The From block accepts a signal from a corresponding Goto block, then passes it as output. The data type of the output is the same as that of the input from the Goto block. From and Goto blocks allow you to pass a signal from one block to another without actually connecting them.
- Scope – Display signals generated during simulation.
- Inputs for the Model
- Following are the variable inputs to the model.

- The variable m1, m2 stands for the mass input for the inertial at input shaft and output shaft at CVT Transmission system.
- The variables ‘speedVector’ & ‘torqueVector’ are the engine parameters for the Generic Engine, which provides us the relation between torque and rpm of the engine.
- Using the knob block where we provide the throttle and brake input while the simulation is running, its limits are provided on the knob.

- Using Signal Builder block we have given the CVT ratio which varies with time.

- Workflow/Process of the Model
- The initial condition of the engine block is already set according to the engine parameters we have, and then according to the throttle input engine change its parameters of speed, torque, and others. For this model, the engine parameters are provided by using the variables ‘speedVector’ & ‘torqueVector’.
- The throttle and brake input is provided by the user using user interface knob blocks which allow the user to change the throttle and brake inputs while the simulation is running.

- After getting the throttle & brake inputs to the system, the engine block provides the rpm, torque, and various factors depending upon the engine parameters.
- The output from the Generic Engine is the pass through the engine sensor block where it records the rpm of the engine during the simulation, and then it is forwarded towards the CVT Transmission.

- In the CVT block, it takes the two inputs, one from the engine and another from the signal builder block which provides the CVT ratio.
- In the CVT block, there are two ideal rotational sensor blocks & two inertia blocks each for input and output shafts respectively, and then there is the Variable Ratio Gear which changes its gear ratio during the simulation according to the given CVT ratio.

- Now after the signal from the CVT block it passed through the simple gear block which we can say acts as a differential gearbox before passing to the vehicle body(tires).
- In the vehicle body block, it requires two inputs one from the engine which we get through the simple gear block and another is the brake input.

- Since our model is designed on basis of a TWD (Two Wheel Drive) vehicle, the input engine signal from the simple gear is provided to both rear wheels of the vehicle body.
- As there will be rotational inertia of the shafts so it is then connected to the engine input signal before it reaches the tire.
- The other input brake is provided to the Double Shoe Brake block, but before it reaches there it passes through the gain block which we can say acts as an intensifier for the brake input, in short, its multiples the input force, in this scenario the gain factor is 1000.
- As the brakes are indirectly connected to the input power of wheels, hence the output from the double shoe brake block is connected to the engine input signal before it reaches the tire.
- Here there is another vehicle body block (inside the vehicle body block on the main system) which accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile, with the help of the vehicle dynamics data provided to the block, it distributes the normal forces on the tires accordingly.
- We also get the velocity of the vehicle as in output from the vehicle body block.
- As the velocity signal passing through the integrator block, it also provides the distance covered by the vehicle.
- In end we have the results of the simulation in three scope data in which one has engine rpm, another has the rpm of primary and secondary shafts of CVT transmission, and the other has velocity, distance, throttle & brake values of the vehicle.
- Results
- Case 1. - Brake = 0 & Throttle = 0.5

- Simulation Video
- Initial velocity/rpm of engine is defined as the 1750 rpm, then as the throttle value is constant input the rpm of engine changes accordingly.
- And since the throttle value is constant through the complete simulation after a certain duration engine rpm becomes constant.
- As the primary shaft is connected to the engine it looks similar to the engine rpm but due to the inertia and other factors the primary shaft rpm will not be the same as the engine rpm and it will have some losses.
- Hence primary shaft will not be the same as the engine but will have similar rpm with considering some losses.
- And according to the CVT ratio the secondary shaft speed is achieved.
- We can verify that the Throttle value & Brake value are constant during the complete simulation.
- Initially, the velocity of the vehicle is increased rapidly and then after a certain point when the engine reaches its constant rpm, the velocity of the vehicle becomes constant.
- As we know integration of the velocity gives us the distance travel by vehicle. Hence during the initial simulation time, the distance traveled looks like a parabolic curve, and then as velocity becomes constant the distance traveled becomes a straight line.
- Case 2. - Brake =Varying, Throttle = 0.5

- Simulation Video
- The initial velocity/rpm of the engine is defined as 1750 rpm, and the throttle value is constant.
- From the video we can observe that until the first 45 sec of simulation the throttle value is constant and no brake is applied, so accordingly the engine rpm is controlled by the throttle input.
- Then as we start applying the brake gradually, the engine rpm starts to decline slowly.
- But brake below 0.12 or 0.1 makes the engine rpm increase slowly than decreasing it.
- Depending upon the brake value, the engine rpm declines faster for high brake value and vice versa, so does we can see that clearly in the graph lines how the slope of it changes.
- As the primary shaft is connected to the engine it looks similar to the engine rpm but due to the inertia and other factors the primary shaft rpm will not be the same as the engine rpm and it will have some losses.
- Hence primary shaft will not be the same as the engine but will have similar rpm with considering some losses.
- And according to the CVT ratio the secondary shaft speed is achieved.
- We can verify that the throttle is constant throughout the complete simulation.
- The brake line shows us how much brake is applied when it is applied and also the duration of brake applied.
- Here we can easily observe the effect of applied brake value on the velocity of the vehicle, as the brake value increases velocity starts to decreases.
- But if we observe clearly when we apply break at below 0.12 or 0.1 value velocity is still increasing but at a slower rate, and above those values we can see velocity starts decreasing at a rate depending upon the value of applied brake.
- According to the power supplied by the engine, we can observe that velocity is also affected by brakes as same as the engine is affected. And the velocity graph also looks similar to the engine rpm graph only just got multiplied due to CVT and simple gear and also got affected due to other vehicle dynamic losses.
- As we know integration of the velocity gives us the distance travel by vehicle. Hence during the initial simulation time, the distance traveled looks like a parabolic curve, and then as velocity becomes constant the distance traveled becomes a straight line.
- Case 3. - Brake =0, Throttle = Varying

- Simulation Video
- As we observe in the video, we can see that when we did set the throttle values like 0.3, 0.4, 0.425 the engine and the vehicle stop quickly within the initial 25 sec of simulation.
- As in the parameters of the engine block, the initial velocity/rpm of the engine is defined as 1750 rpm, and we can’t reach the initial rpm at the start by keeping the throttle value below 0.45.
- So, as we keep the throttle value 0.45, we can observe that the engine is running properly and then the speed of the engine starts to increase rapidly resulting in the increment of the vehicle speed.
- The initial velocity/rpm of the engine is defined as 1750 rpm, and the brake value is constant.
- Initially, the throttle is constant (0.45) for some time until the rpm/velocity of the vehicle start to become constant.
- Then as we change the throttle value, we see ups and downs in the rpm of the engine.
- Increasing the throttle increases the rpm of the engine and vice versa.
- After that, we observe that increasing the throttle increases the rpm rapidly and creates a steep slope line/curve on the graph.
- But while decreasing the throttle, the rpm of the engine starts to decrease gradually making a curve line on the graph.
- As the primary shaft is connected to the engine it looks similar to the engine rpm but due to the inertia and other factors the primary shaft rpm will not be the same as the engine rpm and it will have some losses.
- Hence primary shaft will not be the same as the engine but will have similar rpm with considering some losses.
- And according to the CVT ratio the secondary shaft speed is achieved.
- We can verify that the brake is constant throughout the complete simulation.
- The throttle line shows us how much throttle is applied when it is applied and also the duration of the applied throttle.
- Here we can easily observe the effect of applied throttle value on the velocity of the vehicle, as the throttle value increases velocity starts to increases rapidly but when the applied throttle value decreases the velocity vehicle decreases slowly.
- According to the power supplied by the engine, we can observe that velocity is also affected by throttle as same as the engine is affected. And the velocity graph also looks similar to the engine rpm graph only just got multiplied due to CVT and simple gear and also got affected due to other vehicle dynamic losses.
- As we know integration of the velocity gives us the distance travel by vehicle. Hence during the initial simulation time, the distance traveled looks like a parabolic curve, and then as velocity becomes constant the distance traveled becomes a straight line.
- Conclusion
- We can understand easily how the vehicle may perform under the provided conditions.
- We can calculate the time required to attain a certain amount of speed or to stop the vehicle completely.
- We can also calculate what will be the maximum speed vehicle can achieve.
- We are also able to observe the performance of the braking system and the throttle system.
- This model helps us to verify the performance of the vehicle under the constructed brake system and throttle system.