SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Feb 06, 2013, 08:47 PM
Registered User
Joined Dec 2006
1,441 Posts
the rx3s gyro does not measure attitude (rotation angles), instead it only measures rotation rates. you could integrate rotation rate to derive approximate angle, but i suspect it will drift quite badly over time. the best approach is to use an accelerometer, like the mpu6050, which provides both rotation rate and position.



as an aside, i came across this manual: http://www.geeetech.com/wiki/index.p...oller_PV_Fixed and noticed that it has a "Stunt flight locked mode", which, if i understand the text, seems to indicate that after you return sticks to neutral, the plane will try to hold or lock its attitude, somewhat like the 3d hold mode in guardian. since this thing only has gyros and no accel, it's probably not as stable as the guardian (and also cannot do wing leveling or your AHI), but just integrating rotation rate to get position might be sufficient for short term attitude approximation, particular if the pilot adjusts the stick to force it to rehold and relock the attitude occasionally. i believe this is what happens with heli AVCS gyros? the youtube video of a demo seems pretty good (see around 22s mark).

JCX M6 Aircraft Flight controller (1 min 6 sec)


seems interesting.


Quote:
Originally Posted by 0x0539 View Post
I was planning to output gyro data to the OpenLRS so I could have virtual horizon on a laptop.. I could hack this open firmware but I can't tell if it is noob safe, meaning that I'm not an expert flyer and if the gyro goes nuts it will be a confirmed crash. :-)
noobee is offline Find More Posts by noobee
Last edited by noobee; Feb 07, 2013 at 06:35 AM.
Reply With Quote
Sign up now
to remove ads between posts
Old Feb 09, 2013, 06:42 AM
Deviant
sbstnp's Avatar
Joined Jul 2012
1,180 Posts
Finally gotten around to have my V2 setup. Soldered a connector in place, I don't like it cause it increases the width but it's most convenient.

Gonna hook up some servos later today and see how it's going.

Too bad weather is miserable these parts.
sbstnp is online now Find More Posts by sbstnp
Reply With Quote
Old Feb 09, 2013, 12:59 PM
Registered User
United States, NC, Raleigh
Joined Oct 2011
820 Posts
Quote:
Originally Posted by sbstnp View Post
Finally gotten around to have my V2 setup. Soldered a connector in place, I don't like it cause it increases the width but it's most convenient.
You may want to put a small paint dot on both connectors since they are not keyed. May prevent a reversed connection.

John
JohnRB is online now Find More Posts by JohnRB
Reply With Quote
Old Feb 09, 2013, 02:09 PM
Deviant
sbstnp's Avatar
Joined Jul 2012
1,180 Posts
Quote:
Originally Posted by JohnRB View Post
You may want to put a small paint dot on both connectors since they are not keyed. May prevent a reversed connection.

John
My USBAsp is keyed, but VCC isn't connected, I didn't even solder a pin since the flashing rig isn't capable of 3.3V, I power the device through a receiver. Thanks for the advice though
sbstnp is online now Find More Posts by sbstnp
Reply With Quote
Old Feb 09, 2013, 04:03 PM
Registered User
United States, NC, Raleigh
Joined Oct 2011
820 Posts
Quote:
Originally Posted by sbstnp View Post
My USBAsp is keyed, but VCC isn't connected, I didn't even solder a pin since the flashing rig isn't capable of 3.3V, I power the device through a receiver. Thanks for the advice though
In that case there is another danger. Always make sure the RX3S has power before connecting the programmer. If not the processor chip will be damaged and need to be replaced. (I did this twice before a switched to a programmer that supplies 3.3V).
JohnRB is online now Find More Posts by JohnRB
Reply With Quote
Old Feb 09, 2013, 05:06 PM
Deviant
sbstnp's Avatar
Joined Jul 2012
1,180 Posts
Quote:
Originally Posted by JohnRB View Post
In that case there is another danger. Always make sure the RX3S has power before connecting the programmer. If not the processor chip will be damaged and need to be replaced. (I did this twice before a switched to a programmer that supplies 3.3V).
Strange. I did it exactly opposite today about 3 times and it's still working. Maybe something on your end? Anyway good to know. Totally agree about a programmer that could suply 3.3v.

