Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Triying to control a servo with PWM

Featured Replies

Hello. I am trying to control a servo, and after a lot of mistakes and hits in the face... finally i can move it with WiringOP (https://github.com/zhaolei/WiringOP)

I use one of the examples called servo.c and the servo moves to one side and another. This is the first step, but the servo makes weirds movements. Watch this video.

Any iddeas why? Any other way to control a servo?

I am not C expert, some way to do it with Python?

Thank you very much in advance.

servo.c

The "weird" moves are because the pulse to the servo has a lot of jitter.  It is very hard to do time critical processes like servo pulses in Linux. 

  • Author

But Raspberry can manage it perfectly... I tried with WiringOP, WiringBP compatible con Banana Pi, orangepi_PC_gpio_pyH3... I think is more a library problem than a Linux problem.

Can the Raspberry 'manage it perfectly' on any pin, or just one? As IIRC, the rPi has one dedicated PWM capable pin, which should be stable... not sure about the oPi? I'm not saying there aren't  library, hardware and configuration differences that could be causing the problem, just that I know that is one possible reason for this variance. 

  • Author

Orange Pi have a pin called PWM1 (PA6 - pin number 7) so it must be able to manage PWM. In script.bin configuration file it can be enabled and disebled... So must be possible. Still looking for a way to do it. Thank you guys.

  • Author

Yes, PA5 is the middle pin of the serial debug port. I can move "weirdly" the servo from PA6, this pin of the serial debug port and pin 10, but i can not control the tremor movements...

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.