SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Oct 15, 2012, 02:18 AM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Quote:
Originally Posted by vertcnc View Post
Ok, I am baffled. I did measure the joystick pots wrong they are 5k. V on wiper is 2.5v. one side ground the other side measured at 5v. so when I measure the voltage while moving the joystick I get 1.8v one direction and 3v the other, centered 2.5v. so the joystick is not using the whole range of the pot.
raw data in test mode indicates 504 centered 636 one direction and 369 the other. If I change the code as suggested, raw data does not change.
Raw data won't change, 0vdc = 0, 5vdc = 1023...........and that's fixed. It's the output of the scaling calculation that will change, i.e. the PPM values.

You are not getting much of a range in your raw value, but it may be ok.
I'd also tweak the centre to 504, that will make sure your stick is trimmed centre off the bat.

By making all these tweaks and settings you should have the full PPM range when moving the stick, and properly centred. Use the TEST mode to confirm this.

Ian.
IanJ is offline Find More Posts by IanJ
Reply With Quote
Sign up now
to remove ads between posts
Old Oct 15, 2012, 09:09 AM
Registered User
Illinois, USA
Joined Aug 2009
968 Posts
Ok, I will check the PPM out in the test mode and see where I am at. Appreciate the help.
Thanks
vertcnc is offline Find More Posts by vertcnc
Reply With Quote
Old Oct 15, 2012, 02:54 PM
Arducopter Developer
R_Lefebvre's Avatar
Joined Oct 2010
2,389 Posts
Quote:
Originally Posted by vertcnc View Post
Ok have code up and running on arduino mega, I am using Aurora 9 joysticks. It appears that the output on the pots only vari from 1.8 v to 3.0v. Is there a way to scale these so the raw data is correct. it appears that these are only 500 ohm pots.
Did it take much work to get it running?
R_Lefebvre is offline Find More Posts by R_Lefebvre
Reply With Quote
Old Oct 15, 2012, 05:38 PM
Registered User
Illinois, USA
Joined Aug 2009
968 Posts
Quote:
Originally Posted by R_Lefebvre View Post
Did it take much work to get it running?
No, not really. Just takes a little bit to learn the code. Changed to I2c display, and also seperate trim switches per each axis. I am just a rookie with arduino, but getting there.
vertcnc is offline Find More Posts by vertcnc
Reply With Quote
Old Oct 25, 2012, 02:51 PM
Arducopter Developer
R_Lefebvre's Avatar
Joined Oct 2010
2,389 Posts
vertcnc, do you mind sharing your code?

I'm thinking of trying one of these LCD shields with integrated buttons. Anybody have any input on that idea?

I just realized what you are talking about with the Aurora 9 joysticks. I wish I had noticed those earlier. I almost bought the joysticks at servo city, but I think the Aurora's will be much nicer.

But do I understand correctly that you basically only have 267 bits of resolution on those sticks? Maybe it's OK, though it seems low.
R_Lefebvre is offline Find More Posts by R_Lefebvre
Last edited by R_Lefebvre; Oct 25, 2012 at 02:57 PM.
Reply With Quote
Old Nov 01, 2012, 01:34 PM
Registered User
rimshotcopter's Avatar
United States, CA, Los Angeles
Joined Aug 2009
11,707 Posts
Brilliant work! Thanks
rimshotcopter is offline Find More Posts by rimshotcopter
Reply With Quote
Old Nov 01, 2012, 02:14 PM
Registered User
Illinois, USA
Joined Aug 2009
968 Posts
Quote:
Originally Posted by R_Lefebvre View Post
vertcnc, do you mind sharing your code?

I'm thinking of trying one of these LCD shields with integrated buttons. Anybody have any input on that idea?

I just realized what you are talking about with the Aurora 9 joysticks. I wish I had noticed those earlier. I almost bought the joysticks at servo city, but I think the Aurora's will be much nicer.

But do I understand correctly that you basically only have 267 bits of resolution on those sticks? Maybe it's OK, though it seems low.
Code is pretty much what Ian provided. I just ported the LCD to an IC2 dsiplay. Currently working on adding seperate trim switched for each stick axis. Soon as I get a little further along, I can provide copy of changes I have made.
vertcnc is offline Find More Posts by vertcnc
Reply With Quote
Old Nov 02, 2012, 09:38 AM
Arducopter Developer
R_Lefebvre's Avatar
Joined Oct 2010
2,389 Posts
Ok, I'd appreciate seeing it. The LCD stuff is new to me.

