System Identification of Multi-Rotor UAV’s using Echo State Networks

System Identification of Multi-Rotor UAV’s using Echo State Networks

Conference paper.

@ AUVSI’s Unmanned Systems 2015. At Atlanta, USA.

Abstract:

Controller design for aircraft with unusual configurations presents unique challenges , particularly in extracting valid mathematical models of the MRUAVs behaviour. System Identification is a collection of techniques for extracting an accurate mathematical model of a dynamic system from experimental input-output data. This can entail parameter identification only (known as grey-box modelling) or more generally full parameter/structural identification of the non-linear mapping (known as black-box). In this paper we propose a new method for black-box identification of the non-linear dynamic model of a small MRUAV using Echo State Networks (ESN), a novel approach to train Recurrent Neural Networks (RNN).

3-quad

 

Full text.

AUVSI – part 2

AUVSI – part 2

Some more pictures about this great show, enjoy.

 

AUVSI – part 1

AUVSI – part 1

Unmanned Systems 2015 convenes the largest global community of commercial and defense leaders in intelligent robotics, drones and unmanned systems, powered by AUVSI.

On May 4, 2015, every domain — air, ground and maritime — and industry, from agriculture and construction to energy and academia, will converge under one roof to shape the future through shared thought leadership and technology innovations.

So, I came to Atlanta, GA, USA to present some part of my research (which I’ll blog later…) and I’ll show some of the awesome pictures and stuff I have seeing in this expo…

The place is huge!

IMG_2283

 

 

Sikorsky UH-60 Black Hawk (optionally piloted… :P)

IMG_2296

 

NASA Greased Lightning

 

KMAX

 

 

 

RMAX

 

Several other mixed stuff:

Flying in Scotland

Flying in Scotland

Scotland needless to say is an awesome and beautiful place. I love living here, and its one of my favorite places in the world!!! Just take a look at this picture I took from Beinn Narnain (a mountain in the southern Highlands of Scotland, near Arrochar):

1237341_10152602187096808_383323743_o

 

That does not mean is a ideal place to fly/test MRUAV’s…

There is 365 days in a year and 4 seasons throughout the year. This DOES NOT apply in Scotland.

In some days you can have the entire 4 seasons in a couple of hours, and this is not a joke! 15 min of rain, 10 of sun light, 20 of snow and so forth…

I’ve being here for like close to 3 years, and of course I fly, or try to fly all the time, and weather is not my friend.

This type of weather conditions make me crash a lot… Also I learn a lot about “handling” wind gusts and lots of similar weather stuff, making it 10 times more difficult than for example, flying in Mexico, hehehe.

Handling rain sometimes is not a great deal, if you FC, GPS and battery are properly protected (not exposed) then you can fly with a bit of drizzle.

Wet conditions while flying
Wet conditions while flying (photo by Tania Ortega)
  • Camera: Canon EOS DIGITAL REBEL
  • Focal length: 43mm
  • ISO: 400
  • Shutter speed: 1/25s
Wet tablet and radio
Wet tablet and radio

The main problem is about wind gusts… Scotland is windy…

I have tried my hexacopter with winds of speed 25kph and I can fly it safely. The problem is that after 10 meters of altitude, the wind gusts can be very different, they might be slower or faster. This makes loiter mode or auto mode to do crazy stuff and of course, crash.

This is my latest crash.

It’s a bit depressing every time you need to rebuild your vehicle due to a weather crash. But, don’t you worry…

WE WILL REBUILD.

 

Pescado Zarandeado

Pescado Zarandeado

This is a odd post (in comparison to all my other posts) but I think it deserves to be shared. Recently I did a small trip to Mexico, just because I was already on the continent, due to the AUVSI conference.

I was able to do a small trip with my lovely parents and as food lovers, we cannot skip making some stops and try the traditional “Pescado Zarandeado”.

The literal translation of “Pescado Zarandeado” to english is something like “Jostle fish”… I’m not sure if this translation is really accurate, the word zarandeado in spanish is to shake something, but this fish is not shaken… so, its weird that the name is like that. Anyhow, I’ll try to explain the process (at least the part I saw, the chef seem to be stressed when I ask questions and take pictures…)

