RC servo motors (or “servos” for short) are used by many hobbyists to make remote control cars, planes, etc.,. In recent years, they have been used for robot arms, legs, and wheels.
With the Cubloc's PWM outputs, a servo can be easily added to any project.
A servo typically has three wires. The black wire is ground and red wire is for power. The other yellow wire is for receiving a PWM signal. A typical pulse rate is approximately 60 pulses per second.
The servo will move to a location set by the PWM's pulse and duty cycle, and will hold its position.
Every RC servo motor is different, but as an example, pulses of 1ms, 1.5ms, and 2ms might stop a RC servo motor to -45 degrees, 0 degrees, and +45 degrees respectively.
Const Device = CB280 Low 5 Pwm 0,2500,32768
When the code above is executed, a 1ms pulse will be generated from I/O port P5 and the RC servo motor will position itself to -45 degrees.
Const Device = CB280 Low 5 Pwm 0,4000,32768
When the code above is executed, a 1.5ms pulse will be generated from I/O port P5 and the RC servo will position itself to 0 degrees.
By simply changing the duty value of PWM command, the RC servo can easily be controlled. For the CB220, 3 RC servos can be controlled simultaneously while the CB280 and CB290 can control up to 6 RC servos. The CB400/CB405 can control up to 12 servos.
Warning: When the RC servo is in operation, it will need about 500mA of current. Please make sure to use a power supply of at least 500mA.