Login to disable ads!

$200 prize for whoever can make this mod

Parrot SDK, Linux SDK, Java, PC, Mac, scripts for Parrot drones... etc.
Schlauncha
Charged up again
Posts: 1102
Joined: 21 Jun 2011, 03:50
Drone Type: AR.Drone 2
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by Schlauncha » 03 Feb 2013, 18:28

I found a program that converts Mikrokopter control board I2C into PWM, so maybe all that is needed is to change what bits of the I2C stream it reads, and then of course to run the math so it reads all 4 motors, compares them to find the base pitch/roll/yaw/throttle, then mixes in gains, and then remixes it all out to the motors.

But I still don't know enough about I2C or Arduino to make heads or tails of any of this. So for someone who can, $200 right here waiting for you! Modify the attached program to read the four motor values (from the multiple input wires), do the mixing calculations, and output to four PWM's instead of one, and you'll be set!

I found a good tutorial about I2C for Arduino here, if it helps: http://www.mustafab.com/blog/?p=587" onclick="window.open(this.href);return false;
You do not have the required permissions to view the files attached to this post.

remoh
Ready for take off
Posts: 10
Joined: 31 Dec 2012, 21:44
Drone Type: AR.Drone 2
Location: Austria
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by remoh » 04 Feb 2013, 10:50

Hello,

did somebody make some progress?

At first, some information:
I've followed this thread and everyone speaks
about AR.Drone uses an I2C protocol, but it doesn't.
So e.g. the Microkopter I2C/PWM converter would be
useless.
It uses a (simple) UART protocol, but unfortunately
Parrot decided to save one wire by connecting
Rx and Tx (a standard I2C protocol would be easier).
If you like describing bus-interfaces with three letters,
you could use the word TWI (;

What I'm not planning to do:
- an AR.Drone-TWI to PWM converter, because I think
PWM shouldn't be used for an UAV (and no professional
drone uses it)

What I'm planning to do:
- designing a BLDC especially for the AR.Drone
for a current of max. 20A based on some open-source
BLDC-software

My current status:
I've written a (ANSI-)C program for receiving init
commands, speed data and led data and
ported it to assembler two days ago.
Yesterday I finally put the open-source BLDC-software
and my software together.

What I'm now able to do:
- successfully initialize the AR.Drone (green LEDs are on)
- receive LED data and set the right LED(s) (green/red)
depending on the motor number
- receive motor data and control the BL-motor
depending on the motor number

Unfortunately, the motor doesn't run continiously at this time,
because of the 5ms motor data refresh time (the open-source
BLDC software has some problems with that).
I'll fix this bug the next days.

Because my AR.Drone BLDC is based on open-source
software, I'll also keep the software free and open, but
until the BLDC doesn't work correctly, I'll nor publish the code,
because I didn't like to be responsible for a fire at your home.

I'll post some pics and videos in a few days and try to get everything
working until Thursday.

Greetings,
Fabian

Schlauncha
Charged up again
Posts: 1102
Joined: 21 Jun 2011, 03:50
Drone Type: AR.Drone 2
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by Schlauncha » 04 Feb 2013, 12:41

WOW! Big round of applause for Fabian! That's awesome!

So, just to make sure I'm understanding you right, you are talking of making a board that is like a 20A version of the motor controller, such that you would use four of these instead of the four regular motor controllers (and motors)? Then just a few questions and concerns, but otherwise I think this could definitely work.

First off, would this be four separate modules, or would it be one module with four sets of brushless motor outputs? I would be in favor of the second option for a few reasons. First, it would probably be simpler from a hardware standpoint to have everything on one board, if that saves having to do 4x of each and every part (such as 4x controllers). Second, it would allow the motor values to be compared against each other to determine the underlying pitch / roll / yaw / throttle values, then allowing them to be re-mixed with adjustable gains for the output, something I would estimate to be necessary in order to use different airframes and motors on the same AR Drone. With individual boards, not talking to each other to know what the other motor values are, the best you could do is one master gain for throttle adjustment for setting idle hover, wait, rewind back to the start of this sentence (wish I knew the code for strike-through on here). You could get this adjustability still with individual controllers, if you were to have two adjustments, one for "idle" position, and another for "sensitivity". You would adjust the idle position until your drone with its new motors hovered at the right amount of throttle (not bobbing up and down with too much throttle, for example) and then in order to get roll response right, as this is applied by deviating the motor from idle hover, you could have the second adjustment be the scale, so maybe it looks like this: AR Drone hover 55%, ESC output 65% (adjustment set to +10%). AR Drone now tilts and ouputs 60%, ESC scales this to be 80% to respond with a fast enough change on the bigger slower-responding airframe (adjustment of +10% added to scale of X 200%).