I'm humming and hawing about going with the Arduino Due instead of the Mega, to take advantage of the Audio driver. I'd love to be able to have it give audio feedback about the flight condition.
R_Lefebvre is offline Find More Posts by R_Lefebvre
Reply With Quote
Old Nov 02, 2012, 09:50 AM
Arducopter Developer
R_Lefebvre's Avatar
Joined Oct 2010
2,389 Posts
Oops
R_Lefebvre is offline Find More Posts by R_Lefebvre
Reply With Quote
Old Nov 02, 2012, 02:09 PM
Registered User
Illinois, USA
Joined Aug 2009
968 Posts
Quote:
Originally Posted by R_Lefebvre View Post
Ok, I'd appreciate seeing it. The LCD stuff is new to me.

I'm humming and hawing about going with the Arduino Due instead of the Mega, to take advantage of the Audio driver. I'd love to be able to have it give audio feedback about the flight condition.
LCD stuff is pretty easy as far as programming. You just need the arduino library for the particular LCD type your using. Most places that sell the LCD'S have sample code and the library available.
The thing that I don't know about is Ian used a serial LCD and I am using a I2C LCD, the I2C LCD's may need more resources and mess with the timing, But havn't found it to be a problem yet. Havn't really tested using RF module so time will tell. Busy right now working on the hardware configuration, joysticks, buttons, lcd and such. Let you know.
vertcnc is offline Find More Posts by vertcnc
Reply With Quote
Old Nov 02, 2012, 02:14 PM
Registered User
charlienofun's Avatar
United States, CA, Santa Clara
Joined Mar 2008
374 Posts
Quote:
Originally Posted by vertcnc View Post
LCD stuff is pretty easy as far as programming. You just need the arduino library for the particular LCD type your using. Most places that sell the LCD'S have sample code and the library available.
The thing that I don't know about is Ian used a serial LCD and I am using a I2C LCD, the I2C LCD's may need more resources and mess with the timing, But havn't found it to be a problem yet. Havn't really tested using RF module so time will tell. Busy right now working on the hardware configuration, joysticks, buttons, lcd and such. Let you know.
What I2C display are you using? I started a version for use with the web4robots i2c LCD http://www.arduino.cc/playground/Code/LCDi2c but I stopped I don't really need a display as I send the signals through my futaba and let it do the mixing/trims etc.

http://www.wentztech.com/radio/ardui...es/LCDI2C.html
charlienofun is offline Find More Posts by charlienofun
Reply With Quote
Old Nov 02, 2012, 02:29 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
I used a serial LCD mainly due to resources.

Analogue Input pins (0-5vdc):
Pin 0 = Elevator potentiometer --> PPM Ch.2 - Elevon mix Aeleron 2 (averaged) (Invert mode) (Exponential mode)
Pin 1 = Aeleron potentiometer --> PPM Ch.1 - Elevon mix Aeleron 1 (averaged) (Invert mode) (Exponential mode)
Pin 2 = Rudder potentiometer --> PPM Ch.4 (averaged) (Invert mode) (Exponential mode)
Pin 3 = Throttle potentiometer --> PPM Ch.3 (averaged)
Pin 4 = Aux potentiometer 1 --> PPM Ch.6
Pin 5 = Battery Voltage (2.2v at input to display 12.6v)
Pin 6 = Aux potentiometer 2 --> PPM Ch.7

Digital Input pins:
Pin 2 = Function panel button
Pin 3 = Trim adj panel button
Pin 4 = Trim adj panel button
Pin 5 = HI/LO rates set panel button
Pin 6 = Thumb stick AEL up
Pin 7 = Thumb stick AEL down
Pin 8 = Thumb stick ELE up
Pin 9 = Thumb stick ELE down
Pin 13 = Aux switch 1 --> PPM Ch.5
Pin 11 = Aux switch 2 --> PPM Ch.8

Digital Output pins:
Pin 10 = PPM output
Pin 12 = Buzzer output
Pin 1 = Txout, Serial LCD (TTL mode)
IanJ is offline Find More Posts by IanJ
Reply With Quote
Old Nov 02, 2012, 02:41 PM
Registered User
rimshotcopter's Avatar
United States, CA, Los Angeles
Joined Aug 2009
11,707 Posts
Spectrum Protocol

lanJ,

How hard do you feel it will be to implement the Spectrum Protocol into your fantastic creation? The hope is to bypass the PWM transmission and send this information over Xbee or some other similar system.

Quote:
The Protocol
The protocol transmits data in frames of 16 bytes. The first 2 bytes are header bytes used for syncing the communication. Then the channels are transmitted one by one. Where one channel consist of two bytes.


