Watch the last (4th) video for the actual flight at the filed, must say it went well.
I had to make a plan to find a way to deploy my landing gear of my 500 scale Airwolf with only a 6 channel DX6i radio.
I recently started to play with Arduino and I also got my hands on a sonar sensor. This would allow me to determine the Airwolf's altitude and then automatically deploy and retract the landing gear based on altitude.
Below is a short video demonstrating the prototype I have built.
Here is a test inside the Airwolf
Here is the final Product, installed in the Airwolf
And here is the actual test flight at the field today, must increase the hight at which the landing gear responds, but for the first flight it went very well. Currently it's at 40cm, might increase to 60m
Here is also a copy of the code that runs on the Arduino
#define trigPin 12
#define echoPin 13
#include <Servo.h>
Servo myservo;
int ServoPos = 0;
boolean IsGearDown = false;
void setup() {
myservo.attach(11);
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
void loop() {
int duration, distance, pitch;
digitalWrite(trigPin, HIGH);
delayMicroseconds(1000);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
if(distance != 0)
{
pitch = map(distance, 0, 150, 3000, 1000);
Serial.print(distance);
Serial.println(" cm");
tone(8,pitch);
delay(10);
noTone(8);
if(distance > 50) // In the Air
{
if(IsGearDown)
{
ServoPos = 0;
do{
myservo.write(ServoPos);
delay(10);
ServoPos ++;
}while(ServoPos < 91);
IsGearDown = false;//Gear is Up - Flying
}
}
else
{
if(!IsGearDown)
{
ServoPos = 90;
do{
myservo.write(ServoPos);
delay(10);
ServoPos --;
}while(ServoPos > 1);
IsGearDown = true;//Gear is Out - Landing
}
}
}
}
A couple things to note when using Ultrasonics to determine distance:
Sound reflection needs to come from a fairly flat and perpendicular surface.
The landing area will need to be fairly smooth and firm. In other words, grass landings may not produce the response you are looking for.
BTW, a smaller Arduino, such as the Mini or Nano will be smaller and lighter, but just as functional.
Log In to reply
As for using a Nano or Mini, I did buy one from a supplier I will not mention, but is was DOA , so I have no choice but to use the UNO for now. Will place another order from a more reliable supplier to get a Nano which should be able to handle this with ease.
Thanks for your advise once again.
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Note: I have not used any of these products.
@Sailor John - Don't feel too bad. The hobby electronics market kind of exploded in the last few years making this kind of thing easier and more accessible... kind of like the electric end of the R/C flying hobby. Up until recently, I thought it was too expensive to get into, but now I know it's not.
Log In to reply
Thanks for the info , I only started play with Arduino a month ago, so any new info is welcome, I will definitely look into the Teensy platform as well as the digispark one too.
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
You can also use the multiwii code for that, than it would be an interrupt driven sonar readout and PWM output. Speaking of that, you could also take the cheapest mwii board to run your project like this: http://www.hobbyking.com/hobbyking/store/__25094__multiwii_mini_flight_controller_w_ftdi_interface.html.
It also comes with a decent but outdated sensorset (Gyro/Acc) wich you don't need but you could use it to control a camera gimbal. It would also save some weight and space in your nice heli.
Anyway, keep up the good work
Cheers
Kraut Rob
Log In to reply
Log In to reply
Log In to reply
Any possibility?
Log In to reply
Log In to reply
ST10+. I already have the landing gear but need a system to a simple task as this. Can someone build me one with a charging fee for parts and labor? I see not mentioning of specific parts needed here. Please, please help!
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply
Log In to reply