1

I've got a raspi 3b with an esc and a brushless motor attached. I can run the motor using pigpio the following commands:

# First start the pigpio daemon
sudo pigpiod

# calibrate the esc
pigs s 12 2000
pigs s 12 1000

# Run the motor really slooowww
pigs s 12 1010

This works great. I now want to do the same from the program I'm writing in Golang. I'm using the go-rpio library to control the PWM on the GPIO pins. When doing that I also need to specify the pin frequency and the cycle length.

Does anybody know what the frequency, cycle length, and duty cycle are of the few lines of bash I use above? I guess the pigpio library uses some kind of "default frequency"?

All tips are welcome!

1

The pig s command sends servo pulses to the ESC.

The servo pulses are sent at 50 Hz (i.e. 50 times per second) and the lengths are defined in microseconds.

Duty cycle is not relevant to a servo. It needs a pulse width.

If the software you are using only lets you specify a duty cycle you can convert between microseconds pulse width to a duty cycle percentage as follows:

duty cycle (%) = microseconds / 200

The formula assumes the PWM frequency is 50 Hz.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.