[Header][Aileron][Flaps][Elevator][Rudder][Throttle][Gear][Ch7]



(The channel order might change depending on 6 vs 7 channel transmitter and Mode 1 vs Mode 2 Stick setup on the transmitter, use serial monitor to find the right order of the channels)


Header
always consist of
byte 0x03 followed by 0x01.


Aileron
Range: 1024 - 2046
Center: 1535


Flap
Range: 5120 - 6142
Center: 5631


Elevator
Range: 2048 - 3070
Center: 3582


Rudder
Range: 3072 - 4094
Center: 3582


Throttle
Range: 0 - 1022
Center: 511


Gear
Range: 4096 - 5118
Center: 4607 (Theoretic)


Channel 7
Range: 6144 - 7166
Center: 6144


NOTICE: You will normaly newer reach the endpoints of the ranges. For example the throttle channel will normaly go from aproximately 150 to 850. The rest of the range is avilable for trim and travel adjustment. Setting the travel adjustment to 125% and subtrim all the way in one direction will let jet you reache the end points.
http://www.dogfight.no/2011/01/spect...o-arduino.html
rimshotcopter is offline Find More Posts by rimshotcopter
Last edited by rimshotcopter; Nov 02, 2012 at 02:47 PM.
Reply With Quote
Old Nov 02, 2012, 03:55 PM
Registered User
Illinois, USA
Joined Aug 2009
968 Posts
Quote:
Originally Posted by charlienofun View Post
What I2C display are you using? I started a version for use with the web4robots i2c LCD http://www.arduino.cc/playground/Code/LCDi2c but I stopped I don't really need a display as I send the signals through my futaba and let it do the mixing/trims etc.

http://www.wentztech.com/radio/ardui...es/LCDI2C.html
I think that the same brand I have. 20x4. I have it working just fine. Working on bar graph code for battery display at the moment.
vertcnc is offline Find More Posts by vertcnc
Reply With Quote
Old Nov 02, 2012, 04:57 PM
Arducopter Developer
R_Lefebvre's Avatar
Joined Oct 2010
2,389 Posts
Quote:
Originally Posted by IanJ View Post
I used a serial LCD mainly due to resources.

Analogue Input pins (0-5vdc):
Pin 0 = Elevator potentiometer --> PPM Ch.2 - Elevon mix Aeleron 2 (averaged) (Invert mode) (Exponential mode)
Pin 1 = Aeleron potentiometer --> PPM Ch.1 - Elevon mix Aeleron 1 (averaged) (Invert mode) (Exponential mode)
Pin 2 = Rudder potentiometer --> PPM Ch.4 (averaged) (Invert mode) (Exponential mode)
Pin 3 = Throttle potentiometer --> PPM Ch.3 (averaged)
Pin 4 = Aux potentiometer 1 --> PPM Ch.6
Pin 5 = Battery Voltage (2.2v at input to display 12.6v)
Pin 6 = Aux potentiometer 2 --> PPM Ch.7

Digital Input pins:
Pin 2 = Function panel button
Pin 3 = Trim adj panel button
Pin 4 = Trim adj panel button
Pin 5 = HI/LO rates set panel button
Pin 6 = Thumb stick AEL up
Pin 7 = Thumb stick AEL down
Pin 8 = Thumb stick ELE up
Pin 9 = Thumb stick ELE down
Pin 13 = Aux switch 1 --> PPM Ch.5
Pin 11 = Aux switch 2 --> PPM Ch.8

Digital Output pins:
Pin 10 = PPM output
Pin 12 = Buzzer output
Pin 1 = Txout, Serial LCD (TTL mode)
I see. Well since I'm using the Mega, I have a few more pins available. Plus, I don't plan to have the thumb stick buttons.

How would an I2C LCD compare to a "4 bit" version. I might think the 4-bit will use up hardware timers? Basically I'm wondering which one would take up the least resources.

I'd like to be able to have the Mega talking to a GPS (serial), Xbee (serial), a compass (I2C?) and then of course outputting the PPM stream at the highest priority for best performance of that.
R_Lefebvre is offline Find More Posts by R_Lefebvre
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Looking for cheap RC radio TX/RX sets 1145climber Electric Power Cars 3 Apr 08, 2010 06:24 AM
Build Log Re-inventing /modding Thunder tiger's P-51D Mustang kusunokimasahige Electric Warbirds 12 Mar 22, 2010 01:57 PM
Discussion Re-inventing the wheel philgib Blimps 5 May 25, 2006 07:42 PM