noobee, I tested your cmake on Linux today it's working great.
But, you should replace

#include <arduino.h>

with

#include <Arduino.h>

compile fails cause Linux files systems are usually case-sensitive. Should not affect Windows in any way.
sbstnp is online now Find More Posts by sbstnp
Reply With Quote
Old Feb 09, 2013, 09:29 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Could spend little more on a buffered programmer http://www.hobbyking.com/hobbyking/s...yISP_V2_0.html
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Feb 10, 2013, 12:02 AM
Registered User
Joined Dec 2006
1,441 Posts
cppm update and question

hey all

an update and a question.

i'm almost done enabling cppm support. i have several frsky d4r-ii rx'es, which are 4-ch regular but can emit 4/6/8 ch in cppm mode (with open9x for example). since i wanted another aux2 input for that attitude hold experiment, i went on to finish up cppm support for both rx3s v1 and v2. now, if you have a frsky rx, you can just connect the cppm output to ail_in and which will accept
rudder, elevator, throttle, aileron, aux1, aileron_left, aux2 (7 channels currently). furthermore, the throttle signal is passed through to the rud_in pin, which then connects to the esc. (see pic below for rx3s v1 connections with cppm).

now the question. should we use the AIL switch to determine CPPM mode or should we leave it as a compile time option, which means another set of (2) .hex files (so that we can reserve that AIL switch for something else in the future?)

the current code (and generated hex files are at https://github.com/noobee/FlightStab/tree/cppm). Please be careful with the throttle channel now that it runs through the stabilizer!





thanks!
noobee is offline Find More Posts by noobee
Last edited by noobee; Feb 10, 2013 at 10:22 AM. Reason: add v2 connections with cppm
Reply With Quote
Old Feb 10, 2013, 12:24 AM
Registered User
Joined Dec 2006
1,441 Posts
great! thanks for the feedback.

i'll update the code with the proper case.


Quote:
Originally Posted by sbstnp View Post
noobee, I tested your cmake on Linux today it's working great.
But, you should replace

#include <arduino.h>

with

#include <Arduino.h>

compile fails cause Linux files systems are usually case-sensitive. Should not affect Windows in any way.
noobee is offline Find More Posts by noobee
Reply With Quote
Old Feb 10, 2013, 02:39 AM
Deviant
sbstnp's Avatar
Joined Jul 2012
1,180 Posts
Quote:
Originally Posted by SadSack View Post
Could spend little more on a buffered programmer http://www.hobbyking.com/hobbyking/s...yISP_V2_0.html
Thanks for the link, gonna order one.
sbstnp is online now Find More Posts by sbstnp
Reply With Quote
Old Feb 10, 2013, 05:05 AM
Registered User
Joined Oct 2012
5 Posts
Hello,

I want to say thank you everyone and especially to noobee for effort to create really useful firmware for that devices.

I have V2 and planned to use flaperons with stabilizer.
With original firmware in order to have flaperons I tried to use
two V-tail mixers and one signal reverse according to proposition I found here in description
http://www.youtube.com/watch?v=ri2W9e9odME

Unfortunately the chain of devices : stabilizer + V-tail mixer + reverse in total generate delay about 0,5 second. With such feedback I could forget to have control on aircraft. So this is not the solution.

Then I found you thread and plan to try your firmware in near future.
Thank you again!

I have HobbyKing's "USBasp AVR Programming Device for ATMEL proccessors"
http://www.hobbyking.com/hobbyking/s...dProduct=21321

This have option to supply 5v or not supply power.
In case of 5v there is change to burn gyro;
In case of no power and wrong connection of power from RX there is chance to burn ATMEL.

I have a question/proposition:
what do you think about using two JR connectors from one side (to connect to programmer connector) and wires to 5/6v power input of stabilizer (before 3.3 voltage regulator) just like the RX supply the stabilizer but in case of programming the power will be take from programmer. The other signal wires just solder to appropriate contacts.

The signal contacts of JR connects make more short so the ground will be connected first and then 5V and then signals.

I would like to know your opinion about this way before try this.

Thanks,
BR.
hmmars is offline Find More Posts by hmmars
Reply With Quote
Old Feb 10, 2013, 05:57 AM
Deviant
sbstnp's Avatar
Joined Jul 2012
1,180 Posts
Quote:
Originally Posted by hmmars View Post
I have HobbyKing's "USBasp AVR Programming Device for ATMEL proccessors"
http://www.hobbyking.com/hobbyking/s...dProduct=21321

This have option to supply 5v or not supply power.
In case of 5v there is change to burn gyro;
In case of no power and wrong connection of power from RX there is chance to burn ATMEL.

I have a question/proposition:
what do you think about using two JR connectors from one side (to connect to programmer connector) and wires to 5/6v power input of stabilizer (before 3.3 voltage regulator) just like the RX supply the stabilizer but in case of programming the power will be take from programmer. The other signal wires just solder to appropriate contacts.

The signal contacts of JR connects make more short so the ground will be connected first and then 5V and then signals.
.
Great idea. It works wonderfully. Check out the pics, I don't have the VCC pin connected on the device and I tap 5V from the 10pin connector with some jumper cables I had laying around.
sbstnp is online now Find More Posts by sbstnp
Reply With Quote
Old Feb 10, 2013, 08:02 AM
Registered User
Joined Dec 2006
1,441 Posts
cmake help needed

@idonasch and @sbstnp

since you have cmake running, can you help take a stab () at two problems that i am facing?

1. i'm trying to set up the ability to build permutations with various flags enabled (eg USE_SERIAL, MOD_PCINT0):

Quote:
# test permutations (TODO: build only on "make test_targets")
add_arduino_firmware(TEST_RX3S_V2_MOD_PCINT0 FlightStab pro5v "RX3S_V2;MOD_PCINT0")
add_arduino_firmware(TEST_RX3S_V2_SERIAL FlightStab pro5v "RX3S_V2;USE_SERIAL")
add_arduino_firmware(TEST_RX3S_V2_USE_I2CDEVLIB FlightStab pro5v "RX3S_V2;USE_I2CDEVLIB")
now it keeps building them all the time, i would like build them only when i type "make test_targets".

2. if i set USE_I2CDEVLIB, i'm not sure how to build the library first (is that needed?), otherwise i seem to get a linking error:

Quote:
Linking CXX executable TEST_RX3S_V2_USE_I2CDEVLIB.elf
CMakeFiles/TEST_RX3S_V2_USE_I2CDEVLIB.dir/TEST_RX3S_V2_USE_I2CDEVLIB_FlightStab.cpp.obj: In function `__static_initialization_and_destruction_0':
c:/Users/z570/Desktop/FlightStab/FlightStab/FlightStab.ino:211: undefined reference to `ITG3200::ITG3200()'
...
c:/Users/z570/Desktop/FlightStab/FlightStab/FlightStab.ino:1029: undefined reference to `ITG3200::getRotation(int*, int*, int*)'
make[2]: *** [TEST_RX3S_V2_USE_I2CDEVLIB.elf] Error 1
make[1]: *** [CMakeFiles/TEST_RX3S_V2_USE_I2CDEVLIB.dir/all] Error 2
make: *** [all] Error 2
noobee is offline Find More Posts by noobee
Reply With Quote
Old Feb 10, 2013, 08:52 AM
Registered User
idonasch's Avatar
Germany, Berlin
Joined Jun 2004
71 Posts
Quote:
Originally Posted by noobee View Post
@idonasch and @sbstnp

since you have cmake running, can you help take a stab () at two problems that i am facing?

1. i'm trying to set up the ability to build permutations with various flags enabled (eg USE_SERIAL, MOD_PCINT0):


now it keeps building them all the time, i would like build them only when i type "make test_targets".

2. if i set USE_I2CDEVLIB, i'm not sure how to build the library first (is that needed?), otherwise i seem to get a linking error:
I might answer this too quickly and make a fool out of myself, but...
- checked out the master branch
- fixed the "Arduino.h" include...
- had to change a FATAL mesg to STATUS in the Arduino.cmake file (who knows why, must be my linux version of cmake) or cmake would bail out with a misleading message....
- added the 3 "add_arduino_firmware(...)" targets
- commented out the USE_I2CLIGHT define in the source (multiple defined)
- added link_directories(~/Arduino/libraries) to CMakeFiles.txt
- created build_ido
- cd build_ido; cmake .. -DARDUINO_SDK_PATH=/home/ingo/src/ATmega/arduino-1.0.3
- did a "make TEST_RX3S_V2_SERIAL" which built the libs and the executable
- did a "make TEST_RX3S_V2_MOD_PCINT0" which just built the other executable.

works great (well, this was all done under linux)!!!???

I think I really didn't get your problem????

problem 2 is usually a mismatch between header files and library. the ITG3200 file seems to be missing, but that's from the I2Clib which you're not using anymore?!! something is out of sync. delete the build directory and start fresh. if that doesn't fix it, you have a header file somewhere in your include path that is only picked up by the app and not the lib (or vv.). the "link_directories" might be the ticket!

hope this helps
ingo

ps. if your source files are on a remote host, make sure the machine times are in sync or make might get confused and does not make files it should or vv.
idonasch is offline Find More Posts by idonasch
Reply With Quote
Old Feb 10, 2013, 09:39 AM
Registered User
idonasch's Avatar
Germany, Berlin
Joined Jun 2004
71 Posts
OpenAero port to RX3S_V1

well, noobee I cheated on you

I ported OpenAero (not OpenAero2) to the RX3S because it worked much smoother on the KK board then my FlightStab port was. during that process I noticed a couple things that you might be interested in yourself for the FlightStab project:
- the servo output is generated by instruction counting in assembler - yikes! but it works beautifully because 4 servos are handled at the same time and interrupts are blocked. I'm tempted to change that to poll the TCNT1 rather counting clock cycles. that makes it portable and more accurate.
- the servo output is triggered after all Rx inputs have been read the PID was calculated. no jitter at all! I really didn't expect that until I tested it.
- provisions for autoleveling are in the code but only available if the platform has an accelerometer. isn't (roll-rate * time) sufficient to know where the plane is heading?
- they have a nice built-in configuration menu when you connect a sparkfun 16x2 LCD to the unit with soft serial (another project I tinkered with). the gimbals are used to navigate through the menu.
- openaero2 (the version for the KK2 board) is now much more advanced, it has configurable mixers (presets or user configurable). I'm thinking of pulling that back into the OpenAero port. looks pretty cool to me.
- delta and flaperon mixing was already implemented, unfortunately that interfered with delta mixing (gimbal navigation was keyed of servo input that already came in mixed) I had to un-mix that!

I think OpenAero is a project worth looking at, also the MultiWii project!

unfortunately there was a lot of work to port OpenAero to a different platform: use cmake instead of avr studo, convert to C++ (that was unexpectedly painless) and use magic templates to hide hard coded machine specifics. also lots of ifdefs were in place to distinguish the 2 supported variants, but this should have been done by feature rather then platform. the experience from doing the FLightStab port came in really handy. I'm not quite sure which project I'm sticking with.... The MultiWii Mini board arrived yesterday....
well, its done now, just waiting for flyable weather.
idonasch is offline Find More Posts by idonasch
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Sold Flight Stabilization System with Programing Card Woody_99 Aircraft - Electric - Helis (FS/W) 1 Mar 23, 2012 12:50 PM
Sold Flymentor Flight Stabilization with Field Programmer Woody_99 Aircraft - General - Radio Equipment (FS/W) 0 Mar 17, 2012 07:43 AM
Sold Totally Tricked out 400 size with flight stabilization installed, BNF Woody_99 Aircraft - Electric - Helis (FS/W) 2 Mar 12, 2012 06:56 AM
Wanted FY-30A Flight Stabilization System Casey_S FPV Equipment (FS/W) 0 Mar 05, 2012 02:40 PM