Hardware Reference
In-Depth Information
Precision and Safety
Controlling multiple servo motors can be rather processor-intensive, and this
can sometimes affect precision if you have a large amount of servos controlled
by one Arduino. In extreme cases, slight angular distortion may be visible on
servo motors with the lowest angular value. This is often in the range of 1 to
2 degrees.
There are situations in which using servo motors can be a safety issue. If
used with robotics, one of the most basic rules of robotics is to never get in the
way of a robotic arm. Imagine a robotic arm powered by servo motors that is
to place an object in the user's hand. The movement must be precise and not go
above or below a certain angle.
Using the Servo library does not stop interrupts. You can still respond to
interrupts, and timing functions such as millis() still work, but remember
that the end of a servo motor pulse can be lengthened by the time it takes to
execute an interrupt handler. If your interrupt handler takes 200 microseconds
to complete and is called close to the end of a servo's pulse, in the worst case,
the pulse sent to the servo motor can be lengthened by 200 microseconds, mean-
ing that the resulting angle is not what you expected. It will be corrected the
next time a pulse is sent, and the servo motor will move to the correct angle. In
most applications, this will not be a problem, but just keep this in mind if your
application has an absolute limit that must not be exceeded.
Example Application
Servo motors can be used for a variety of projects, from remote controlled cars
to robotics. To keep things simple, this section uses a servo motor to create a
retro-style thermometer. In the digital age, you might sometimes forget what
these devices used to look like. Mercury thermometers are usually long glass
objects, with a straight line, but some thermometers are round, and have a hand
similar to clocks. A servo motor can be used to move the hand, controlled by an
Arduino that gets a temperature reading from an external component, perfect
for indoor or outdoor temperature readings.
This example uses an LM35. The LM35 is an inexpensive and readily avail-
able precision temperature sensor calibrated in Celsius, and illustrated in
Figure 14-2. It can be used to sense temperatures between -55° C and +150° C
by adding a resistor and a reference voltage, but without any additional resistor,
it can sense temperatures between 0° C and 100° C. The LM35 outputs 10 mV
for each degree, from 0 V for 0° C to 1,000 mV (or 1 V) for 100° C.
 
Search WWH ::




Custom Search