We tried two versions, both in the state of Nayarit, the first one was at “Punta de Mita” which is a 1,500-acre beachfront village located on the north end of Banderas Bay in the Mexican state of Nayarit, about 10 miles north of Puerto Vallarta, Jalisco.

The easiest way to describe it is just grilled fish… as simple as that, but it gets rather complicated, because factors like a specific type of wood changes the flavour of the fish at the end.

In the first one, they used Worcestershire sauce (apparently…) to marinate as well as salt, then they add their special several chiles sauce (which apparently is a secret) and then the put it in the grill and let it cook to perfection, needless to say, its a awesome awesome thing to eat!

And the result looks something like this (after some eating, sorry…):

IMG_2510

 

The second one (and the favourite of all times for my family), its a little more complicated to find, its a place called “Playa de Platanitos” which is located in the Nayarit Riviera, and the exact place is here. It’s a lovely restaurant with integrated pool and a great great view.

IMG_2539
Playa Platanitos

This is a very similar version, but apparently they use Maggi sauce, which is a dark, soy sauce-type hydrolysed vegetable protein-based condiment sauce. In Spain and Mexico, it is sold under the name Jugo Maggi.

They marinate with Jugo Maggi, sea salt and pepper, just that. Then they start to grill… and apparently just at the very end, they add a little of their special chile sauce, I wasn’t able to confirm that and take pictures because people is afraid of me stealing their cooking secrets, hehehe, fair enough.

And then the result is something like these:

IMG_2552

 

And after eating it looks something like this:

IMG_2553

 

I’ll try to do my own version and will post my results.

 

Retractable landing gear

Retractable landing gear

AlduxHexa got a little update today!

I had a small hard landing the other day due to wind conditions (Scotland weather as usual…), so I was in the necessity to buy some extra parts and I decided to get some electric retractable landing gear set, from Tarot, the same company that made AlduxHexa’s frame. This company make really nice carbon fibre parts BTW…

Hexa in my legs with landing
Hexa in my legs with landing

The landing gear is not very expensive, its easy to install (fit my Tarot Iron Man 680 very nicely).

Pros:

  • Cheap
  • Easy fit with several 650-690 frames
  • Secure fit

Cons:

  • Servo cable is thin and short
  • Motors appear they cannot carry to much weight (to be proven…)
  • A bit of “play” when moving the arm, looseness…

It works like a normal/regular servo, I have them hooked up to my gear port on my 9XR, so, anytime I hit the gear switch they will fold or unfold.

Here is the video of the new landing part in action:

Building a quadcopter

Building a quadcopter

in under two hours!!!

 

This is a small post on how to build a quadcopter. I know there is tons of similar posts on the web, but anyhow I wanted to share with you my experience while building one.

This particular build is a one of our research work-horse/test-bed quadrotor that I build for the MAST Lab. I was in need of a twin brother of my actual quad, to test different FC with different companion computers. I’m actually using a Raspberry pi B+ and Raspberry pi 2, as companion computers, and a PX4 and a MultiWii AIO for flight controllers (I’ll explain later). I have built close to 20 vehicles (perhaps…), and rebuild twice as that… that’s why it took me like a hour and a half from disassembled parts to flying.

What is a quadcopter?

 

In few words, it’s a vehicle that is lifted and propelled by four rotors. Its also called quadrotor, quadcopter, multicopter, multirotor helicopter, rotorcraft, MRUAV (multi-rotor unmanned aerial vehicle), etc…

The lift in multicopters is generated by two sets of identical fixed pitched vertically oriented propellers; two clockwise (CW) and two counter-clockwise (CCW). These use variation of RPM to control lift and torque. Control of vehicle motion is achieved by altering the rotation rate of one or more rotor discs, thereby changing it’s torque load and thrust/lift characteristics.

FBD
FBD

Ingredients:

 

  • Tools (tweezers, screwdriver set, small knife)
  • Frame
  • Motors (4)
  • ESC (4)
  • Propellers (2 CW and 2 CCW)
  • Cables
  • Radio with rx/tx module
  • LiPo battery
  • Flight controller
Quadcopter Ingredients
Quadcopter Ingredients

