I am trying to send 30us PWM signals to the KISS 24A ESCs, but the pulses are not recognized by the ESC. The tolerance is +/- 2us. However, 900us for arming, 1000us for start and up to 2000us work just fine.
Any suggestions on how to get 30us PWM signals on Navio2?
I am using Navio2, a Raspberry Pi 3, and the examples provided in the Navio2 emlid repo. The servo frequency is 400Hz.
The 30us PWM signals worked on Navio+ which uses PCA9685 for PWM output.
Edit: Figured I could update the rcio code via emlidtool and see if it fixes the issue with the 30us PWM signals. This gives an error, because /sys/kernel/rcio/status/crc is not existing. I am using a freshly installed raspbian version 4.4.36-a7765e7-emlid-v7+. I need Jessie instead of Stretch, because of other dependencies, e.g. libcrypto1.0.0.
Edit2: Tried to compile rcio-dkms-0.8.3 and also 0.9.0 on the pi, which both failed with
include/linux/ratelimit.h:31:9: error: initializer element is not constant
struct ratelimit_state name =
^
Edit3: switched to raspbian stretch emlid image. Have now the latest rcio firmware v1.0 and the rcio kernel module 0.9.0 installed. Still, no PWM pulses with 30ns possible!
Well, to tell the truth, I didn’t use an oscilloscope or a logic analyzer.
The KISS ESC answers to a 30us PWM signal with a serial telemetry message, which is received on the raspberry pi 3 via Navio2 UART Rx. As I said, the code worked on Navio+ (of course with emlid’s Navio+ raspbian image instead of the Navio2 raspbian image). And since the ESC did not answer, I figured that it did not receive the 30us pulse.
I also checked the PWM values under /sys/class/pwm/pwmchip0/pwm0/duty_cycle and for
pwm.set_duty_cycle(0, (float)30/1000.0);
they are 29999 and
pwm.set_duty_cycle(0, (float)31/1000.0);
results in 30999.
With the latter 31us and also with 32us, I finally got the ESCs to send telemetry back. So it seems that the PWM timing on the STM32F103 is inaccurate?