Second comment, if you are trying to tell the AR Drone to launch, and have props removed or a motor controller like you've got, one way or another not having props and resulting in immediate flight, the AR Drone will error out if the ultrasonic sensor doesn't see it "flying". If you take all four props off and have the stock motor controllers (and motors) on there, you'll see that sending "Launch" spins up the motors, but they stop after a few seconds. However, if you lift the AR Drone up by hand during "Launch" now the motors will stay non-emergency, and it will "fly" correctly, in your hand, and you can hear how as you tilt it one way or another by hand, the motors will speed up or slow down trying to correct. I just wanted to make sure you know, so that you aren't thinking it isn't working because it errors out after a second when it's being tested on the bench without lifting off.

Third, just wanted to clarify that yes I do still think this would qualify as meeting this challenge, that if you can get it to the point of where your controllers are working successfully and can be tuned for flight, and I can either buy them from you or build ones according to your instructions, then that achieves my goal of putting the AR Drone as the flight controller in larger quadcopters.

Fourth, if PWM output is just not what you feel is right, would there be a different motor controller interface that you'd look at an adapter for? Rather than limiting this to just a 20A controller (but still a huge win!), if there is a series of motor controllers that use a different interface that you feel would be more appropriate to output an adapter to, what would that be? I only say PWM as an output because if I go to HobbyKing, all their multicopter components are using it, so their selection of ESC's uses it. But maybe there's a different site that has better X-input ESC's, and if you could make an AR Drone to X converter, then we could select from those. I just think it would be better to have this more open-ended, to have an adapted output that a wide range of controller sizes could go into.

IceFyre13th
Just flips over
Posts: 91
Joined: 14 Jan 2013, 02:14
Drone Type: AR.Drone 2
Location: Mesa, AZ
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by IceFyre13th » 04 Feb 2013, 19:39

remoh

??? You are making a Brushless DC Motor, 20 amp ???

Or a board that can supply 20 amps to any brushless motor?

PWM controled ESC's with a refresh rate at least >400 Hz (>2.5ms) can, and are used in professional Drones......older 200 Hz refresh rate (5ms) ESC's would be a possible problem.

Yes, do get the drone above 1 m (3 ft) or the controller will think the drone has failed take off and shut down the motors.

What the heck dose you TWI acronym mean?

Thanks for the second look at the idea, the more minds the better!!!

Schlauncha
Charged up again
Posts: 1102
Joined: 21 Jun 2011, 03:50
Drone Type: AR.Drone 2
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by Schlauncha » 04 Feb 2013, 22:05

I found somebody who sounds like they have a resume showing they've got more than enough skill/experience to do this, so I have commissioned them to do this for me. What does this mean? Well if that guy can do it first, he wins. But if you guys can do it first... then true to my word you'll win and get the $200 I promised... and then the other guy will still get paid too... so I might take a boot to the wallet on that one, but it's WORTH IT! Now I just have to ship an AR Drone to India...

remoh
Ready for take off
Posts: 10
Joined: 31 Dec 2012, 21:44
Drone Type: AR.Drone 2
Location: Austria
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by remoh » 04 Feb 2013, 23:21

@Schlauncha
At this time, I plan to use four seperate modules.
One module with four sets is a good idea, I will
think about that.
I also heard people from India are very good programmers (;

@IceFyre13th
Yes, a BLDC controller, which can run motors up to 20A
(by using a heatsink even a bit more current).
TWI means Two Wire Interface.
The AR.Drone uses a 200Hz refresh rate (ms) for their
motor controllers, so PWM would be not as bad as I thought.
I still don't unterstand, why Parrot decided to use a
UART-protocol, a standard I2C supports up to 400kHz?

Updated status:
Just finished the software, the motor controlled
by my custom BLDC controller is running now.

In order to fly with my BLDC software, I'll have to order
some of the motor controllers, I'm currently using
(I only have two modules at home).

I'll post pics and videos tomorrow afternoon (I'm from Austria / MEZ).

Greetings,
Fabian

Schlauncha
Charged up again
Posts: 1102
Joined: 21 Jun 2011, 03:50
Drone Type: AR.Drone 2
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by Schlauncha » 05 Feb 2013, 02:11

Remoh, the PWM can be ran at 8kHz and would work just fine with the Turnigy Multistar line of esc's, supporting up to 480-499Hz refresh rates. Here is a 30A version: http://www.hobbyking.com/hobbyking/stor ... OPTO_.html" onclick="window.open(this.href);return false;

