Embedded Systems October 2000 Vol13_11

Issue link:

Contents of this Issue


Page 37 of 181

JOHN Measure Twice, Cut Once Carefully named variables help reduce confusion. Follow this naming convention to track units and avoid mismeasllrement. n the fall of 1999, ASA experienced the failure of its Mars Climate Orbiter. The C ailure was attri b- uted to miscalculations in the thrust used to cor- rect anomalies in the o rbi ter 's u"aj ectory on its way to Mars. These miscalculations, it was later di covered, were due to one subcontractor using English units instead of metric units. NASA specified the o utpu t of a piece of ground software to be in metric uni ts of impulse (Newton-seconds); the software produced outpu t in Engli h units of impulse (pound-seconds). This article discus es pro blems associated wi th the lack of a useful software abslraction for measurement units and presents ome simple ideas fo r dealing with them. Standard units The Systeme International d 'Unites (SI, for short) stan- dardizes the units that are used in science and engineering. A feature of SI uni ts is that you can solve all the fundamen- 36 OCTOBER 2000 Embedded Systems Programming tal equatio n in physics without any extra manipulation. For instance, the familiar equation F'= 11!(L can be solved by using the SI unit or mass (kilograms) and acceleration (meters per second per second). The resulting force is measured in Newtons (N). Yo u could solve this equation using the English units of mass (slug) and distance (foot) . But the resul t would not be the English uni t or fo rce (pound) unless you also multiplied it by a nonintuitive constant. SI classifies units into two different types: base units and derived units. A base unit is a unit that cannot be decomposed in to oth er units. Le ngth is an example of a base uni t, since it cannot be expressed in terms of other units, like tim e or mass. A derived ttnit can be expressed in terms of multiple base units and may have a prope r name. The SI unit of fo rce is a derived unit that has a prope r name. The ewton is derived from the I uni ts of mass, distance, and time. This can be illustrated using Newton 's second law:

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems October 2000 Vol13_11