0 - 1 © 2007 texas instruments inc, content developed in partnership with tel-aviv university from...
TRANSCRIPT
![Page 1: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/1.jpg)
0 - 0 - 11
© 2007 Texas Instruments Inc,
Content developed in partnership with Tel-Aviv University
From MATLAB® and Simulink® to Real Time with TI DSPs
Vehicle Dynamics
![Page 2: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/2.jpg)
Slide Slide 22© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Objectives
• To implement a simplified differential equation for the motion of a car.
• To build and test a Simulink Model.
• To run the model in real-time using the ezDSP F2812 hardware.
![Page 3: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/3.jpg)
Slide Slide 33© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Motion of a Vehicle
• Consider the case of a car driving in a straight line along a flat road.
![Page 4: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/4.jpg)
Slide Slide 44© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Engine Power
• The driving force is supplied by the engine.
Engine PowerEngine Power
![Page 5: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/5.jpg)
Slide Slide 55© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Vehicle Weight
• The weight of the vehicle will need to be overcome to move the vehicle.
Vehicle Weight Vehicle Weight
![Page 6: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/6.jpg)
Slide Slide 66© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Wind Resistance
• As the car moves, there will be wind resistance.
WindWindResistanceResistance
![Page 7: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/7.jpg)
Slide Slide 77© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Vehicle Speed
• The engine power, vehicle weight and wind resistance determine the vehicle speed.
Vehicle SpeedVehicle Speed
![Page 8: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/8.jpg)
Slide Slide 88© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Combined Factors
• These factors can be brought together into an equation of motion.
b.vb.v
mm
FF
vv
![Page 9: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/9.jpg)
Slide Slide 99© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Differential Equation
F = m.dv/dt + b.v where:
– F = force provided by the engine
– m = mass of vehicle
– dv/dt = rate of change of velocity (acceleration)
– b = damping factor (wind resistance)
– v = velocity (vehicle speed)
![Page 10: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/10.jpg)
Slide Slide 1010© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Transformed Equation
• To implement the equation using Simulink, the equation needs to be first transformed.
• F/m –v.b/m= dv/dt
• We will set up a subsystem with:
– Force F as the input.
– Speed v as the output.
![Page 11: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/11.jpg)
Slide Slide 1111© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Continuous Implementation
• Using Simulink, the equation can be implemented as a continuous system as shown in the diagram.
• To generate v, we need to integrate the acceleration dv/dt.
![Page 12: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/12.jpg)
Slide Slide 1212© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Simulink Model
![Page 13: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/13.jpg)
Slide Slide 1313© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
The Simulink Model
• The model of vehicle motion is shown below:
![Page 14: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/14.jpg)
Slide Slide 1414© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Description of Model
• The input to the system is the gas pedal, under control of the driver.
• The “Engine Management” sub-system converts gas pedal to engine power.
• The “Vehicle Dynamics” sub-system converts engine power to vehicle speed.
• The output is provided in horsepower.
![Page 15: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/15.jpg)
Slide Slide 1515© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Engine Management Subsystem
• This converts the gas pedal input (0-100%) to engine output power (0 – 200 hp).
![Page 16: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/16.jpg)
Slide Slide 1616© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Lookup Tables
• The conversion from rpm to power can be implemented using a lookup table.
![Page 17: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/17.jpg)
Slide Slide 1717© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Lookup Table Curve
• The table values can be adjusted to fit a smooth curve.
![Page 18: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/18.jpg)
Slide Slide 1818© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Vehicle Dynamics Subsystem
• To implement the equation of motion on the C28x, a Discrete Time Integrator is required.
![Page 19: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/19.jpg)
Slide Slide 1919© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Running the Simulation
• The ramp generator gently changes the Gas Pedal from 0% to 100%.
• This simulates smooth acceleration.
![Page 20: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/20.jpg)
Slide Slide 2020© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Tuning the Model
• Alter the mass m of the vehicle between 1 ton (for a small compact car) and 35 tons (for a truck).
• Increase the wind resistance by increasing variable b.
• Using real data from a car manufacturers website for the Lookup Table. You could also profile a diesel engine.
• Replace the Ramp input with a Step input to simulate stamping on the gas pedal!
![Page 21: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/21.jpg)
Slide Slide 2121© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Introduction to Laboratory
![Page 22: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/22.jpg)
Slide Slide 2222© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Overview of Laboratory
• The Simulink model will be modified to run on the ezDSP F2812 hardware.
• A potentiometer will be used to simulate the gas pedal.
• The output speed of the system will be monitored using a multi-meter.
![Page 23: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/23.jpg)
Slide Slide 2323© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Modifications for C28x
• To run on the ezDSP F2812, additional blocks from the Embedded Target for TI C2000 DSP are required.
![Page 24: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/24.jpg)
Slide Slide 2424© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
ADC Scaling
• The ADC input 0-4095 needs to be scaled 0-100%.
• Using fixed-point math, this can be implemented as multiply by 800 then divide by 32768.
![Page 25: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/25.jpg)
Slide Slide 2525© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
DAC Scaling
• The input 0-200 kph needs to be scaled 0-62500 for the DAC.
![Page 26: 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Vehicle](https://reader036.vdocument.in/reader036/viewer/2022062511/5519de095503467a178b4695/html5/thumbnails/26.jpg)
Slide Slide 2626© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
References
• ezDSP F2812 Technical Reference.