Then the rest of the recipe is mix all ingredients together and in a hour you will have a quadcopter flying around!! 😀

The frame I choose for this built is a very cheap 330mm glass fiber frame, the size is 330mm which means there is 33 centimeters from rotor to rotor. This frame is about £6. I bought several of this one due to the price, but they break quite easy, you’re now warned!

The motors I had are some SK3 1130kv, this ones have a max power of 125 watts, which is quite nice, pretty powerful small motors! They are brushless.

What is a brushless motor?

 

Also called BLDC motors or BL motors are synchronous motors that are powered by a DC electric source via an integrated inverter/switching power supply (most commonly know as electronic speed control), which produces an AC electric signal to drive the motor. Brushless DC motors have many advantages over their brushed DC motor counterparts. The most obvious advantage of a brushless motor is its lack of brushes and physical commutator. This difference means that there are many fewer parts that can wear out or break and need to be replaced than in a brushed motor.

Brushless motors, otherwise called outrunners or inrunners, have become very popular with radio controlled airplane hobbyists because of their efficiency, power, longevity and light weight in comparison to traditional brushed motors.

Two key performance parameters of brushless DC motors are the motor constants Kv and Km. Kv being the most popular one. Kv is RPMs per volt, the higher kv motor is faster because at the same voltage it will be spinning a higher rpm. The motors used in this build are 1130 kv, and my battery is 11.1 volts, so:

1130 x 11.1 = 12,543 RPM

This motor will turn at 12,543 revolutions per minute when I give them 11.1 volts… This kv is adequate for this type of build, I will not go into more detail about this (for now…)

SK3 1130kv
SK3 1130kv

The first step is fixing the motors to the frame arms, as showed in the next pictures:

The next step is to put all the screws in place to finish putting the frame together. You will have something like this:

Frame done with motors.
Frame done with motors.

What is a ESC?

 

A electronic speed controller is a integrated inverter/switching power supply that will drive BL motors (as stated before…). Brushless ESC systems basically drive tri-phase brushless motors by sending a sequence of signals for rotation. For this built I had laying around 4 Multistar 20amps (maximum) ESC, these are cheap as well, and it will update at 480 Hz.

The default output rate in the RC industry is 50 Hz. The recommended output rate for multicopter ESCs is 400 Hz, in order to minimise latency (NOT because the outputs would require 400 Hz, as multicopter rotors spin only at 80-120 Hz and can’t change speed multiple times during a single revolution). Having 400 Hz or 480 Hz will make the response of the vehicle a lot smoother  and nicer.

So, go ahead and place those 4 ESC in your frame, and fix them using cable ties or something similar:

IMG_2161

Its important to notice that I’m using a power distribution board, which is just a breakout board with bullet connectors, that will save me the hassle of soldering all cables together, because the power to the ESC must be the same for all of them. You can choose not use it and use a joined cable or something similar.

This is the bottom of the quadcopter with the ESC connected to the distribution board and the motors connected to the ESCs:

IMG_2162

Then the next step is to fix you flight controller… The FC must be close to the center of gravity (CoG), and the must important part is that we need to isolate it from vibrations as much as possible. I usually 3D print a couple of plates and use special cheap rubber balls.

As explained in the beginning of the post, this build is for my research lab, and I’m using the FC with a onboard computer, which makes everything larger…

I’m testing several flight controllers and different architectures, thats the purpose of having two (or more) twin quadcopters, that will behave in a similar way. But thats another story, lets keep on building.

I will join to steps into one, fixing the FC and the props.

What is a fixed pitch propeller?

 

A propeller is a type of fan that transmits power by converting rotational motion into thrust. A pressure difference is produced between the forward and rear surfaces of the airfoil-shaped blade, and a fluid (such as air or water) is accelerated behind the blade.

“Pitch” describes how much the blade of the propeller is twisted relative to the path it travels as it turns. This is also known as the angle of attack, and is usually measured in inches. Imagine the propeller turning through the water or air. If it moves forward following the angle of the pitch perfectly, and moves forward 10 inches in one full revolution, it is said to have a pitch of 10 inches.

