HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Nov 18, 2012, 02:06 PM
Registered User
Joined Aug 2012
121 Posts
Quote:
Originally Posted by miru View Post
Check the SDK for additions/deletions. <frequency> is the frequency of the pattern in HZ, you have to send an integer (e.g. 5Hz would be 1084227584) and <duration> is the duration of the pattern in seconds, 0 meaning forever or until something else comes up.
Don't shoot me, I did not design this...
That's very helpful, thank you. Is frequency parameter ignored when steady pattern is specified (for example, #6 - standard)?
happul3 is offline Find More Posts by happul3
Reply With Quote
Sign up now
to remove ads between posts
Old Nov 18, 2012, 02:19 PM
Registered User
Vista, CA
Joined Feb 2008
1,270 Posts
Quote:
Originally Posted by happul3 View Post
That's very helpful, thank you. Is frequency parameter ignored when steady pattern is specified (for example, #6 - standard)?
I don't know, can't hurt to try. The integer number is generated the following way:
Code:
union { float f; int i; } f;
f.f = 5.0;
printf("f.f=%.1f i=%d\n",f.f,f.i);
miru is online now Find More Posts by miru
Reply With Quote
Old Nov 18, 2012, 02:48 PM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,620 Posts
Quote:
Originally Posted by happul3 View Post
That's very helpful, thank you. Is frequency parameter ignored when steady pattern is specified (for example, #6 - standard)?
You may find this useful
http://gauth.fr/2011/09/control-the-ar-drone-leds/
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Nov 18, 2012, 06:15 PM
Registered User
Joined Aug 2012
121 Posts
Quote:
Originally Posted by pawelsky View Post
Thank you Miru and Pawelsky - visual indication works nicely. It confirms that barometric altitude stabilization is working for drone 1.

