hey Alex,
i'm working on enabling the parallax/seedstudio ultrasonic sensor for altitude hold.
http://www.seeedstudio.com/depot/ultra- ... p-626.html
http://www.parallax.com/Store/Sensors/O ... fault.aspx
so far, the module code is working using interrupts (PCINT10) and is integrated into the main loop to sample once every 50ms.
a couple of questions:
- what is your expected range for altitudesmooth? i don't have the bmp085 so i don't know what that sensor is supposed to return. multiwiiconf seems to use a limit of 300, which i thought has relatively low resolution (9 bits vs the potential 16 bits for altitudesmooth). is the intended range for the sensor output for altitudesmooth 0-300?
- the current baromode altitude hold algorithm is p=5 (not PID), do you plan to incorporate PID control eventually?
thanks!
enabling ultrasonic sensor and altitude hold
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: enabling ultrasonic sensor and altitude hold
Hi,
I plan to implement a PID with a mix between Z ACC and baro values.
I still don't know precisely how. (not enough time these days)
Currently, on the GUI, one unit = 10cm.
I plan to implement a PID with a mix between Z ACC and baro values.
I still don't know precisely how. (not enough time these days)
Currently, on the GUI, one unit = 10cm.
Re: enabling ultrasonic sensor and altitude hold
Alexinparis wrote:Hi,
I plan to implement a PID with a mix between Z ACC and baro values.
I still don't know precisely how. (not enough time these days)
Currently, on the GUI, one unit = 10cm.
Use the same Kalman filter for one axis only in witch Baro readings are interpreted as ACC input and Z ACC interpreted as giro input.
-
- Posts: 5
- Joined: Sun Feb 27, 2011 12:22 pm
Re: enabling ultrasonic sensor and altitude hold
At the risk of taking the fun obtained by working it out for yourself away,
the following link provides some useful information on fusing accelerometer
and barometric data:
http://diydrones.com/profiles/blogs/imp ... e-estimate
This is only the sensor fusion aspect, the PID aspect is separate. I guess altitude hold
without stick input is reasonably straightforward, but I imagine altitude hold during
forward flight would be rather tricky as changing the throttle to adjust altitude
would also affect the forward velocity. I guess without a velocity sensor (e.g. GPS)
it won't be possible to maintain both constant altitude and constant velocity.
the following link provides some useful information on fusing accelerometer
and barometric data:
http://diydrones.com/profiles/blogs/imp ... e-estimate
This is only the sensor fusion aspect, the PID aspect is separate. I guess altitude hold
without stick input is reasonably straightforward, but I imagine altitude hold during
forward flight would be rather tricky as changing the throttle to adjust altitude
would also affect the forward velocity. I guess without a velocity sensor (e.g. GPS)
it won't be possible to maintain both constant altitude and constant velocity.
Re: enabling ultrasonic sensor and altitude hold
OpticalFlow wrote:At the risk of taking the fun obtained by working it out for yourself away,
the following link provides some useful information on fusing accelerometer
and barometric data:
http://diydrones.com/profiles/blogs/imp ... e-estimate
This is only the sensor fusion aspect, the PID aspect is separate. I guess altitude hold
without stick input is reasonably straightforward, but I imagine altitude hold during
forward flight would be rather tricky as changing the throttle to adjust altitude
would also affect the forward velocity. I guess without a velocity sensor (e.g. GPS)
it won't be possible to maintain both constant altitude and constant velocity.
cool! thanks for the link! it was really helpful.
i was reading up about kalman filters and my eyes just glazed over there is a nice code example in the web, but this one is straightforward and easier to understand.
have not added pid control yet. so far, using P only leads to oscillations even if i constrained the throttle changes.
also plan to disengage altitude hold if the copter is tilted too much.
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: enabling ultrasonic sensor and altitude hold
At the risk of taking the fun obtained by working it out for yourself away, ...
Don't worry, my aim is to bring the best I can find, from my brain or from other open place, I don't care
One more example of open source power:
I discovered today this video:
http://vimeo.com/20764213
This man is a genius: he took my code, improved it, made a demonstration, and shared it.
This is exactly what I expected when I decided to release and share the code.
-
- Posts: 5
- Joined: Sun Feb 27, 2011 12:22 pm
Re: enabling ultrasonic sensor and altitude hold
He's been posting a fair bit on diydrones, it appears he's been building pretty much every VTOL kit that's out there,
KK multicopter, MultiWii, nVader and a few others - so far I didn't have the impression he did his own development though.
To be honest, I couldn't quite gather what he did based on the video. Did he share his modified code for altitude hold?
Also, he seems to live in your neck of the woods.
KK multicopter, MultiWii, nVader and a few others - so far I didn't have the impression he did his own development though.
To be honest, I couldn't quite gather what he did based on the video. Did he share his modified code for altitude hold?
Also, he seems to live in your neck of the woods.
Re: enabling ultrasonic sensor and altitude hold
i have simple code for interrupt-based sampling for 1-pin and 2-pin ultrasonic sensors (tested for 1-pin). currently reporting raw altitude in cm (instead of decimeter) since i think it has better resolution than the barometric sensor.
i can post the code if anyone is interested. after this, i'm planning to get some PID control working for altitude hold and also fuse with the ACC sensor (thanks to OpticalFlow's link).
i can post the code if anyone is interested. after this, i'm planning to get some PID control working for altitude hold and also fuse with the ACC sensor (thanks to OpticalFlow's link).
Re: enabling ultrasonic sensor and altitude hold
To be honest, I watched the video but I cannot see what is so wonderful. He was not holding altitude but was still going up and down. Leveling on the other hand looks pretty good. Couldn't find the code he alleges to have shared either.