|
||
| Description: | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The oServo Object is capable of positioning an RC Servo anywhere within its 180 degree rotational span. The position within the 180 degree span is specified by a value with a range of 0 to 63 and once the servo has reached the specified position, it is held in place until the specified position changes or the oServo Object is turned off. The maximum number of oServo Objects that can be dimensioned in a single application program is 21, limited only by the amount of Object RAM. At best case, it is possible to control all 21 oServo Objects at the same time with a high torque setting of 70 Pulses Per Second. At worse case, All 21 possible oServo Objects at full swing can be controlled at the same time while maintaining a 20 Pulses Per Second refresh rate. The oServo and all other servo Objects use a default refresh rate of 35 Pulses Per Second. This refresh rate can be doubled to 70 Pulses Per Second to provide a higher torque output from the servos. Up to 12 servos positioned at full swing swing can be controlled at the same time while maintaining a 35 Pulses Per Second refresh rate and up to 6 servos positioned at full swing can be controlled at the same time while maintaining a 70 Pulses Per Second refresh rate. |
|||||||||||||||||||||||||||||||||||
| Operation: | |||||||||||||||||||||||||||||||||||
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 PWM servo control pulse 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. The IOLine property specifies which one of the OOPic's 31 digital I/O Lines is to be used. When set to 0, the PWM servo control pulse is not outputted. When set to a value other than 0 the oServo Object will, when active, set that I/O line to an Output and use that I/O line for controlling the servo. The Value property is used to specify the relative position of the servo. Internally, the Value property is adjusted be the Center, and InvertOut properties which are used to adjust the actual mechanical positioning. Note that the Center, and InvertOut properties only need to be set once and that after they are set, the Value property is the only property used to position the servo. The Center property adjusts the servo's position by offsetting the Value property and must be adjusted for the mechanical differences of each different servo motor connected to the OOPic. The InvertOut property is used to reverse the direction that the servo turns in response to the Value and Center properties. The oServo Object is tailored to control a standard RC Servo by generating a PWM servo control pulse with the Logical High-Going pulse ranging from 0 to 3ms in duration in 1/36ms increments. A typical servo with a rotational range of 180 degrees is positioned by the duration of a Logical high-going pulse in the range of .61ms to 2.36ms. If the InvertOut property is set to 0 then the PWM's Logical high-going pulse time is calculated as ((Value + Center.) * (1/36)) If the InvertOut property is set to 1 then the pulse time is calculated as ((107 - (Value + Center)) * (1/36)). Note that each unit of magnitude of the control pulse time is equal to 1/36ms PWM Servo Control Pulse Duration Examples: Each dimensioned instance of the oServo Object shares the Servo Motor Control (SM) module which multitasks between all active servos. The SM module provides the PWM servo control pulse that is required to electrically refresh a servo motor's position. The SM control module can output the PWM control pulse on any of the OOPic's 31 I/O Lines. When the SM control module is activated, it looks for the first active servo Object. (The first servo Object with its Operate property set to 1). That servo's I/O line is set to 1 and the PWM Logical high-going pulse output is generated. When the duration of the PWM Logical high-going pulse is met, the I/O line is set to 0 and the SM control module moves to the next active servo Object. The SM control module will systematically continue through each active servo Object until all have been completed and then repeats the process. The servo's refresh cycle is a result of the SM control module being activated 35 times each second, which in turn outputs the PWM Logical high-going pulse for each active oServo Object 35 times per second. If the sum of the durations of all PWM Logical high-going pulses from all the active oServo Objects totals more than 1/35th of a second, then the refresh cycle time is stretched to accommodate the total time. For example; 12 servos at full swing requires 33.04 milliseconds. (2.36ms * 12 servos = 0.02832 Seconds) which is within the 1/35th of a second (0.02857 Seconds) time frame, therefore, the refresh cycle is not stretched. But, 21 servos at full swing requires 49.56 milliseconds. (2.36ms * 21 servos = 0.04956 Seconds) which will stretch the refresh cycle time down to 20.18 times per second. As of firmware B.2.x, the servo's refresh cycle time can be set to a high torque mode of 70 Pulses Per Second. This mode can be selected by setting the OOPic.SrvRefresh Property to 1. When in this mode, all the timing calculations discussed above are adjusted appropriately. |
|||||||||||||||||||||||||||||||||||
| Remarks: | |||||||||||||||||||||||||||||||||||
After the IOLine property is set, the specified IOLine will remain in its former logic state of either High-Z, High, or Low until the operate property is set to 1. |
|||||||||||||||||||||||||||||||||||
| Storage size & Availability: | |||||||||||||||||||||||||||||||||||
The following table lists the size and availability of the oWire Object:
|
|||||||||||||||||||||||||||||||||||
| Properties: | |||||||||||||||||||||||||||||||||||
The following table lists the Properties of the oServo Object:
|
|||||||||||||||||||||||||||||||||||
| Example: | |||||||||||||||||||||||||||||||||||
In the following example, a Servo is moved back and forth.
|
|||||||||||||||||||||||||||||||||||
| Connections: | |||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
| See Also: | |||||||||||||||||||||||||||||||||||
| oServoX - An Object that uses URCP Heading values to control an RC Servo. oServoSP - An Object that uses URCP Speed values to control a modified RC Servo. oServoSE - An Object that controls a Scott Edwards mini ssc II servo controller module. OOPic.SrvRefresh - A property that selects a 70 Pulses Per Second refresh rate for all servos. |
|||||||||||||||||||||||||||||||||||