I know you initially were very much against PWM and didn't feel it was fast enough, but I just don't think that's the case, especially if the AR Drone is only refreshing at 200Hz anyways. You sound like you have conquered the deciphering of the AR Drone's output, so of everyone on the planet, YOU are my closest link to a PWM output conversion, so I beg you, what would it take to get this? If you could make a module that reads all four motor outputs, compares them to get the underlying pitch / roll / yaw / throttle commands, multiplied them against some adjustable gain values, and then remixed them to output to the four PWM's, then this would just be exactly what I'm looking for, and if you're already getting it to read the values, you're so very close to it that I can almost taste it!

Sorry I just get excited when stuff starts working! And you're so close now, if it was set up a little different, it would be exactly the conversion module I'm looking for! We're almost there! Now I know how my dog feels when I start getting carrots out of the fridge... unbridled anticipation.

IceFyre13th
Just flips over
Posts: 91
Joined: 14 Jan 2013, 02:14
Drone Type: AR.Drone 2
Location: Mesa, AZ
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by IceFyre13th » 05 Feb 2013, 20:17

Lets get on the same page.

PWM, Pulse Width Modulated. http://en.wikipedia.org/wiki/Pulse-width_modulation" onclick="window.open(this.href);return false; I am not writing a book....go read.......LOL

Control from the "main board" to the ESC is running at 200 Hz (5mS) or more, this is how many time per second the ESC gets a command from the main board. Depending on the type of signal the ESC is expecting (PWM, UART, I2C) this could be as simple as a on off pattern, or if PWM how long on compared to how long off, or a combination.....

Motor switching frequency (how many time the ESC "pulses" to motors windings) can be anything from 0 Hz (off) on up. But this all depends on the ESC's switching frequency of the FET's and what frequency the motor is designed to handle. Faster on off in a three wire motor makes the RPM go up. That's why you can hear sound when they arm, and why the tone changes with RPM. ESC's also have to know where the rotor is while turning to send the pulse at the right time. http://en.wikipedia.org/wiki/Brushless_ ... tric_motor" onclick="window.open(this.href);return false;

Longer on time can increase power (torque) in a three wire motor, but the motor will run hotter. High Kv motors like higher switching frequency, Low Kv motors may not work with high switching frequency ESC's.....but that is why you set up the throttle on your radio transmitter and / or control board firmware.....you may have a ESC that can put out 8000 Hz signals to run the motor up to 240,000 RPM, but if your motor will never run that fast based upon your battery voltage to Kv rating of the motor, it may only run at 3000 Hz.

Brushed motors can be PWM controlled too, longer on time makes the RPM go up, shorter makes it go slower.....the way this works is simple. if you have 10 volts available and just turn on a switch the motor would see 10 volts and run at "full" speed. But if you turn the switch on and off equally at a steady pace (say 200 times a second, 200 Hz) the average voltage would be 5 Volts (half the time on, the other half off). If you turn the switch on 3/4's of the time and off 1/4 of the time the average voltage would be 7.5 volts....on 1/4 and off 3/4 would average 2.5 volts.

PWM can have one disadvantage, its real hard to get the on time of a FET to 100% if you are using both N channel and P Channel FETS, off is easy....its just off....95% is about as close as you could get.

PWM using only P or N channel FETs could get you 100%, but heat is the enemy as all FET's have some on resistance (resistance equals heat).

Darn it......I almost wrote a book.

Schlauncha
Charged up again
Posts: 1102
Joined: 21 Jun 2011, 03:50
Drone Type: AR.Drone 2
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by Schlauncha » 06 Feb 2013, 00:10

Sorry, I got mixed up where that esc I linked to had said "PWM: 8KHZ", I guess they were talking about its motor output frequency, seems just asking for confusion that they would describe something with both input control PWM rates, and output motor PWM frequency, using "PWM" without a label as to which one.

But for the most part, when I talked about PWM, I was always talking about control input signals. Just quoted the wrong kind of PWM this time.

IceFyre13th
Just flips over
Posts: 91
Joined: 14 Jan 2013, 02:14
Drone Type: AR.Drone 2
Location: Mesa, AZ
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by IceFyre13th » 06 Feb 2013, 19:48

No problem....for some reason manufactures like putting out confusing specs. They reason that the public wont care as long as the numbers look good.

Amplifiers have THD (total harmonic distortion) specs.....but they never say how it was measured, and it makes a difference. Loaded at full power, or unloaded at 1 volt RMS...........the same amp could have 10% THD at 4 ohms full rated output, but also have 0.001% unloaded at 1 volt RMS (funny part about this, most people cant tell the difference between 0.001% up to 10% THD).

TV's have contrast ratio, but is that from true black or from screen off, is that the difference from white and black "pixels" or from the whole screen showing white or black.

