Navio2 with RPi4 PWM issues with C++ Examples

Greetings Navio Community,

Been banging & scratching my head trying to get to the root cause of this issue.
Problem is with the C++ Servo utility in Examples, many times running it, multiple PWM channels will “activate” (for lack of the proper vernacular). There are up to 11 PWM devices connected of various types - Servos, stepper motors and led’s. UBEC’s are delivering 8amps at 5.2v to the Pi/Navio2 with separate power to Pi through the servo rail and power to the Navio2 power connector. PWM devices are using separate power.

I’ve modified the Servo.cpp program to access other PWM channels besides the stock one.

It seems to be hit and miss getting the PWM channels to behave reliably.

We tried to change the PWM frequencies to 333Hz for motors and 100Hz for the other devices, which helped, but didn’t eliminate the problem.

Any suggestions would be helpful & feel free to holler at me if more info is needed.

  1. Image and ArduPilot version.
    Image: emlid-raspbian-20220608-img downloaded from website.
    Not using ArduPilot. Developing our own custom app.

  2. Detailed issue description. How does observed behavior differ from the expected one?
    Provided above

  3. Your step by step actions.
    sudo Build/Servo [pwm channel #]

  4. Picture of the setup and connection scheme.
    Still figuring out how on this platform. Stand by…

  5. If using any additional hardware, please provide the exact make and model.
    Afaik, straight RPi4 with Navio2 hat mounted. Followed online guide for connecting & powering PWM devices.

Thanks,

  • Doug Slattery

Hi Doug,

Welcome to the community!

Since there are multiple power sources, let’s check the possibilities of power issues. There might be voltage fluctuations or ground loops affecting signals. Please check:

  • power stability with multimeter
  • All grounds cables are correctly connected

If some devices need different timing, each PWM output might need to be configured separately to avoid conflicts. It will be good to test one device at a time to localize the issue.

Could you test using Ardupilot to help localize the issue?