Do you think quadcopters are cool?
I don't.
But do you know what I think is cool?
ESP8266's.
BAM out of focus.
These little guys, like that one right there are a processor with integrated wifi.
I've done a couple videos on them and I think they are the best thing since sliced bread.
So cool that they'll make up for how cool I don't think quadcopters are.
Right here I made a little board that has an IMU, LSM9DS1, BMP805 Barometer, this is
a little AVR that can talk I2C and it can output to these motor controllers...
This board doesn't have them populated, but the one that I put inside this quadcopter
does.
I now have it so I can link up to it and it's creating a little wifi access point and I
can send it commands using this joystick right here.
It actually also responds in primitive closed loop control.
If I tilt it this way, it pushed back.
If I push it this way, it pushes back.
Ooh calm down calm down.
There's no filtering yet.
I think it's fraught with peril.
Calm down shhhh shhhh.
It even responds when it counters rotation or if the joystick says to give rotation.
This thing has been tied down.
WOAH Calm down calm down *BUZZP into finger* ow ow.
Ok.
Right now it's tied down since the last time I let it loose (it's not that bad) but it
definately bit me, so a little more cautious in the future.
Anyway, I wanted to see what happens if I try this in its first free flight.
So, this is the first time it'll be free and I've never tried this before.
Primitive control loop, really nothin going for it.
Don't think this is gonna work, but I don't like things that are for sure.
Okay.
Give this a shot.
*BUSSP*
Ooh Oops.
*BUZZZZZZZZ*
*BUZZZZ*
*BuuZzzZZZZ*
(generic whurring sounds)
Okay let's try something else.
Wooh waaah gee gaaah *laughter* sorry.
My code is filled with these magic numbers.
Let's try turning down the sensitivity.
So, I save the file, make netburn.
It's compiling it.
It's sending the flash.
It's rebooting...
rebooting ...please come back.
Oh, come on.
Sometimes the network ... there it's back.
Let's give that a shot again.
Doop.
Uuhh third time, with even less sensitivity.
*whurrrringggg* *sigh*
So after twelve hours of debugging this, I discovered why this might be a complete hackaday
fail for the entire project.
First of all, the not fail parts.
Use gyros, not accelerometers when you're trying to balance left to right and forward
to backward.
Second of all, lower motor switching frequency caused my I2C bus to go to pot.
Ok.
Fixed that.
Reset line on the AVR getting triggered by the motor noise.
Ok.
Soldered it to 5V.
I haven't even bothered tuning the PID loop because I found a bigger problem.
If I click and hold this, it enables the joystick.
Notice how I let go of that a while before it died.
Let's try it again.
Notice how I'm letting go and it's totally not doing what I want.
Well, that time it was pretty quick.
The problem is that there's latency on my joystick.
Let's see why.
Over here I have a tool that makes a continuous ping stream.
As long as the amount of time it takes to get a response paket is low, you'll see that
these bars are low.
The responses that have happened a long time ago are more toward the right.
This is great!
This means that we have spectacular communication to the ESP8266.
Over here is just some debug info, don't worry about that.
If I press and hold the allow button.
I only held it for a split second there.
But what you'll notice is that there are packets that weren't being responded to until later.
It looks like is this wonderful thing called wifi is trying really hard to get my packets
through... that means sending really old packets sometimes...
[don't worry about that either, the wifi card in my laptop does that]...
Sometimes it's trying to send really old packets because it thinks they're important and it
doesn't give up and drop them.
So, that means when I press and hold this, it takes a while for my commands to get through
sometimes.
Notice how it's still trying to get the messages through after half a second, sometimes even
a whole second before it gives up.
Notice how all that stream of pings came back, it just took a while.
Which means this is basically completely useless as a control stream.
Okay, well, just for giggles, I tried to connect this to my roommate's access point which is
upstairs and a couple of rooms over.
Laptop is also connected to the same access point.
Seems to actually help some of the problems.
I'm surprised that connecting from your laptop to a wifi device is worse than connecting
through an access point but you know, whatever.
So, still a lot of packet loss, but if I let go it's pretty quick to respond.
Which is significantly better.
The other thing to consider is the come back here...
that you get... not much ... bu some of the retries that are going on here can probably
be overcome by using broadcast.
Thanks for watching.
*whurrring* Okay, before I did this I was having a bigger forget this.
*laughter*