ESC's do the switching frequency thing, it would be better if they spec'ed out what motor works best in Kv ratio (works best with motors in the 500-1000 Kv range, or 3500 to 4500 Kv. Some output FET's work better switching slowly, while others like the high speed switching. Matching the motor to the ESC would give the best possible performance.

Some ESC's can handle control refresh rates at 200 Hz, some up to 500 Hz..why not do this spec in ms (Milli seconds)...that's what it really is to us engineers (200 Hz looks better than 5ms???...must be the bigger number must be better even though those two specs are exactly the same thing).

I saw one ESC saying it could handle "up to 499 Hz refresh rate, 500 Hz total"......so is it 499 or 500......500 total, you mean more than one control signal can be fed to it??? WTF....lol

Schlauncha
Charged up again
Posts: 1102
Joined: 21 Jun 2011, 03:50
Drone Type: AR.Drone 2
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by Schlauncha » 08 Feb 2013, 08:14

Just an update, things are moving along with person from India who is helping put together the programming for this, so I wanted to take a moment and talk about a few other things in the big-picture about this mod.

First off, what to call it? "PWM mod" doesn't sound great, so I was considering a half and half of the programmer's name and my name, resulting in the "Soozzy Mod" which seems nice because it'd be easy to pronounce like "Suzie Mod" and would be in-line with the naming of stuff like the Miru Mod.

Secondly, I was thinking of designing a mounting adapter, likely 3D printed, that would allow a lightweight and clean installation of just the mainboard and navboard (and PWM adapter) as a unit that would have mounting holes for screwing it on to regular hobby airframes. The one big difference is that it would have to mount somewhere that the ultrasonic sensors could have an unobstructed path downward, as well as the bottom camera. This box would also provide a means for mounting the front camera to it. For testing I would probably just use 1/8" thick basswood glued together to build this box, as I have found this to be a material that is very nice to work with, easy to saw, strong, cheap, readily available (from Hobby Lobby), and so on. I have a 660-size quadcopter frame with the rest of its components in the mail, that I'm sure will eventually be the airframe for my first test.

Another thought I had was that we may look at having 8 PWM outputs for an X8 configuration octocopter, since you can just plug in to channels 1-4 for a quadcopter, and then if you go to an octocopter, just use the additional channels 5-8. Yes, conventionally I believe on X8's they have all four top motors going one way, the bottom four spinning the other, but in this case we'd have the top four mixed cw / ccw just like the AR Drone, and then the bottom four (optional) would receive identical amounts of pitch/roll/throttle, but would have reversed effects of yaw applied, given their opposite rotation. I've simulated all this mixing with success in RealFlight 6.5, going from a quad to an octocopter this way, and it should all work.

One final thought regards how the gains should be adjusted for the roll, pitch, yaw and throttle. While tiny pots for a screwdriver are commonly found on some flight controllers (like my Feiyu's) this would be more difficult from the standpoint that I'd have to solder four of those on to every one now, for every adapter I build. On the other hand, if we have a way to easily connect these (such as a USB adapter - for example some Arduino boards already have them) then it could be easier, just a matter of changing the values in a text file or uploading an Arduino sketch with adjusted numbers. Unfortunately this would be much slower for testing though, since pots only take a few seconds to adjust, test, and adjust again. Still trying to figure out a good way to set it up for testing purposes assuming the first few times it will wobble and oscillate uncontrollably - perhaps just flying it over tall grass is the best I can do, lacking any of those MIT quadcopter "net rooms" where every surface is covered with catch-nets.

pawelsky
Serious flight time
Posts: 1272
Joined: 02 Aug 2012, 22:01
Drone Type: Bebop
Location: Poland
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by pawelsky » 08 Apr 2013, 10:21

Having a spare Arduino Nano board lying around I've decided to see if it can be used to parse the motor protocol from AR.Drone and control bigger motor via ESC.

The protocol is pretty well described and Arduino can control ESC using Servo.h module so it should work fine. I've connected Arduino's serial port to one of the motor serial lines, wrote a simple sketch and... it works :)


Direct link: http://www.youtube.com/v/9-H6LgeNU4o

Watch closely the big quad motors spinning together with AR.Drone's (they react even quicker). I've tried that on the ground and with AR.Drone actually flying (hence the long grey cable).

That is of course not a complete solution, but if you haven't tried that - maybe that is the way to go.

EDIT: Note that I've found a problem(s) in this version of the sketch that caused the PWM commands to be parsed incorrectly, please do not use this version - use that one instead
You do not have the required permissions to view the files attached to this post.
Last edited by pawelsky on 04 May 2013, 13:03, edited 3 times in total.

Schlauncha
Charged up again
Posts: 1102
Joined: 21 Jun 2011, 03:50
Drone Type: AR.Drone 2
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by Schlauncha » 08 Apr 2013, 11:41

The guy in India is still working on it, but if you can get this to work, there's still $200 in it for you. The way he's doing it will require the four motor controllers / motors to be carried as dead weight, so that they can still communicate with the AR Drone mainboard, and then we just have four voltage readings coming from the brushless motors, that we use to establish throttle position.

If you can get a little Arduino to understand what the AR Drone mainboard is trying to say, so it can be plugged in replacing the original motor controllers, AND can send whatever information is necessary back to the AR Drone to keep it happy thinking there's a normal motor controller there (since it will error if you have a motor controller unplugged or damaged). It's not a "dead end" of information like it is with most quadcopters and their PWM signals going to regular ESC's.

Given the advances in upgrading the range of WiFi control and video link on these AR Drones, this is becoming increasingly sweeter if we can get it working. Once the AR Drone parts are all accounted for, then with bigger ESC's and motors (and a proportionately larger battery), we will have more cargo capacity for upgrades a stock AR Drone would've had trouble with, such as larger WiFI amplifiers, GoPro cameras, etc. The bigger multicopters I'm getting into now are fun, but they are really different to fly than the AR Drone - the Drone's self leveling, precise altitude hold (thanks to ultrasonic sensors), and ground position hold (thanks to bottom camera) would be features that would be a huge improvement over my current KK2.0 multicopters. Even just for trying to do FPV flight around the backyard, the AR Drone will hold a few feet off the ground so precise that it makes it much easier for the pilot to fly watching through the front camera when it's more "2D" and you have the confidence that if you just let off the controls, it will level out and come to a stop hovering still in one spot.

I'm not an Arduino programmer by any means - I tried to get into it, I can upload sketches to boards that I have, but I haven't had the time to really get into learning a whole new programming language. But I'll be able to help test and verify anything you post as a sketch. Just remember, when you tell the AR Drone to Launch, it doesn't matter if you take the props off the motors, what matters is that after they start spinning, the AR Drone somehow (such as by your hands now) lifts off immediately to a hovering height. I've tested that several times, so if you think it's cutting out after two seconds on the ground, it's likely not the fault of your Arduino insufficiently impersonating an AR Drone motor controller, it's just that the ultrasonic sensors didn't see the Drone successfully gain altitude, so it Emergency's out.

Also another thing, for testing purposes, you could have the Arduino output its PWM to a servo, giving you a more clear indication of what values are being output, compared to needing to rig together an esc and motor. Just be careful with where voltages are pulled from, such as to feed the red and black wires of the PWM output - you will probably want to run a separate battery for testing the Arduino and have it supply those voltages out, or a more final solution would be to wire straight off the AR Drone's battery connector so its (and eventually the ESC's) power is not being drawn through the AR Drone mainboards in any way. Given the amperage my bigger multicopters pull, there would be some magic smoke coming out for sure as those thin PC traces vaporize.

