GithubHelp home page GithubHelp logo

Comments (5)

Vido avatar Vido commented on August 17, 2024

@felipesanches,

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.

Vido avatar Vido commented on August 17, 2024

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.

ramalho avatar ramalho commented on August 17, 2024

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-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.


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.

Vido avatar Vido commented on August 17, 2024
  • 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.

Vido avatar Vido commented on August 17, 2024

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:

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.