Data Sheet
Copyright © Parallax Inc. Parallax Feedback 360° High-Speed Servo (#900-00360) v1.2 9/12/2017 Page 4 of 7
For example, a rolling robot application may use 64 units, or “ticks” per full circle, mimicking the behavior
or a 32-spoke wheel with an optical 1-bit binary encoder. A fixed-position application may use 360 units,
to move and hold the servo to a certain angle.
The following formula can be used to correlate the feedback signal’s duty cycle to angular position in
your chosen units per full circle.
Duty Cycle = 100% x (tHigh / tCycle). Duty Cycle Min = 2.9%. Duty Cycle Max= 97.1%.
(Duty Cycle - Duty Cycle Min) x units full circle
Angular position in units full circle = ______________________________________________
Duty Cycle Max - Duty Cycle Min + 1
The example code discussed in the Low-Level Programming section below demonstrates angular position
control. It uses this formula along with a scale factor to convert floating-point percentages to integers. It
also includes code to accommodate rotation that crosses the origin, and to compensate for starting
positions other than the origin.
Programming Resources
C example code for low-level position control is available for download, and discussed in more detail in
the next section. It is written for the Propeller microcontroller but should provide an illustration of
programming strategies that can be adapted to other controllers.
Propeller C resources under development include two user-friendly libraries for higher-level control,
servo360 and abdrive360. Both of these libraries support speed-controlled continuous rotation as well as
angular position applications.
The abdrive360 library uses the same functions as the original abdrive library, so example programs that
run on an ActivityBot robot using abdrive will also run using these Feedback 360° servos.
The servo360 library will be similar to the servo library, with enhancements to utilize the Feedback 360°
servo’s Hall-effect sensor output.
Blocks that use these libraries are also in the works for the BlocklyProp graphical programming system, to
be released in Fall 2017.
Low-Level Position Control Programming
This section explains excerpts from this program: Feedback360 Angle Control [Low Level Example].side
This example Propeller C program uses two of the Propeller microcontroller’s cogs (processors), one for
angle detection and another for feedback control. It can all be done in the same loop, but it makes the
code a little easier to digest in separate processors. These two lines launch the feedback and control
functions into other cogs. Control here goes through the servo library, with valid speed values ranging
from -220 (full speed clockwise) to -20...20 (stop) to 220 (full speed counterclockwise).
cog_run(feedback360, 128);
cog_run(control360, 128);
servo_speed(pinControl, -40);