autorope / donkeycar

Open source hardware and software platform to build a small scale self driving car.
http://www.donkeycar.com
MIT License
3.15k stars 1.3k forks source link

Feature request - Servo control via PPM instead of I2C #107

Closed dlarue closed 7 years ago

dlarue commented 7 years ago

There have been some comments about swapping in/out the stock RC controller and since there are only 2 servo controls used( steering / throttle ) an Arduino could do this. But since the rPi has only 1 hardware PWM, it would be more efficient to stream the servo control via a single PPM stream. This way an Arduino could decode the PPM and drive the servo's. And with a single digial I/O flag/pin the Arduino could read and use the stock RC receiver signals for training.

zlite commented 7 years ago

That's what we do with OpenMV, and the Arduino allows both multichannel PWM output and a wide range of inputs (analog, digital, serial, etc). We implement Firmata https://www.arduino.cc/en/Reference/Firmata on the Arduino side, and recommend that be used as the the middleware standard for I/O.

A standard Arduino Pi ha http://www.robotshop.com/en/arduino-adapter-raspberry-pi.html?gclid=Cj0KCQjwn6DMBRC0ARIsAHZtCeOvuKO5HPcGp-gxiCQi4-hXyDFFxUjqCWcjBu6Y631-Ygxw_Lki9d0aAnN7EALw_wcBt can work, although a custom shield like we designed for the OpenMV https://circuits.io/circuits/4446963-openmv-arduino-shield simplifies the wiring.

On Mon, Aug 7, 2017 at 3:11 PM, Doug LaRue notifications@github.com wrote:

There have been some comments about swapping in/out the stock RC controller and since there are only 2 servo controls used( steering / throttle ) an Arduino could do this. But since the rPi has only 1 hardware PWM, it would be more efficient to stream the servo control via a single PPM stream. This way an Arduino could decode the PPM and drive the servo's. And with a single digial I/O flag/pin the Arduino could read and use the stock RC receiver signals for training.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wroscoe/donkey/issues/107, or mute the thread https://github.com/notifications/unsubscribe-auth/AABGl6iIHpIFR0jDnXtPNSra3dWrIS7Eks5sV4uKgaJpZM4OwAss .

-- ◤CHRIS ANDERSON https://twitter.com/chr1sa CEO 3DR website http://www.3dr.com/ | twitter https://twitter.com/3drobotics | facebook http://www.facebook.com/3drobotics | instagram http://www.instagram.com/3drobotics

dlarue commented 7 years ago

The more I thought about it, I think keeping I2C from the rPi makes sense since all I'm looking to do is add simple RC control back and if I can do it with a $3 ProMini and replace the Servo Driver($12) too then it's a feature improvement and cost cutter. The RC control could also enable a remote kill switch via a 3rd channel.

As for adding sensors, an Arduino with Firmata sounds interesting. I'm only familiar with Firmata by using it with Snap4Arduino(Scratch for Arduino). And idea to keep in the back pocket. Thanks.