Sending Signals to Stepper Motors

Stepper motors represent a significant component of the electromechanical design as they are needed to raise and lower the sensor array. Without this movement, the sensors would not be close enough to the lights to detect anything. As such, the PIC is required to send the stepper motors the required firing sequence the correct number of times to ensure that the array moves up and down the right amount. This was accomplished by calling the “STEPPER DRIVER” subroutine (which contained the firing sequence) in a loop the desired number of times (which was determined by trial and error). This code is shown in Figure \ref{fig:ARRAY_LOWER}. The firing sequence was sent by the PIC by setting the bits STEP_A, then STEP_C, then STEP_B, then STEP_D high to turn the motors forward. The reverse sequence (D, B, C, A) was sent to reverse the motion of the motors. The code for the forward firing sequence repeats three times per call to STEPPER_DRIVER, and one repitition is shown in Figure \ref{fig:STEPPER_FORWARD}.