Wednesday, August 31, 2016

The Automobile: Beneath the Body

Think of your vehicle. What comes to mind?
The last parking ticket you got, that you need to change your breaks, or the fact that you need to fill up your tank soon?

Rarely does the average person consider what’s going on under the hood, let alone the role that programming plays in continuously bringing your car to life. 

First, let’s start with the basics. Aside from the major mechanical architecture that your car is built on, automobiles are controlled electronically. The main electrical components of your car are the Electrical Control Units. These units are computers, set up in various locations throughout a vehicle, each programmed to control a certain area of the car, such as the engine, transmission, dashboard electronics, etc. They are comparable to the Central Processing Units (CPU) in normal PC's, in that their function is to receive inputs, process them, and then create outputs. 

Whereas the input methods we are familiar with include clicking with our mouse or typing with our keyboard, ECU’s are responsive to a variety of switches and sensors located throughout the vehicle, some of which we operate, and some of which operate automatically by responding to the mechanical and electrical system. Examples of these include the oxygen sensor, window and lock switches, and speed sensors, but in the image below, dozens more are shown, and all of which are ultimately processed by the electrical control units. 



Although these input methods are considerably different from those of a normal PC, the methods used to analyze and respond to them are identical. Information from sensors and switches located throughout the vehicle is transmitted to the ECU via the “Controller Area Network (CAN),” which is the system of wires and software protocols acting as the connective tissue between the two. In the figure below, the CAN (also referred to as CANbus) is highlighted in gray, and is connected to a variety of sensors and control units. Once an ECU receives inputs, taps into its memory, processes them, and then “decides” on an output according to its program, the CAN carries the information back to the designated architecture, where operations are performed instantly.



What is interesting about the ability of ECU’s to operate such complex machines in such a short amount of time is that compared to the Central Processing Unit in a PC, which has an average speed of 500-1000 MHz, the ECU’s average operation speed is only 40 MHz. And yet, the amount of memory storage that it draws from is less than 1 megabyte, as compared to 2 gigabytes (minimum) in a PC - thats about 2000x less! Although the numbers suggest a slower operation, the cause for the ECU’s instantaneous activity is simply that it is running on a highly efficient code.


So, the next time you watch an ultra savvy sports car cross the finish line in first place, just remember it was the programmer who won the race, not the driver. 



Image Sources: 

Text Sources:



No comments:

Post a Comment