Close

The Collision Detection System.

A project log for Collective Flight for Aerial Robotics

Development of a machine vision payload to allow aerial robots robust collision avoidance and advantageous collective flight formations.

mr-kar0sh1Mr kAr0sh1 04/16/2015 at 21:470 Comments

So much to tell, so little time!

My Final Year Project Open Day is fast approaching so I'm working rather quickly but I'm very confident I can get this done :)

Firstly, big thank you to the guys at Deviation, they've been a huge help and very supportive with working out the protocol of the previous drones I was using, and even suggesting a new drone to replace the previous - essentially, I did a maximum payload test with the UDI U818A and it tapped out just under 100 grams, far too low to give me any flexibility. So.......enter the Quanum Venture....

Ain't she a beaut?! I decided early on that this project was not meant to be about building just another drone, anyone with an Arduino and a desk fan can do that, I wanted to give people the option to make their drones so much more. The Quanum Venture I've gone for will have all the ESCs (motor controllers) and the Flight controller (an Afroflight 32, highly recommended and very open) prebuilt and ready to install, I can then send signals to the flight controller to act as the 'brain' of the aircraft and alter it's behaviour. That camera on the front will be switched out for my optical payload.

My most recent test of acquired hardware was the MB1200 Maxbotix Ultrasound sensors. They will make up the main part of my CAS (Collision Avoidance System) by giving the drone exteroception - allowing it to monitor the environment around it - and prevent it from crashing into anything directly in front or behind it. The MB1200s are absolutely the best choice I've seen so far for this sort of thing; they're industrial-grade, no-nonsense, long-range (about 7.5 metres up to 10) and very easy to interface to. Even if I flew my drone at full speed, roughly 30 mph, it'd still have half a second to react, and with a 72MHz microcontroller like the Teensy that's a really long time.

Above is my test rig, purely just to get the sensors up and running, however below is the STL of my angular offset rig - to allow me to test which offset will work best. Essentially the biggest problem I can foresee with this system is the dreaded 'blind spot' between the sensors. The human optical system manages this seamlessly but when dealing with an aircraft things need to be a little more definitive, so I'm being very careful with this factor, too closely angled and there will be too much overlap and having two sensors will become pointless, too little overlap and something could slip through the net and the drone could collide with it. This is meant to be a system designed for open air flight, not indoor, so traditional factors of angled surfaces etc don't exactly apply.

If you fancy picking up a couple of the MB1200 and building something similar, try my test code, just alter the values at the top according to how you wire yours and remember to read the data sheet first!

int left = 20; // left sensor analogue input
int right = 19; // right sensor analogue input
int rightcon = 10; // right sensor control pin
int leftcon = 7; // left sensor control pin
int led = 13; // indicator LED on dev board

void setup() {
  Serial.begin(115200); // begin the serial connection
  pinMode(rightcon, OUTPUT); // control pin for right ultrasound sensor
  pinMode(leftcon, OUTPUT); // control pin for left ultrasound sensor  
  pinMode(right, INPUT); // analog input from right sensor
  pinMode(left, INPUT); // analog input from left sensor
  pinMode(led, OUTPUT); // led
}

void loop() {
  digitalWrite(led, HIGH); // flash the LED
  
  digitalWrite(leftcon, HIGH); // activate the left sensor
  delay(20); // delay necessary to prevent 'cross reading' - see datasheet MB1200
  digitalWrite(leftcon, LOW); // turn off the left sensor
  int leftval = analogRead(left); // read value of left sensor

  delay(20); // delay necessary to prevent 'cross reading' - see datasheet MB1200

  digitalWrite(rightcon, HIGH); // activate the right sensor
  delay(20); // delay necessary to prevent 'cross reading' - see datasheet MB1200
  digitalWrite(rightcon, LOW); // turn off the right sensor
  int rightval = analogRead(right); // read value of right sensor
  
  Serial.print("Left sensor value: ");
  Serial.println(leftval);
  Serial.print("Right sensor value: ");
  Serial.println(rightval);
  digitalWrite(led, LOW);
}

Discussions