Comments (5)
As we talked on Garoa,
We have plans to support PPM signals and Servos. But we are not sure, how this could be done.
To make a Servo work on each particular board is easy. However, to write a one-size-fits-all code is not so easy.
We could consider two options:
- A Pin can write and read a PPM signal. We code have just write for now, and think about read later.
- A Servo (from pingo.parts) uses a PWM pin to send a PPM signal.
There is almost a discusion on how to implement more Pin's functions:
https://groups.google.com/d/msgid/pingo-io/5a51d463-b853-4dfc-8da6-ffb93dd09577%40googlegroups.com?utm_medium=email&utm_source=footer
Maybe @ramalho could dispense some wisdom on this issue.
That's all folks.
from pingo-py.
After some googling:
Board | Servo support Status |
---|---|
Arduino | Firmata Prototocol suports Servos, so does PyMata |
Raspberry | RPI.GPIO does not support Servos. It can be implemented via software with PWM http://razzpisampler.oreilly.com/ch05.html . Occidentalis v0.2 distribution support on GPIO#18 |
pcDuino | Support it via Arduino IDE or via pwm-sunxi Kernel Module with some PWM hack. |
BeagleBone Black | Adafruit_BBIO and some PWM hack. https://learn.adafruit.com/controlling-a-servo-with-a-beaglebone-black/writing-a-program |
Galileo | Via Arduino IDE, or PWM hack https://github.com/mikalhart/galileo-Servo |
There is a recipe to get a Servo working on a PWM signal.
- Set your PWM frequency to 50Hz (to match the 20ms Servo's period)
- A duty-cycle of 2.5% represents 0.5ms, which is 0º for a Servo.
- A duty-cycle of 12.5% represents 2.5ms, which is 180º for a Servo.
We need to test it.
from pingo-py.
Good research, thanks @Vido!
On Wed, Nov 26, 2014 at 4:37 PM, Lucas Vido [email protected]
wrote:
After some googling:
Board Servo support Status Arduino Firmata Prototocol suports Servos,
so does PyMata Raspberry RPI.GPIO does not support Servos. It can be
implemented via software with PWM
http://razzpisampler.oreilly.com/ch05.html . Occidentalis v0.2
distribution support on GPIO#18 pcDuino Support it via Arduino IDE or
via pwm-sunxi Kernel Module with some PWM hack. BeagleBone Black Adafruit_BBIO
and some PWM hack.
https://learn.adafruit.com/controlling-a-servo-with-a-beaglebone-black/writing-a-program
Galileo Via Arduino IDE, or PWM hack
https://github.com/mikalhart/galileo-ServoThere is a recipe to get a Servo working on a PWM signal.
- Set your PWM frequency to 50Hz (to match the 20ms Servo's period)
- A duty-cycle of 2.5% represents 0.5ms, which is 0º for a Servo.
- A duty-cycle of 12.5% represents 2.5ms, which is 180º for a Servo.
We need to test it.
—
Reply to this email directly or view it on GitHub
https://github.com/garoa/pingo/issues/53#issuecomment-64691479.
Luciano Ramalho
Twitter: @ramalhoorg
Professor em: http://python.pro.br
Twitter: @pythonprobr
from pingo-py.
- Erin (@Lana-chan) and Gabriel asked about this.
- Marcos from Telefonica asked too.
- Oda wants to build a PayPal paid foosball
So folks this feature is top priority.
from pingo-py.
Last Sunday, I was working on the "Nativity scene" software.
And I used a I2C PWM driver http://www.adafruit.com/datasheets/PCA9685.pdf
Although it is a "LED controller optimized for LCD Red/Green/Blue/Amber (RGBA) color backlighting applications", you can drive servos.
It provides a 12bits (4096 states) duty cycle. Here is the math:
At 50Hz, we have a 20ms period.
0º is 0.5ms -> 20ms/0.5ms = 40
4096 / 40 = 102.4 ~ 103
90º is 1.5ms -> 20ms/1.5ms = 13.3
4096 / 13.3 = 307.9 ~ 308
180º is 2.5ms -> 20ms/2.5ms = 8
4096 / 8 = 512
Yes, this trick works. Any board with a setable PWM frequency, with at least 40 states, will work
So far:
- There are some libraries that support servos: eg. PyMata (https://github.com/MrYsLab/PyMata/blob/master/examples/servo/servo_demo.py)
- Most of Pingo's drivers have no support.
Should Servo be a pingo.parts or should it be a Board.mode?
Well, if it's implementation hangs upon each Board, we can't have it as pure pingo.parts.
If a code is Board specific, than it should be within it's own Board driver.
From this point of view, it makes sense to have a SERVO mode.
from pingo-py.
Related Issues (20)
- Support WRTnode
- raise ArgumentOutOfRange() missing apropriated value
- The GPIOs of Galileo2 only have location, they not have gpio_id HOT 1
- PWM on broken on Arduino HOT 1
- test_jumpwire fails on my Raspberry Pi 2 model B HOT 3
- New to pingo, can't get it working ! HOT 2
- Create a Debian package and submit to mentors.debian.net HOT 2
- Version on Pypi differs to tag version in github HOT 1
- Automagically create mocks (fakes) when the app is running outside a board HOT 5
- Switch / Push button : short pressed / long pressed events
- Pingo, MQTT and IoT
- Python 3 support HOT 2
- board = pingo.detect.get_board() or board = pingo.detect.MyBoard() ? HOT 1
- time to sleep should be configurable
- Switch / led parts : stop blinking led should fallback to previous led state (before blinking)
- Using a signal / slot pattern for parts ?
- Parts Swich (or PushButton?) without polling task HOT 6
- Pingo and RPi-Distro/python-gpiozero HOT 4
- Failed to detect HOT 2
- Is there any preview for getting Pingo in Python 3.5 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pingo-py.