23/06/2012

Car dashboard simulator

Over the last two days, I designed a vi to simulate the actions of the Tesla Roadster sports car. The front panel as you can see, mainly consists of 2 gauges (for SPEED and RPM values) and a tank (for the torque values). The speed is the controlling variable for the rest of the program.

SPEED:
The speed value has a maximum of 150mph and is controlled by the 'ACCELERATE' button which simulates the accelerator pedal of a car. It operates in the 'Switch until released mode' and functions in a while loop set to activate only when ACCELERATE is true. Using the 'wait until next ms multiple' function, the loop controls the acceleration to be 0 - 60mph in 3.7 seconds by incrementing speed by a certain value on each iteration. The car slows down when no pedal is pressed and decelerates rapidly when the 'BRAKE' button is pressed. The BRAKE button controls a case statement which simply contains one constant for TRUE and another for FALSE. The constants are rooted to a wait function which serves to operate a deceleration loop slower or faster. Also, the LED on the speedometer comes on moving very fast just in case you sleep off on the pedal or feel like breaking the speed limit.

RPM and TORQUE:
RMP is a function of the car's speed assuming the wheels are 19 inches in diameter. The torque is a complex function of speed, gear and differential efficiency (1 by default), the car's mass and some other constants. The torque is quite accurate as the real-life car actually produces a torque of about 370 Nm from start.
The equation used was from material a professor had given me.

The program still has a few errors - the speed numeric exceeds the actual top speed, could go negative and rpm could go to some unreal high values (20k plus)



No comments:

Post a Comment

Comments: