| An oServoX Object positions a RC servo motor connected to the I/O Line specified by the IOLine property to a position specified by the Value, Adjust, Offset and Invert properties by outputting a PWM servo control pulse. When all 4 of the positioning values are set to 0, the servo will move to the middle position. As the Position property increases, the servo will move to one direction. And as the servo decreases, the servo will move to the other direction. The Position property is a full 8-bit URCP Heading value, but since the servo can only rotate 180 degrees, one half of the range is not used. When the Operate property is set to 1, the oServo Object will continuously output a PWM servo control pulse to the I/O Line specified by the IOLine property. This results in the RC Servo holding at the position specified by the Position property. When the Operate property is cleared to 0, the oServo Object sets the specified I/O line to 0 volts. At best case, it is possible to control all 13 possible oServoX servos at the same time with a low torque setting and 6 oServoX servos at the same time while maintain the high torque setting. Note that only the servos with their Operate property set to 1 will be counted as controlled. 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. The Position property is used to specify the position of the servo. Its range is -64 to 63. Note that the least significant bit is ignored which provides 64 steps over a 180 degree turning range. This works out to 2.8 degrees per step. Note that position of -128 to 127 can be specified, but will be ignored. What to do with positions in that range are controlled by the Offset and Mode properties.
The Offset property indicates which one-half section of the URCP Heading value to use and the Mode property specifies how the servo responds to values on the other half of the URCP Heading. It is important to keep in mind that different servos have different mechanical capabilities. Some servos can rotate more than 180 degrees, some less than 180 degrees. A servo manufacturer typically publishes that their servos are only able to rotate 90 degrees with some areas for adjustment. This area for adjustment is usually another 90 degrees or so, giving the servo a full swing capability of 180 degrees. The ooPIC will take advantage of the full rotational capability of the servo, whatever it may be. The Adjust property is used to adjust the mechanical starting point of the 0 position. Its range is 0 to 127. It is also 2.8 degrees per step with the LSB ignored. This value is typically set to a value between 40 and 80 and must be customized for each servo.
By adjusting the Adjust property, The -64 to 63 range of the Position property can be centered over the 180 degree range of the mechanical capability of the servo. Every servo is different. Even with the same manufacturer and model of servo, the mechanical capability may translate to a different area of the servo, so it is important to make this adjustment for each servo you use. When adjusting the Adjust Value to find the proper value, first set the Adjust property to 40 and the Position property to 0. Slowly move the Adjust property down until the actuator on the servo hits its mechanical stop. Then bring the Adjust property up by 1. The Invert property causes the servo to move in the opposite direction. This is useful when you are using servos as drive motors on opposite sides of a robot. The Invert property is used to reverse the direction that the servo will rotate in response to the Value and Adjust properties.
The Invert property is useful when two servos need to rotate in opposite directions when given the same position value. Such applications include Hexapod Walkers, or modified servos driving the wheels on a robotic base. When doing this, one servo's Invert property needs to be set to 0 and the second servo's Invert Property needs to be set to 1. Note: If a servo's Adjust property has already been adjusted and then the Invert property is changed, the Adjust property will need to be recalculated for the other side of the servo's mechanical capabilities. The Torque property controls how strong the servo's turning power is. (see history) Setting the Torque property to 1 (high-torque) will double the servo's turning power. Note that when the torque is set to high, the servo will draw twice the current from the battery. Note that the torque property will be overridden when using several servos. (see the oPWMS object for details.) When created, the oServo Object also creates an instance of the oPWMS object which it uses 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. |