If anyone wants, I can provide modified Miru's sketch v19 that includes altitude stabilization functionality for drone 1. It'll also require as little as $10 worth of hardware: bmp085 module and level shifter (some bmp085 modules sold on ebay include level shifter on the same board - that'd make it even easier, but I realized it too late).
happul3 is offline Find More Posts by happul3
Reply With Quote
Old Nov 18, 2012, 06:35 PM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,620 Posts
Quote:
Originally Posted by happul3 View Post
Thank you Miru and Pawelsky - visual indication works nicely. It confirms that barometric altitude stabilization is working for drone 1.

If anyone wants, I can provide modified Miru's sketch v19 that includes altitude stabilization functionality for drone 1. It'll also require as little as $10 worth of hardware: bmp085 module and level shifter (some bmp085 modules sold on ebay include level shifter on the same board - that'd make it even easier, but I realized it too late).
Nice, can you share some more details how it works and some wiring diagrams?

P.S. I guess that one will be OK?

P.P.S. I've also found this which is a barometer and compass on one small board. Assuming miru can use that compass for his RTH implementation that would be a nice addition to Drone 1 sensors.
pawelsky is online now Find More Posts by pawelsky
Last edited by pawelsky; Nov 18, 2012 at 07:11 PM.
Reply With Quote
Old Nov 18, 2012, 08:20 PM
Registered User
Joined Aug 2012
121 Posts
Quote:
Originally Posted by pawelsky View Post
Nice, can you share some more details how it works and some wiring diagrams?

P.S. I guess that one will be OK?
Yes, this module seems perfect. It will have to be wired exactly as shown in the second diagram in that listing: 5V - VCC; GND - GND; SCL - A5; SDA - A4. No additional wiring is needed.

BMP085 takes 25.5 ms to acquire pressure sample in highest accuracy mode which works well with 30 Hz mod's loop frequency. So, in a nutshell, at each cycle of main loop (I've included pressure measurements in setup code as well), code reads acquired pressure and starts new acquisition (periodically, temperature is read as well to improve accuracy of pressure calculation). Actual acquisition process happens in the background. So the process of getting samples from bmp085 does not consume any significant cpu time.

The pressure samples are averaged (16 of them, 0.5 sec worth) to reduce noise, and average values are used to add input to throttle channel. The additional input added as follows: sio_sid(',',gl.rxs.chn[S_GAZ].val + throttle_correction);
Basically, once the throttle stick if throttle stick is untouched for 4 seconds, the pressure reading is stored and any subsequent deviations from that pressure will result in throttle_correction value that is proportional to that deviation. Once the throttle stick is touched, stabilization process and reference pressure are cancelled and code waits for another period of 4 sec with untouched throttle.

I did not really spent much time yet to optimize various adjustable parameters: averaging, delay to start stabilization, proportionality coefficient between pressure and stick input, etc.

I tried to preserve the original mod as much as possible, but had to make one large change. The bmp085-related code does not fit in small remaining memory so I had to cut off the arm code and rely on preinstalled at2so.arm. Other than that there are almost no changes, only additional code inserted.
happul3 is offline Find More Posts by happul3
Last edited by happul3; Dec 02, 2012 at 11:05 AM. Reason: bug was found in the code that was originally attached to this post
Reply With Quote
Old Nov 19, 2012, 02:50 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,620 Posts
Quote:
Originally Posted by happul3 View Post
Yes, this module seems perfect.
Thanks for detailed explanation.

Will the one with compass also work without modifications in sketch (I'm not expert in I2C)? I may go for that one to be future' proof

Quote:
Originally Posted by happul3 View Post
It will have to be wired exactly as shown in the second diagram in that listing: 5V - VCC; GND - GND; SCL - A3; SDA - A2. No additional wiring is needed
On the diagram it is wired to A4/A5, could you please confirm that it needs to be A4/A5 or A2/A3?
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Nov 19, 2012, 08:04 AM
Registered User
Joined Aug 2012
121 Posts
Quote:
Originally Posted by pawelsky View Post
Thanks for detailed explanation.

Will the one with compass also work without modifications in sketch (I'm not expert in I2C)? I may go for that one to be future' proof
As far as I know, additional device such as compass on i2c bus should not be a problem. It will not interact with the bus until its address is explicitly called. So, yes, my guess is the module with compass will work without modifications to the code or wiring.

And it will be quite easy to introduce modifications to the sketch to communicate with compass using the same low level functions.


Quote:
Originally Posted by pawelsky View Post
On the diagram it is wired to A4/A5, could you please confirm that it needs to be A4/A5 or A2/A3?
Sorry, it was a typo on my part. It most definitely is A4/A5 and I've edited original post to reflect that. The diagram in the ebay listing is correct.
happul3 is offline Find More Posts by happul3
Last edited by happul3; Nov 19, 2012 at 08:16 AM.
Reply With Quote
Old Nov 19, 2012, 08:51 AM
Registered User
Joined Jun 2012
2,664 Posts
Quote:
Originally Posted by miru View Post
Yes
OK, thanks.

I must be missing something here, so apologies if I'm being an idiot. Won't be the first or last time...

Communication to the Drone is through GND>Tx and GND>Rx, right?

To see what voltage is going to the D1 Drone, I measure GND>TX and GND>RX on both the Nano and Pro Mini?

Annotation on the Level Shifter diagram says "3.3v I/O No Wire AR.Drone 1.0"
On the non LLS Rev 0.13 diagram there is a 'must have' 4.7k resistor which limits current, but still sends 5v through GND>Tx and Rx.

So if the D1 wants/needs 3.3v for I/O on the LLS Mod (and actually only gets 2.5v), is it OK for it to be getting 5v with the Rev 0.13 Resistor Mod?

Follow up question. My Pro Mini is this one: http://www.ebay.co.uk/itm/230795578198 which is adjustable for 3.3v/5v output (defaults to 5v). No idea which outputs though.

If I set it to 3.3v will my D1 be happier with the Rev 0.13 version Mod?

Also, if I'm only outputting 3.3v in the first place, what connections might I need on the Level Shifter with a Pro Mini and a D2?

Brandigan is offline Find More Posts by Brandigan
Reply With Quote
Old Nov 19, 2012, 09:16 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,620 Posts
Quote:
Originally Posted by happul3 View Post
As far as I know, additional device such as compass on i2c bus should not be a problem. It will not interact with the bus until its address is explicitly called. So, yes, my guess is the module with compass will work without modifications to the code or wiring.
Ordered both (so I'll have a spare just in case). Will try them out once they arrive and share results.
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Nov 19, 2012, 09:53 AM
Registered User
Joined Oct 2011
53 Posts
Quote:
Originally Posted by Brandigan View Post
Follow up question. My Pro Mini is this one: http://www.ebay.co.uk/itm/230795578198 which is adjustable for 3.3v/5v output (defaults to 5v). No idea which outputs though.
Output depends on Vcc (1.8-6V for this processor). If you select 5V option it will give ~4.5V output at the pins, if power option is 3.3V you will get around 2.7V at the pins. For 5v selection of Vcc you should use schematic as it shown for regular Arduino Pro.
obelix662000 is offline Find More Posts by obelix662000
Reply With Quote
Old Nov 19, 2012, 09:56 AM
Registered User
Vista, CA
Joined Feb 2008
1,270 Posts
Quote:
Originally Posted by Brandigan View Post
OK, thanks.

I must be missing something here, so apologies if I'm being an idiot. Won't be the first or last time...

Communication to the Drone is through GND>Tx and GND>Rx, right?

To see what voltage is going to the D1 Drone, I measure GND>TX and GND>RX on both the Nano and Pro Mini?

Annotation on the Level Shifter diagram says "3.3v I/O No Wire AR.Drone 1.0"
On the non LLS Rev 0.13 diagram there is a 'must have' 4.7k resistor which limits current, but still sends 5v through GND>Tx and Rx.

So if the D1 wants/needs 3.3v for I/O on the LLS Mod (and actually only gets 2.5v), is it OK for it to be getting 5v with the Rev 0.13 Resistor Mod?

Follow up question. My Pro Mini is this one: http://www.ebay.co.uk/itm/230795578198 which is adjustable for 3.3v/5v output (defaults to 5v). No idea which outputs though.

If I set it to 3.3v will my D1 be happier with the Rev 0.13 version Mod?

Also, if I'm only outputting 3.3v in the first place, what connections might I need on the Level Shifter with a Pro Mini and a D2?

According to the datasheet for the Atmega 328p you can not run the processor at 16 Mhz with a 3.3V VCC. Unless the ProMini you found runs the processor at 5V AND does 3.3V I/O (which I seriously don't believe) you will need to run it at 5V, which makes the board no different from a regular ProMini as far as the mod is concerned.
The mod with the resistor in the Arduino TX -> Drone RX line is limiting the current that flows between the output of the Arduino and the clamped input of the drone. The drone input clamps to VCC (3.3V) of the drone, if you don't limit the current the Arduino drives into this input (it can deliver up to 40mA), you will eventually fry the input clamp on the drone and render the receiver of the tty port useless ($100 mistake). If you use a 4.7K resistor, the maximum current the clamp has to 'swallow' is (5-3.3)/4.7K=0.36mA, a current small enough for the clamp to handle.
miru is online now Find More Posts by miru
Reply With Quote
Old Nov 19, 2012, 10:58 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,620 Posts
Quote:
Originally Posted by happul3 View Post
Yes, this module seems perfect. It will have to be wired exactly as shown in the second diagram in that listing: 5V - VCC; GND - GND; SCL - A5; SDA - A4. No additional wiring is needed.
One more question: Do you cover the sensor somehow to protect it from the extra air pressure generated by propellers, or you just hide it under Drone's hull?
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Nov 19, 2012, 10:59 AM
Registered User
Joined Jun 2012
2,664 Posts
Quote:
Originally Posted by miru View Post
According to the datasheet for the Atmega 328p you can not run the processor at 16 Mhz with a 3.3V VCC. Unless the ProMini you found runs the processor at 5V AND does 3.3V I/O (which I seriously don't believe) you will need to run it at 5V, which makes the board no different from a regular ProMini as far as the mod is concerned.
Well, you'll understand the schematic on the listing better than me, and it is listed as "Enhanced". What do you think is likely to happen if I set the Output to 3.3v?

I'll make the change and measure what comes out of it.

There's an 8Mhz adjustable version here too: http://www.ebay.co.uk/itm/221031162267
Quote:
Originally Posted by miru View Post
The mod with the resistor in the Arduino TX -> Drone RX line is limiting the current that flows between the output of the Arduino and the clamped input of the drone. The drone input clamps to VCC (3.3V) of the drone, if you don't limit the current the Arduino drives into this input (it can deliver up to 40mA), you will eventually fry the input clamp on the drone and render the receiver of the tty port useless ($100 mistake). If you use a 4.7K resistor, the maximum current the clamp has to 'swallow' is (5-3.3)/4.7K=0.36mA, a current small enough for the clamp to handle.
I see on the Spec for the one I have it has 150mA Max output (not 40mA). Is one resistor enough? It's working at the moment, but the word 'eventually' caught my attention. I can't afford any more costly mistakes.

So... with the LLS and a D1, as the voltage is less than 3.3v max clamp value (5/2=2.5v) there is no current issue?

Is that similar on the D2? 1.8v clamp? Voltage lower than 1.8v (5/3=1.66v through LLS) so no excessive current flowing through it?
Brandigan is offline Find More Posts by Brandigan
Reply With Quote
Old Nov 19, 2012, 11:26 AM
Registered User
Vista, CA
Joined Feb 2008
1,270 Posts
Quote:
Originally Posted by Brandigan View Post
Well, you'll understand the schematic on the listing better than me, and it is listed as "Enhanced". What do you think is likely to happen if I set the Output to 3.3v?

I'll make the change and measure what comes out of it.
The schematic on the ebay listing does not show the voltage regultor ... there is no telling what they do.
Quote:
There's an 8Mhz adjustable version here too: http://www.ebay.co.uk/itm/221031162267
You want a 16 Mhz clock on the processor to run the mod.
Quote:

I see on the Spec for the one I have it has 150mA Max output (not 40mA). Is one resistor enough? It's working at the moment, but the word 'eventually' caught my attention. I can't afford any more costly mistakes.
The 150mA is for the power regulator, the processor can only do 40mA on an output pin.
Quote:
So... with the LLS and a D1, as the voltage is less than 3.3v max clamp value (5/2=2.5v) there is no current issue?

Is that similar on the D2? 1.8v clamp? Voltage lower than 1.8v (5/3=1.66v through LLS) so no excessive current flowing through it?
Sorry, I am exhausted and am giving up on you. You need to brush up your understanding of electronic circuits and study the schematics of the LLC to answer the questions yourself.
miru is online now Find More Posts by miru
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Mini-HowTo RC Controlled AR.Drone w/o WiFi! nosaari Multirotor Talk 116 Mar 14, 2014 02:23 PM
For Sale Parrot AR Drone w/TX/RX mod *Flies Nice* Z06 Tony Aircraft - Electric - Helis (FS/W) 4 Apr 16, 2011 09:42 PM
Discussion Wifi Boosted AR.Drone Fallengod Multirotor Talk 7 Feb 12, 2011 10:52 AM
Discussion And yet another AR drone Arial Video project taudronis Multirotor Talk 17 Dec 07, 2010 11:04 AM
Sold Parrot AR.Drone Four rotor platform control with your iPodTouch/iPhone/iPad Hoverup Aircraft - Electric - Helis (FS/W) 0 Oct 12, 2010 03:54 PM