An oServo Object positions a RC Servo motor connected to the I/O Line specified by the IOLine property to a position specified by the Position, Adjust and Invert properties. An Operate property specifies if the servo is active or not. When set to 1 the oServo Object is active and will continuously output a control signal to the servo which results in the RC Servo turning to and holding at the specified position. When the Operate property is cleared to 0 the oServo Object is inactive and the specified I/O line is set to 0 volts which releases the servo. It is possible to control all 20 possible oServoX servos at the same time. But doing so will degrade the torque. At best case, 13 servos can be controlled 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. When set to 0, the control signal is not outputted. When the IOLine property is > 0 and the Operate property is 1, the oServo Object will output the control signal. The Position property is used to specify the relative position of the servo. Its range is 0 to 63 which provides 64 steps over a 180 degree turning range. This works out to 2.8 degrees per step. Internally, the Position property is adjusted by the Adjust, and Invert properties which are used to adjust the actual mechanical positioning. Note that the Adjust, and Invert properties only need to be set once and that after they are set, the Position property is the only property used to position the servo.
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 oServo object can take advantage of the full rotational capability of the servo, whatever it may be. The Adjust property adjusts the servo's position by offsetting the Position property. (see history) It must be adjusted for the mechanical differences of each different servo motor connected to the ooPIC. Its range is 0 to 63 which provides an additional 180 degree adjustment to the Position property. The default is 22 and it is also 2.8 degrees per step.
By adjusting the Adjust property, The 0-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 in use. 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. |