So, if we combine the two definitions, a fixed pitch propeller is a type of prop that cannot be adjusted or changed. It has one pitch, which is usually a compromise between speed and power.

For this quadcopter I’ll be using a 3 blade 7×4.5 (7 inch in diameter with 4.5 in pitch) in plastic, of course in their CW and CCW form, this is also called R (right) and L (left) prop.

Quadcopters can be configured in + (plus) configuration or X (cross) configuration, the props will need to be installed in this manner for each configuration:

+ and X configuration
+ and X configuration

Personally, I prefer the X configuration and its the one I use in all of my quads.

What is a flight controller?

 

This is a topic that could easily extend a lot… But a quick definition would be something like this: Small computer that contains accelerometers, giroscopes, magnetometers and a barometric pressure sensor, that will use this sensors to maintain the vehicle level by sending PWM commands to the ESC.

In a perhaps more practical way, is a computer that will help us to fly a multirotor. The one for this quad is a MultiWii AIO v2 board, that uses a ATMEGA 2560, which is a popular micro-controller because is onboard of Arduinos!

The brain of this flight controller is a high-performance, low-power Atmel 8-bit AVR RISC-based microcontroller combines 256KB ISP flash memory, 8KB SRAM, 4KB EEPROM, 86 general purpose I/O lines, 32 general purpose working registers, real time counter, six flexible timer/counters with compare modes, PWM, 4 USARTs, byte oriented 2-wire serial interface, 16-channel 10-bit A/D converter, and a JTAG interface for on-chip debugging.

And the sensors are this ones:

  • MPU6050 6 axis gyro/accelerometer with Motion Processing Unit
  • HMC5883L 3-axis digital magnetometer
  • MS5611-01BA01 high precision altimeter

Which is also another topic of conversation… but perhaps later.

Its important to notice that without software the above hardware is useless… This FC uses the MultiWii software, which is very popular, easy to change (sometimes) and written in C, well in the Arduino language/IDE.

The configuration of the FC is rather easy, opening the Arduino IDE and the MultiWii.ino file, in the config.h file, we need to setup that this vehicle is a quadcopter in X configuration, the minimum PWM for our ESC, the radio type we have and so forth… This is covered in detail on the MultiWii manual.

After programming and mounting the FC unit, we need to test if the motors are turning in the right direction, we can easily change the direction of the motors, by moving one side of the 3 cables of the ESC/Motor to just another position. More easily explained… if the air is going upwards instead of downwards, them change the position of one of the cables. This needs to be done being very careful. Remember that props rotating a 10000 rpm are super dangerous.

Fixing motor directions
Fixing motor directions
This are the cables that might need to be adjusted if the direction is not right.
These are the cables that might need to be moved if the direction is not right.

Once this is completed…. oh!!!! I forgot to take pictures when installing the RX… but for that one you just need to plug channel 1 of the RX to the channel 1 port on the FC and so forth.

And now you have a ready to fly quadcopter!!!

Ready to fly!
Ready to fly!

And now whats next is to actually perform a test flight, the best idea is just to hover the vehicle at 10-20 cm from the ground and check that everything is okay, then slowly check that the roll and pitch commands are not inverted and that the vehicle is responding nicely and smooth. Remember, flying is everything about small corrections.

First hover
First hover

Congratulations! you just succeed to create something that flies.

Look at the twins:

IMG_2177

 

And more close ups:

 

Thanks a lot for reading!

 

Dropping wrong payload

Dropping wrong payload

While doing some tests with my hexacopter at 20 meters of altitude, my incorrectly secured enormous battery failed at being part of the vehicle and decided to plummet down towards earth at impressive speed, the hexacopter of course was trying to catch the battery, but only did it when they where both at the ground.

An excellent example of a face-palm moment.

Secure your batteries properly, and remember to fly safe!

 

NoIR camera onboard drone

NoIR camera onboard drone

The RPI (Raspberry Pi) camera is a great module (and cheap) to be playing about with… I have in specific a PI NoIR camera, which is the same as the camera module, with the modification of not having an infrared filter, which will make the photos/videos look decidedly curious.

I want to use this camera to do some NDVI geo-maps at a affordable price tag, and also because is fun.

What is NDVI?