pawelsky
Serious flight time
Posts: 1272
Joined: 02 Aug 2012, 22:01
Drone Type: Bebop
Location: Poland
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by pawelsky » 08 Apr 2013, 11:59

Schlauncha wrote:The guy in India is still working on it, but if you can get this to work, there's still $200 in it for you. The way he's doing it will require the four motor controllers / motors to be carried as dead weight, so that they can still communicate with the AR Drone mainboard, and then we just have four voltage readings coming from the brushless motors, that we use to establish throttle position.

If you can get a little Arduino to understand what the AR Drone mainboard is trying to say, so it can be plugged in replacing the original motor controllers, AND can send whatever information is necessary back to the AR Drone to keep it happy thinking there's a normal motor controller there (since it will error if you have a motor controller unplugged or damaged). It's not a "dead end" of information like it is with most quadcopters and their PWM signals going to regular ESC's.
I do not plan to go for a full solution, but the protocol seems to be relatively easy to implement (PWM commands, status, version, motor assignment, and keep alive + emergency IRQ) so someone having a bit more spare time that 2h I've spent on it can continue with the sketch I've shared. Just wanted to show you the way.

That would be much cleaner solution that keeping the dead original controllers/motor.

pawelsky
Serious flight time
Posts: 1272
Joined: 02 Aug 2012, 22:01
Drone Type: Bebop
Location: Poland
Has thanked: 0
Been thanked: 0

Re: $200 prize for whoever can make this mod

Post by pawelsky » 08 Apr 2013, 12:19

Added video to my earlier post

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests