HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Feb 06, 2013, 10:23 AM
Discovering the joys of flying
Adilson's Avatar
Brazil, SC, Joinville
Joined Aug 2012
813 Posts
Quote:
Originally Posted by Paku View Post
Hi,
As I am going to enable buzzer and possibly some additional LEDs, I am walking through code to identify places for changes I have to do inside the code ....

But here is a problem .. I am not sure if I am looking for something impossible or missing some obvious informations.

There are some port like A0..A5 they seems to be proper places for LEDs connections (or 32/33 for buzzer ) but from other hand there is a sentence inside the code like this:

// MPNG: Piezo uses AN5 pin in ArduCopter, we uses AN5 for CLI switch


or def like this:

#define PIEZO DISABLED
#define PIEZO_LOW_VOLTAGE DISABLED
#define PIEZO_ARMING DISABLED

which are not used anywhere

Can someone fill my poor mind with some basic informations on what's going on here
What I've done once was to just add my own code to trigger a buzzer on demand using the blackvortex board but the idea is the same. Just find out which pin you want to enable and add your code to UserCode.ino
Adilson is offline Find More Posts by Adilson
Reply With Quote
Sign up now
to remove ads between posts
Old Feb 09, 2013, 02:37 PM
James not bond
jy0933's Avatar
United States, MN, Minneapolis
Joined May 2012
2,074 Posts
quick question

is there any way to do HIL simulate in mission planner with mpng?
jy0933 is offline Find More Posts by jy0933
Reply With Quote
Old Feb 10, 2013, 06:30 PM
Registered User
Poland, Mazowieckie, Warsaw
Joined Jan 2009
328 Posts
May be here someone will know the answer ???

http://www.rcgroups.com/forums/showp...postcount=4815
Paku is offline Find More Posts by Paku
Reply With Quote
Old Feb 15, 2013, 08:46 AM
Registered User
gta18's Avatar
LA
Joined Mar 2004
289 Posts
Quote:
Originally Posted by Syberian View Post
Change the board type in the Arduino IDE
Thanks! Worked for me!!! I Changed it to arduino mega 2560.
gta18 is online now Find More Posts by gta18
Reply With Quote
Old Feb 19, 2013, 06:08 AM
Registered User
Poland, Mazowieckie, Warsaw
Joined Jan 2009
328 Posts
Hi guys,

As I play a little building own GPS module based on MTK chip I would like to share two interesting /at least for me/ informations.

First is a battery for GPS module issue. I had the idea to replace the battery with something more useful especially something not requiring resoldering - from time to time.... So I go with very high capacitance capacitor. The one I used is 0.1F (100.000uF) rated for 5.5V.

Just for few cents more you can get 1F/5.5V what is 1.000.000uF

What can I say is - it is just working Longest test I made was for about 12h and it does keep GPS memory and RTC running. Could be, it will last longer but have to make longer test ....

One may say it's short time, but as you know, GPS data is changing so it does not matter how big battery you have, if you close your GPS in the drawer for few days it will have to recollect data from SATs again ... so few hours just for flying day is more then enough.

Cap is small and looks like one on the photo.

The other idea is a little, but great, piece of software for GPS manipulation. I use this one for years now. What's more I am really happy there is new update so it seems author is still working on it. Here you have all you need to play with your GPS /terminal, commands history, graphs, tests and more/. It works with any serial enabled GPS.

The link is http://homepage2.nifty.com/k8/gps/#001 - look for NMEA Monitor

Hope you like these ....
Paku is offline Find More Posts by Paku
Last edited by Paku; Feb 19, 2013 at 06:13 AM.
Reply With Quote
Old Feb 19, 2013, 02:05 PM
Registered User
Joined Nov 2012
52 Posts
Quote:
Originally Posted by Paku View Post
Hi,
As I am going to enable buzzer and possibly some additional LEDs, I am walking through code to identify places for changes I have to do inside the code ....

But here is a problem .. I am not sure if I am looking for something impossible or missing some obvious informations.

There are some port like A0..A5 they seems to be proper places for LEDs connections (or 32/33 for buzzer ) but from other hand there is a sentence inside the code like this:

// MPNG: Piezo uses AN5 pin in ArduCopter, we uses AN5 for CLI switch


or def like this:

#define PIEZO DISABLED
#define PIEZO_LOW_VOLTAGE DISABLED
#define PIEZO_ARMING DISABLED

which are not used anywhere

Can someone fill my poor mind with some basic informations on what's going on here
And I believe A0 and A1 are setup current/voltage reading from an Attopilot module. I am looking at setting up LED's too but plan to eventually add the Attopilot module. Hoping I can use A2-A5 for LED's (one for each leg) which would leave A0 and A1 open for the Attopilot later.

led.pde labels A1-A4 for LED's but that would leave only A0 for the Attopilot.

Also, the readme file labels A0-A1 for current/voltage with A4-A7 for LED's. I have no idea where A6 and A7 are on our board and wonder what A2 and A3 were planned to do. Maybe a type-o?
Oktavius is offline Find More Posts by Oktavius
Last edited by Oktavius; Feb 19, 2013 at 03:01 PM.
Reply With Quote
Old Feb 20, 2013, 11:05 AM
Registered User
Poland, Mazowieckie, Warsaw
Joined Jan 2009
328 Posts
I was more on GPS for few last days but will look closer to LEDS now.
The question is if you a going to "output" anything through leds and what ...
Paku is offline Find More Posts by Paku
Reply With Quote
Old Feb 20, 2013, 11:22 AM
Registered User
Joined Nov 2012
52 Posts
Quote:
Originally Posted by Paku View Post
I was more on GPS for few last days but will look closer to LEDS now.
The question is if you a going to "output" anything through leds and what ...
My hope is to have navigational lights but have one leg synced with the arming LED (A) and one leg snyced with the GPS LED (C). That way they are flashing when not ready, solid when GPS locked and armed.
Oktavius is offline Find More Posts by Oktavius
Reply With Quote
Old Feb 20, 2013, 11:44 AM
Registered User
Poland, Mazowieckie, Warsaw
Joined Jan 2009
328 Posts
Quote:
Originally Posted by Oktavius View Post
have one leg synced with the arming LED (A) and one leg snyced with the GPS LED (C).
That's what I want to do

How did you connect these ?? Through transistor ?? Where did you get the signal from ?

What you mean navigation light ??
Paku is offline Find More Posts by Paku
Reply With Quote
Old Feb 20, 2013, 11:51 AM
Registered User
Joined Nov 2012
52 Posts
Quote:
Originally Posted by Paku View Post
That's what I want to do

How did you connect these ?? Through transistor ?? Where did you get the signal from ?

What you mean navigation light ??
I'm still looking into it and haven't hooked everything up. I have an ULN2803 to hook up the LEDs. I am hoping I can get signal from A2-A5 which would leave A0 and A1 open for a current/voltage sensor in the future.

Navigation lights are to make it easier to determine the orientation of the aircraft. I will have white LEDs in the front and red in the back. Some people split it up left and right.

This might help out. It is for the Arducopter but most of it applies to us.

http://diydrones.com/profiles/blogs/...y-warning-leds
Oktavius is offline Find More Posts by Oktavius
Reply With Quote
Old Feb 20, 2013, 11:58 AM
Registered User
Poland, Mazowieckie, Warsaw
Joined Jan 2009
328 Posts
So the question is how to enable Arming and GPS on Ax output ??? Right?
Paku is offline Find More Posts by Paku
Reply With Quote
Old Feb 20, 2013, 05:07 PM
Registered User
Poland, Mazowieckie, Warsaw
Joined Jan 2009
328 Posts
ok, I have spent some hours on code and here is a summary what have I found.

It would be nice if someone can verify if I'm right or wrong ... it just a code based, have to check all this informations in my copter ... one day.

So...

We have a number of ports available, some are free to use, others are rather hard to move to another functionality as they are used by Mission Planer.

I have found some collisions as well ... it means one port is being used by two parts of code - that's to be check by Alex.

Below is a summary:

54 A0 BAT Volt [MP: A0...A13] MP = Mission Planner configurable
55 A1 BAT Amps [MP: A1;A2;A13]
56 A2 RSSI [MP: A0;A1;A2;A13]
57 A3 FREE
58 A4 COPTER_LED_1 (AUX CH7) ;COPTER_LED_x are used by leds.pde, AP leds module.
59 A5 COPTER_LED_2 / PIEZO_PIN ;CONFLICT in leds.pde
60 A6 COPTER_LED_3 (GPS)
61 A7 COPTER_LED_4
34 D34 OPT_FLOW_CS_PIN ;my board has no d33;d34 pins soldered
35 D35 FREE

- module led.pde by Syberian conflicts with A0 A1 A2 - but I think it's an old piece of software, should not be used ....

- A6, A7 are not connected on AIO.

- BATT and RSSI pins could be free if functions will not be used.

- text below should be removed from APM_config.h as is no longer valid.
Defs are not used any more. Piezzo is enabled just by enabling leds.pde module.

// New in 2.0.43, but unused in MegairateNG
// MPNG: Piezo uses AN5 pin in ArduCopter, we uses AN5 for CLI switch
#define PIEZO DISABLED
#define PIEZO_LOW_VOLTAGE DISABLED
#define PIEZO_ARMING DISABLED



But still we have plenty of possibilities to run nice leds and buzzer
Paku is offline Find More Posts by Paku
Reply With Quote
Old Feb 21, 2013, 07:06 AM
Registered User
Joined Nov 2012
52 Posts
Quote:
Originally Posted by Paku View Post
ok, I have spent some hours on code and here is a summary what have I found.

