edgetpu: EdgeTPU PWM output low average voltage problem with Servo motor
We have an MG996R model Servo motor. The PWM output from the Coral is only 2.5V peak, and not very strong. We are using the HC4049 model buffer for this. But this doesn’t work. We couldn’t run our servo motor. Previously we have Raspberry PI 3 Model B and it was working smoothly.
We are following two libraries. First, Adafruit_CircuitPython_Motor And they have explained this situation in this article. https://learn.adafruit.com/circuitpython-on-google-coral-linux-blinka/pwm-outputs-servos We tried the codes in the “Servo Control” section
Second, python-periphery
from periphery import PWM
pwm = PWM(2, 0)
pwm.duty_cycle = 0
pwm.frequency = 5000
pwm.duty_cycle = 0.98
pwm.frequency = 5500
We didn’t get errors in both libraries but nothing happened. Some people have this problem but there is no solution. https://stackoverflow.com/questions/55385943/google-edgetpu-cant-get-pwm-to-work-with-python
References.
Linux arid-goose 4.9.51-imx #1 SMP PREEMPT Thu Jan 31 01:58:26 UTC 2019 aarch64 GNU/Linux
mendel@jumbo-zebra:~$ cat /etc/os-release PRETTY_NAME=“Mendel GNU/Linux 4 (Day)” NAME=“Mendel GNU/Linux” ID=mendel ID_LIKE=debian HOME_URL=“https://coral.withgoogle.com/” SUPPORT_URL=“https://coral.withgoogle.com/” BUG_REPORT_URL=“https://coral.withgoogle.com/” VERSION_CODENAME=“day”
Do you have an idea to increase the power of the PWM output? Thanks.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (4 by maintainers)
An overlay is needed to provide a 3.3V swing. The pin configuration for the device tree overlay can be found here: https://coral.googlesource.com/linux-imx/+/refs/heads/master/arch/arm64/boot/dts/freescale/fsl-imx8mq-phanbell.dts#171
The number there (0x7f), can be decoded with this bitmask: https://coral.googlesource.com/linux-imx/+/refs/heads/master/Documentation/devicetree/bindings/pinctrl/fsl%2Cimx8mq-pinctrl.txt.
2.5V comes from PUE (pull up enable) being set while all GPIOs have a weak pull down. If this is removed (and you should remove LVTTL and ODE for maximum drive strength), the IO will drive 3.3V. Here’s an overlay that does it. To enable, copy pwm.dtbo to /boot and then edit overlays.txt to add pwm into the list (i.e. overlays=pwm)
PWM_Overlay.zip