Servo Subsystem Introduction

The XCSB servo subsystem is designed to be used Radio Control (RC) type servos. These servos normally drive a wheel or arm. The distance the wheel or arm can travel is dependent on the exeact make and model of the servo. The full travel of the servo is usually 90 or 180 degrees.

The XCSB servo subsystem is designed to control the position of the servo relative to its full travel. Think of the start position of the servo as 0 and the end position as 1 with all points inbetween 0 and 1 being fractions. If we wish to set the servo position to the mid point between 0 and 1 we would set the servo position to 0.5

Rather than use floating point numbers to set the servo position the servo subsystem uses fractions. The resolution of these fractions is 1/255.

0/255 is a special number and should not be used.
1/255 is the start of travel of the servo
255/255 is the end of travel of the servo
128/255 is the mid point between start and end

If a servo with 90 degrees of full travel is being used, then the actual position to which the servo is set is defined as

90 * n / 255
where n is the position specified in the servo_set_pulse function or returned by the servo_get_pulse function

The XCSB servo subsystem controls servos groups of upto 8 servos per group. All the servos in a given group are controlled in parallel. A group of servos is defined as all servos connected to the same physical I/O port of the processor. Each group has a 2ms overhead per 20ms period (the processor devotes 10% of its processing time per servo group). It is best to have one completely full group instead of multiple partially filled groups.

In contrast the BasicStamp and standalone PICs programmed using PicBasic (or PicBasic Pro) can only control 1 sero at a time using the pulsout command. This incures a 2ms overhead per 20ms period per servo. The BasicStamp and PicBasic programmed PICs max out at 10 servos assuming the processor is required to do nothing else (100% / 10% = 10 servos). If the processor needs to do any other work (polling inputs for example) then the number of servos that can me controlled may be greatly reduced.

The XCSB servo subsystem can control many more servos while incurrring a much lower overhead.

max
servos
max
overhead
processor
8 10% 16F628
13 20% 16F628
16 20% 16F876
22 30% 16F876
24 30% 16F877
32 40% 16F877