austinbv / dino

Dino is a ruby gem that helps you bootstrap prototyping with an Arduino
MIT License
388 stars 84 forks source link

Raspberry Pi + Dino #43

Closed nixpulvis closed 9 years ago

nixpulvis commented 11 years ago

This isn't exactly an issue. But I working on a project that involves controlling an Arduino that is doing very time sensitive discrete calculations with a RasPi. Has anyone tested Dino with a Raspberry Pi. If not, I'll post my findings here.

vickash commented 11 years ago

RasPi shouldn't be much different from other Linux boxes. Please do post your findings. How time sensitive are we talking here? What kind of precision?

nixpulvis commented 11 years ago

So the Arduino needs to handle flight stabilization for a quadrocopter. I estimate that means pulling in data from the IMU (Inertial Measurement Unit) and sending updated pwm signals at least 20 times per second, or something like that.

vickash commented 11 years ago

Sounds like fun. How does the IMU talk to the Arduino? Analog inputs or some other protocol?

20Hz should be easily doable unless it's a huge number of reads and writes. The listeners in version 0.11 will help with performance and consistency. It won't be exactly 50ms intervals, but you should have enough headroom to increase the frequency if the jitter is affecting performance.

I've been thinking of ways to incorporate RTC readings into sensor messages that get sent out on serial. This would provide higher precision, but the mere fact that you have to get the RTC time and more data has to go over serial reduces the frequency you can run at. So it would only make sense for really precise timing of longer intervals. I don't really see the application. In those cases you can just handle the timing on the host machine.

nixpulvis commented 11 years ago

The IMU to Arduino communication hasn't been nailed down, since the IMU is still in the mail.

I'm not worried about time. I worried most about response time from the Pi sending a command to the Arduino receiving and processing it. I'm mostly concerned with the overhead of Dino effecting the stabilization loop. I was planning on hacking that into the C, since doing the full loop to a host seems crazy.

vickash commented 11 years ago

How many write commands does the Pi need to send to the Arduino for each 50ms period?

On Thursday, May 23, 2013 at 2:44 PM, Nathan Lilienthal wrote:

The IMU to Arduino communication hasn't been nailed down, since the IMU is still in the mail. I'm not worried about time. I worried most about response time from the Pi sending a command to the Arduino receiving and processing it. I'm mostly concerned with the overhead of Dino effecting the stabilization loop. I was planning on hacking that into the C, since doing the full loop to a host seems crazy.

— Reply to this email directly or view it on GitHub (https://github.com/austinbv/dino/issues/43#issuecomment-18363494).

nixpulvis commented 11 years ago

At the moment the spec it looking like a pitch, roll, yaw, and power value (int16s). I'd love to poll IMU data to the PI as well, That doesn't need to happen as often. I'm trying to design this so it's expandable though. So assume a few more values.

To make the control feel smooth and responsive I'd like to smooth directional changes at the Arduino level for the duration of the message heartbeat, and then minimize the heartbeat to something like 50ms.