The oServoSP and oServoSP2 Objects rotate a modified RC servo motor connected to the I/O Line specified by the IOLine property at a speed specified by the Speed and Invert properties. This object is fairly identical to oServoX with the exception that a Speed of 0 causes the servo to go into a dormant state. This is useful when using a hobby servo as a drive motor on a robot, there is no "drift" if you don't have the center set perfectly. The oServoSP2 is additionally different in that is uses a radically different control system than the oServoSP does. The IOLine property specifies which one of the ooPIC's 31 digital I/O Lines is to be used. NOTE: The IOLine property MUST be set before the Operate property is set to 1. When the Speed property is set to 0, the control signals that cause the servo to rotate are suppressed which results in the servo being at rest. As the Speed property increases, the control signals are adjusted so that the servo will turn forward increasing in speed as the value approaches 127. And as the Speed property decreases, the control signals are adjusted so that the servo will turn in reverse increasing in speed as the value approaches -128. When the Operate property is set to 1, the control signals are continuously output to the I/O Line specified by the IOLine property. This results in the modified RC servo rotating at the specified rate. When the Operate property is cleared to 0, the control signals are suppressed. This results in the modified RC servo rotating freely. The Invert property causes the servo to move in the opposite direction. The oServoSP2 Object uses a different control signal. Normally the servo control signal is composed of pulses that are sent to the servo at regular intervals and a change in the duration of each pulse controls the servo. The oServoSP2 differs in that the pulse duration stays the same, but the intervals change to control the servo. (See the oPWMS Help for more detail on how the control signals for servos work.) When created, the oServoSP and oServoSP2 Objects also create an instance of the oPWMS object which is used to generate and output the signal that controls the servo. Modifying any of the properties of the oPWMS instance will affect the oServo Object's operation. See the oPWMS Help for more detail on how servos are controlled. |