122-28176 Parallax Inc, 122-28176 Datasheet - Page 121

GUIDE STUDENT PROCESS CONTROL

122-28176

Manufacturer Part Number
122-28176
Description
GUIDE STUDENT PROCESS CONTROL
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-28176

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Challenge 4-4: Better Start/Stop Control
What happens when both the START and STOP buttons are held down? The LED on the
board blinks rapidly. If this were controlling a motor it would be cycling on and off. In
an emergency, this is neither good for the motor nor for the person whose hand got
caught in the conveyor!
ACTIVITY #5: INPUT BOUNCE AND SPURIOUS SIGNALS
One problem is seen when the progress of the box isn't nice and smooth. Imagine the box
rocking and rattling on the conveyor belt. Run the simulation and wiggle the 'box' back
and forth as it enters the range of detection. What occurs? The sample speed on the
detector is fast enough to register several units as the box momentarily enters and exits
the range of detection.
Almost any switch that measures a physical quantity can suffer from "bounce".
Pushbuttons and switches have mechanical contacts that bounce against each other
several times before stabilizing. With optical switches, there is almost never a clean
transition as a slow-moving object enters a beam. Sometimes multiple triggering is not
important, such as sensing start button being pressed once or a dozen times. At other
times, such as counting, it is very important. Another consideration is spurious signals
such as a lump of dust falling in front of the detector. Or the earlier vat filling - what
would happen as the water splashes near the detector as the vat fills? Would this have
signaled a spurious reading of the vat being full?
Electronics are often implemented to smooth out the signal, such as a low-pass filter to
reduce noise, bounce and spurious signals. In programming, these issues can be handled
in a number of ways, such as re-sampling and averaging. A simple method for handling
switch bounce and spurious signals is to pause the length of time it takes an input to
stabilize and then re-sample to ensure a good reading. The length of the pause should be
long enough for the input to stabilize before sampling again. Pressing a button may
require 100 ms to become steady. A slow-moving box on a noise conveyor may require
several seconds, but not so long that the signal is missed.
Save BoxConveyor.bs2 under a new name.
Use Boolean operators to start the conveyor only if the Start button is pressed
and the stop button is not pressed. Show your code.

Related parts for 122-28176