..............

But still we have plenty of possibilities to run nice leds and buzzer
Hmmm... I would like to add an OSD in the future and RSSI would be handy to display. So I guess I can't use A0, A1, and A2. Since I really only want two different outputs right now, Arming and GPS, I think I will see about just using A3 and A4. I may hook up two legs to each of those analogs.
Oktavius is offline Find More Posts by Oktavius
Reply With Quote
Old Feb 21, 2013, 08:18 AM
Registered User
Poland, Mazowieckie, Warsaw
Joined Jan 2009
328 Posts
It's a matter of directing mpNG outputs to ATmega pins of your choice ....

Soft uses literal acronyms for ports while in true they are just a numers .. so:

Default leds defs look like this:


#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A4 // Motor or Aux LED
#define COPTER_LED_2 A5 // Motor LED
#define COPTER_LED_3 A6 // Motor or GPS LED
#define COPTER_LED_4 A7 // Motor LED
#define COPTER_LED_5 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_6 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN // Pin not available on Pirate boards


Where LED1 and LED 3 is interesting all others are just called MOTOR LEDS and do the same.

Why not just move out of A0...A5 slot /as it's used for some IMPORTANT staff like BATT V/I and RSSI and enable LEDS on side pins of the board. You have there whole bunch of pins like 32,33,A15 ... A8.

Will check if they are used for any thing /32,33 could be/ but if you just change defs above to something like this:


#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A8 // Motor or Aux LED
#define COPTER_LED_2 A9 // Motor LED
#define COPTER_LED_3 A10 // Motor or GPS LED
#define COPTER_LED_4 A11 // Motor LED
#define COPTER_LED_5 A12 // Pin not available on Pirate boards
#define COPTER_LED_6 A13 // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN // Pin not available on Pirate boards


It should work ..

The other issue is that A0..A5 could be configured as Analog/Digital converters (BATT V/I and RSSI). We do not need them as ADC, we need just poor OUTPUT PINs to drive transistors.

I think switching with LEDs and Buzzer to the side slots is a good idea ... but as I wrote I have to check if we will not get any other collisions.

Give me some time to dig further ....

Edit:

Ups... what a fail

The whole side line is used for Rx ... my bad .....


So not getting into next crazy ideas the simplest way I would go is just to use A3 A4 A5


#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A3 // Motor or Aux LED
#define COPTER_LED_2 NOT_A_PIN // Motor LED
#define COPTER_LED_3 A4 // Motor or GPS LED
#define COPTER_LED_4 NOT_A_PIN // Motor LED
#define COPTER_LED_5 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_6 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN // Pin not available on Pirate boards


This should make Piezzo working on A5 as well .....

So you would have:
A3 Aux Led
A4 GPS Led
A5 Piezzo

and no connection for motor Leds /Navigation lights just from Vcc/

or you can use ports like 32...35 /Camera control/ or free D35 for Motor leds or Piezzo


#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A3 // Motor or Aux LED
#define COPTER_LED_2 D35 // Motor LED
#define COPTER_LED_3 A4 // Motor or GPS LED
#define COPTER_LED_4 NOT_A_PIN // Motor LED
#define COPTER_LED_5 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_6 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN // Pin not available on Pirate boards


there is still some space to play with ....

Will try this:

#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A3 // Motor or Aux LED ///paku
#define COPTER_LED_2 A4 // Motor LED
#define COPTER_LED_3 A5 // Motor or GPS LED
#define COPTER_LED_4 NOT_A_PIN // Motor LED

with piezzo at d35

#define PIEZO_PIN 35 ///paku D35 pin
Paku is offline Find More Posts by Paku
Last edited by Paku; Feb 21, 2013 at 12:02 PM.
Reply With Quote
Old Feb 21, 2013, 01:08 PM
Registered User
Joined Nov 2012
52 Posts
Might be able to use A2 for LEDs. My Rx only has PMW RSSI which I believe won't work on A2. Would need to send directly to MinimOSD Extra.
Oktavius is offline Find More Posts by Oktavius
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion JR Indoor Photo Coverage - Higher Plane Productions JR Indoor Jim T. Graham JR Indoor Electric Festival 21 Dec 06, 2010 08:51 AM
Discussion We proudly present: brandnew Lubach F16 f. 90mm fan ost Electric Ducted Fan Jet Talk 17 Oct 03, 2010 12:46 PM
Poll nevermind pirates vs. ninjas Karl Bē Life, The Universe, and Politics 3 Sep 05, 2010 11:59 PM
Hobbico - Futaba Apparel and Accessories - Wear your Futaba orange proudly! Dave Lauck Product Announcements 0 Apr 18, 2005 06:13 PM