NDVI stands for Normalised Difference Vegetation Index. Live green vegetation absorbs visible light (solar radiation) as part of photosynthesis. At the same time plants scatter (reflect) solar energy in the near infrared. This difference in absorption is quite unique to live vegetation and provides a measure of the greenness of the vegetation.

NDVI is an index which measures this difference, providing a measure of vegetation density and condition. It is influenced by the fractional cover of the ground by vegetation, the vegetation density and the vegetation greenness. It indicates the photosynthetic capacity of the land surface cover. Its value is always between -1 and +1. Higher values are associated with greater density and greenness of the plant canopy, soil and snow values are close to zero, while water bodies have negative values.

Modifying the PI NoIR camera lens

The standard lens provided in the camera is not good for my application, therefore I need to change the lens, the camera module will match with the sizes of CCTV cameras, and you can get different lenses ranging from $10 – $20 USD, maybe even more if you get one with auto focus… I’m using a standard zoom lens of 16mm.

The process is as follows:

  • Remove the cable from the camera module, then
  • Remove the lens connector (yellowish ribbon with “sunny A1014” info)
  • Peal the lens assembly off the board (its only stuck on with an adhesive pad)
  • Unscrew the lens from the assembly
  • Place the body of the CCTV lens in the camera module (don’t touching the array and don’t get dust into the module sensor, its exposed!)
  • Use screws to secure the CCTV lens (they do not exactly match, but it can be done carefully…)
  • Screw new lens on the CCTV base receptor
  • Use “raspivid -t 0” to adjust the zoom (screw or unscrew) until you see a sharp image…

Its important to notice that depending on the zoom size, the adjusting in the last step will only work (be sharp) at certain distances… My setup work’s from 8-20 meters, if out of that range the images will look blurry.

We also designed (my outstanding designer girlfriend and me :P) a GoPro mockup to be able to fit this camera on any standard GoPro gimbal laying around. My Tarot T-2D works awesome for this step:

Mounted on Tarot T-2D gimbal
Mounted on Tarot T-2D gimbal
Alduxhexa with NoIR ready to fly
Alduxhexa with NoIR ready to fly

Then I proceeded to make a small shell script to record videos using the great raspivid command, here you go:

[bash title=”Record timestamped videos using raspivid”]
#!/bin/bash
echo "Starting recording…"
sleep 2
while true ; do
DATE=$(date +"%d_%H_%M_%S")
if raspivid -o /home/pi/videos/$DATE.mp4 -w 1280 -h 720 -n -t 100000 -vf ; then
echo "Video "$DATE".mp4 saved"
else
exit
fi
done
[/bash]

I’m recording timestamped videos with duration of 100 seconds, just in case power goes or something fails, its better to have something than not having videos… You don’t need the echos but they help when you’re debugging. Using this script running every time the rpi boots up, you will end up with very nice videos, similar to this next video:

 

How to invite people to dinner

How to invite people to dinner

I was searching for some important e-mails when I found this beauty I wrote a couple years ago….

Lovely geek invitation
Lovely geek invitation

Needless to say very few people understood it… So, let me explain a bit about this…

When you’re the new PhD student at Glasgow Uni, your duty is to organice the winter dinner with all the staff and PhD students… So, you need to coordinate everyone, search the place, book it and that kind of malarkey.

But me, being who am I… decided to go a bit further and write the initial invitation email in a “geek way “, which I thought everyone or most likely everyone was going to understand it… This was not the case.

I love science fiction movies, and one of my favourite ones is “Alien” from Ridley Scott, and in this movie one of the characters is a computer… MU-TH-UR 6000, commonly referred to simply as “Mother“, was the computer mainframe aboard the USCSS Nostromo (the space ship). Mother operated many of the ship’s background systems, and auto-piloted the vessel while the crew were in hypersleep. It was also programmed to wake the crew during the voyage should certain situations arise. Take a look at the output interface of Mother from the 1979 movie:

So, my email had the idea to appear a bit similar to Mother from Alien. The results were catastrophic… people thought my email was made by a “bot” or it was spam… People these days right??  The GPS coordinates were actually the ones for the restaurant.

At the end I had to resend a regular email and then people started to reply.