Helicopter integration

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

@Silas.
Tere's a setting in the gui DynThrittlePidAttenuiantio (TPA)
It's pretty mutch what you want.
viewtopic.php?f=8&t=594&p=13226#p13226
It's based on throttle value but could be modified to use a AUX as input.

little nellie
Posts: 33
Joined: Mon Jun 11, 2012 6:44 pm

Re: Helicopter integration

Post by little nellie »

Hello Patrik,

Yes.. something like that. How can I modified to use a AUX as input instead of using the throttle channel?

Dynamic is even better... meaning it is adjustable, correct?

thanks

/Silas

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

In Mwii file.

Code: Select all

 #define BREAKPOINT 1500
  // PITCH & ROLL only dynamic PID adjustemnt,  depending on throttle value
  if   (rcData[THROTTLE]<BREAKPOINT) {
    prop2 = 100;
  } else {
    if (rcData[THROTTLE]<2000) {
      prop2 = 100 - (uint16_t)conf.dynThrPID*(rcData[THROTTLE]-BREAKPOINT)/(2000-BREAKPOINT);
    }

Change rcData[THROTTLE] to ex. rcData[AUX3]
BREAKPOINT is where the effect starts.

On a pot you can set.
BREAKPOINT 1100 and TPA 100.
Then you will ba able to controll it between Full Pid effect to non.

little nellie
Posts: 33
Joined: Mon Jun 11, 2012 6:44 pm

Re: Helicopter integration

Post by little nellie »

Hello Patrik,

thanks.. I found the MWii code and can change that to AUX3. I try to look for define in config.h tab and unable to locate any AUX3. In Def.h tab, looks like AUX3 is pointing to PIN A14. I have a Crius SE board and does not appear they bring that pin out. However, D13 appears to be not use. Can I use D13 as AUX3?

I try to look at the code in RX tab, since I am not a programmer, I have no idea how to add to make use of D13 for AUX3. Can you help?

thanks

/Silas

palton
Posts: 48
Joined: Fri Sep 02, 2011 4:06 pm

Re: Helicopter integration

Post by palton »

How well does the MW heli implementation work?

I havent really seen anything on forums or youtube regarding it. Mostly looks some expermenting. I guess it works, but how well?

Just curious, as I'm putting a HK450 togehter atm. Is it worth putting a MW on as a heli controller, or better go for something else? I guess the answer depends what my purpose is. I have an old APM1 I could play with as well, but that means i have to take a hexa into pieces. I would like to reuse stuff I already got.

As I got some spare hw that I can use for this specific purpose (MW heli), maybe it is worth giving it a go?
Flow sensor and sonar support, is it included in Patriks branch (or have heli integration work converged with trunk?) I havent followed that lately, what is status of that? i know there where someones branch earlier that implemented that.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

You should use the latest dev or 2.1 candidates.
My branch is a older version that was very stable.
Heli is included there with all other new features included.

Only real testing iw'e sen of so far is Hamburgers report in this thread.
viewtopic.php?f=8&t=1562&start=40#p15319

/Patrik

palton
Posts: 48
Joined: Fri Sep 02, 2011 4:06 pm

Re: Helicopter integration

Post by palton »

Thx, I read his comments according to the link.

Copy Hamburger, Anything more since you wrote that hamburger. More experiences or is the heli put away now Hamburger?

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

Works as described here. Second helicopter in the works with 4 bladed head.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

small update: another heli 325mm blades, 4 bladed head, up and running.
Again, tail/yaw is not as good as any reasonable 10$ heading hold gyro.

palton
Posts: 48
Joined: Fri Sep 02, 2011 4:06 pm

Re: Helicopter integration

Post by palton »

Are you using a separate headholding gyro for tail, and IMU for other axis, or IMU for all axis?

Video bitte. It would be nice to see how it works :=)

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

Only cheap crius lite with oled piggypacked, no hh gyro. I have not given up yet to improve on yaw code.

User avatar
Aluken
Posts: 1
Joined: Sat Dec 10, 2011 7:03 pm

Re: Helicopter integration

Post by Aluken »

great work!!!! :P :P

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

the video proof you asked for :)

cx450.4-mwc-1 http://www.vidup.de/v/9DOJ2/
cx450.4-mwc-2 http://www.vidup.de/v/yhgpi/

as you can see the tail does weird things. A hh gyro could do much better. MWii has ways to go.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Helicopter integration

Post by copterrichie »

Hamburger wrote:the video proof you asked for :)

cx450.4-mwc-1 http://www.vidup.de/v/9DOJ2/
cx450.4-mwc-2 http://www.vidup.de/v/yhgpi/

as you can see the tail does weird things. A hh gyro could do much better. MWii has ways to go.



Very interesting, in fact extremely interesting!!!

Question, how would the usage of Digital Servos work here?

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

Zero difference. It already runs on digital servos mg922.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Helicopter integration

Post by copterrichie »

Thank you, follow up question, what refresh rate?

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

Still default 50Hz.
When I tried 160Hz on the other copter with mg90 analog servos I wventually got random
Servo jitter and crash.
I will test 160hz and 300hz woth the digitals soon.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Helicopter integration

Post by copterrichie »

I will be watching with some popcorn. :)

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

What do you expect to see?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Helicopter integration

Post by copterrichie »

Well, I been meaning to test some digital servos with the 490hz Motor updates, just have not gotten around to doing that.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

Intermittently the heli drops about 1m but otherwise remains stable.
So I think it is all 3 cyclic servos move simultaneously to center or low and then recover to hover position.
Not sure if tail servo makes same movement.
Has happened on both mwii helis.
Any idea what could be causing this?

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Helicopter integration

Post by Alexinparis »

I suppose it's related to vibration.
When vibration are problematic, it's sometime possible to fly but with a reduced power.
I think it happens when all axis PIDs go in the same direction, leading to a cyclic overall pitch variation in case of heli

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

I suppose it's related to vibration

ok, but
any idea how to tame it down even more? GYRO.SMOOTHING is up to (75, 75, 40) already. I am afraid to increase much more, because I assume it will with new values taking longer to effectively influence the mwc. This would introduce more 'lag'; like it will feel squishy.
Using the other gyro smoothing function MMGYRO might be better, but I am still unsure which value for that option to begin with.
Faulty settings easily result in a crash. With a heli that definitely means broken parts and lengthy repairs each time.

hkubota
Posts: 35
Joined: Wed Sep 05, 2012 2:48 pm

Re: Helicopter integration

Post by hkubota »

To make sure vibrations are not the issue, should it not be sufficient, to add some mass to the FC (metal plate should work), put this on soft stuff (foam) so that vibrations are mostly eliminated? For a test about vibrations I did this for my Naze32 to make sure the acc readings are not caused by the motor/prop vibrations.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

short answer: yes.
But
How much is enough but not too much? I went with regular heli gyro double sided tape. What is good for a gyro is good for mwc?
From past experience with multicopters I learnt to not overdo the foam/dampening.

Helis have so much more vibration than your regular multicopter. That is why I use gyro.smoothing. From my an others' experience it seems one cannot go without for a decent sized heli. We are only at the beginning of MWii on helis (missing good HH tail gyro functionality).

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Helicopter integration

Post by copterrichie »

I never really had a problem with vibration however I am very curious to find out if lowering the Accelerometer G-range from 8g to 4g or even 2g will help?

Edited: And making adjustments to "float wGyro = 300; // gyro weight/smooting factor"

jtrides65
Posts: 1
Joined: Wed Oct 10, 2012 3:59 pm

Re: Helicopter integration

Post by jtrides65 »

i wish i had this on my new 500 helicopter. i bought a tarot flybarless controller from hobby king and it doesnt work, no tech support. if and when you get this working and decide to sell it please let me know, im all about trying new controllers.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

Get a new controller and start.... :D
MWC MultiWii SE 39 USD

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

I made the alternate gyro smoothing method named MMGYRO (by magnetron) into a tunable parameter (stored in eeprom). It is available as r1241. Anyone willing to test fly it and compare against GYRO_SMOOTHING? Magnetron was convinced the equal weighted MMGYRO method with shorter vector should behave better than the weighted GYRO_SMOOTHING method with large value.

I fly successfully with GYRO_SMOOTHING = (45, 45, 45), but could not get a comparable result with MMGYRO; tested this with values from 10 to 25. Maybe that is because of my poor helicopter mechanics only?

It is possible to compile in both gyro smoothing methods in one sketch. To test fly, only one should be active; the other can be effectively disabled by setting its value(s) to 1. So it is easy to tune and compare without repeated compile&flash.

Testers report back here, please.

olaf45
Posts: 24
Joined: Sun Nov 25, 2012 11:38 am
Location: France

Helicopter integration

Post by olaf45 »

Hi,

I'm new user of the Patrick.E code and I have fitted a FBL head on my HDX450 with and the management is made by arduino mini... Before 1st test I have some questions :
- Why do you have to connect the throttle to the arduino and not directly to the ESC. You needn't to manage engine for FBL?
- In the code , I don't find where is the calculation of the phasis according to the gyroscopic precesion.

Thanks for you help

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

MWii does use throttle input for configuration stick combos and controls throttle for failsafe, armed vs. unarmed etc.
Throttle management like governor may get implemented into MWii in future.

no phasis calculation is done. You need setup phasis mechanically - probably 90 degrees?

olaf45
Posts: 24
Joined: Sun Nov 25, 2012 11:38 am
Location: France

Re: Helicopter integration

Post by olaf45 »

Thanks for your answers. I'll give you feedback after my first tests.

Imen
Posts: 20
Joined: Thu Sep 27, 2012 5:11 pm

Re: Helicopter integration

Post by Imen »

Hi, is anyone had tried to big size heli, ex 700 size :?:

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

I thought Patrik uses a servo to control throttle on his gasser - so most likely flying big?

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

Hamburger wrote:I thought Patrik uses a servo to control throttle on his gasser - so most likely flying big?

Sorry i'we only tested it on a 450 size.
My Gasser have been seriously crashed once and have too much vibrations after the rebuild. :cry:

olaf45
Posts: 24
Joined: Sun Nov 25, 2012 11:38 am
Location: France

Re: Helicopter integration

Post by olaf45 »

Hi,

I've finished the integration in my HDX450. It seems to be great but I have something I don't understand.
After calib_acc, when I switch from acc_mode to passthru , nothing spends and I find that's good. But when I switch to normal mode, the left and nick servos move slowly to an around 50 offset.

Can you help me ?

Thanks

olaf45
Posts: 24
Joined: Sun Nov 25, 2012 11:38 am
Location: France

Re: Helicopter integration

Post by olaf45 »

Hi,

I had my first flight this afternoon with FBL head and normal mode , after setting up PID for roll and nick (P=3 /I=0.01/ D=10 ) and smoothing (20,20,4) . For the yaw, I kept my GY401 working ( not everthing at the same time step by step ). There're some little jerks for rapid movement but it's flyable and quite good.
I tried the level mode and it was catastrophic. My helico danced the lambada and it was difficult to avoid the crash . I tried different tunings but it was not better. On my desk ( rotor and blades stopped ) when I move it back and forth, the level correction is good.
What is your feedback about it ?

Thanks

Imen
Posts: 20
Joined: Thu Sep 27, 2012 5:11 pm

Re: Helicopter integration

Post by Imen »

Hi Patrik

How about if we use governor (mine GV-o1) for throttle control in gasser ?
its kinda parallel throttle input into governor and multiwii board, any idea ?

Imen
Posts: 20
Joined: Thu Sep 27, 2012 5:11 pm

Re: Helicopter integration

Post by Imen »

olaf45 wrote:Hi,

I had my first flight this afternoon with FBL head and normal mode , after setting up PID for roll and nick (P=3 /I=0.01/ D=10 ) and smoothing (20,20,4) . For the yaw, I kept my GY401 working ( not everthing at the same time step by step ). There're some little jerks for rapid movement but it's flyable and quite good.
I tried the level mode and it was catastrophic. My helico danced the lambada and it was difficult to avoid the crash . I tried different tunings but it was not better. On my desk ( rotor and blades stopped ) when I move it back and forth, the level correction is good.
What is your feedback about it ?

Thanks


Hi olaf, maybe vibration issue on acc

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

Did you calibrate acc at least once?
Some boards seem to randomly forget calibration data between power cycling. Best do it once after connecting battery.
Also for level you should try lower I value like 0.08 to start with. My level P is around 4 only and my smoothing needs to be 40 40 50 or higher.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

@Imen
You need throttle connected from RX to be able to do some settings and Arm/Disarm the MWii.
The stabilisation works even if its unarmed but Then you can change settings via stick input accidently!
Always ARM before flying!!!!!
But you can connect the governor via Y-cable and bypass MWii direct to the servo.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

@Olaf.

You use gyrosmoothing to reduce noize from vibrations.
Same noize reaches the ACC.
(20,20,4) means avarage on 20 readings on Tilt & Roll.

Look at the IMU complimentary filter tuning in config.h
You can Set the Low Pass Filter factor for ACC
//#define ACC_LPF_FACTOR 100

And Gyro Weight for Gyro/Acc complementary filter
//#define GYR_CMPF_FACTOR 400.0f

There's some info about it in the config file.

Good luck
/Patrik

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

Should we add governor functionality to MWii?
( compared to heading hold this seems to be the easier task towards a modern fbl controller)

olaf45
Posts: 24
Joined: Sun Nov 25, 2012 11:38 am
Location: France

Re: Helicopter integration

Post by olaf45 »

Hi,

I always have jerk problem even with high value in low pass filter ( it's better but a lot of lag ... and unstable ). It seems, the trim ( acctrim ) and (offset ) are not applyed. Is there any tip to verify ? When I put a value offset, nothing happends on the servo . Is it normal ?
How can we read the value saved in eeprom ? Is it possible to add to multiwii_conf?

For the HH , We have to active headfreeze statut !

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

Last in Main loop You can use.

Code: Select all

debug[0]=conf.angleTrim[ROLL];  
debug[1]=conf.angleTrim[NICK];

Then you can see Acc trim in the Gui as debug.

Trim acc with the sticks.
Check values.
If the values is saved in Eeprom it will be the same after a reboot.

olaf45
Posts: 24
Joined: Sun Nov 25, 2012 11:38 am
Location: France

Re: Helicopter integration

Post by olaf45 »

Patrick,

It means, I need to recompile multiwii_conf.ino with this modification ?

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Helicopter integration

Post by PatrikE »

Yepp!...
Insert the code in mainLoop and upload to the Arduino.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

olaf45 wrote:
For the HH , We have to active headfreeze statut !

Sorry. I do not understand what you want to say?

olaf45
Posts: 24
Joined: Sun Nov 25, 2012 11:38 am
Location: France

Helicopter integration

Post by olaf45 »

Hi,

I tryied to said , if I want to have the head lock like my GY401, should I active headfreeze function ( with mag ) or should I have to increase the I of the PID yaw.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Helicopter integration

Post by Hamburger »

MWii does _not_ provide HH like your gy401.
You can try and increase I for yaw, but it is not like HH.
For HH you would lower P and increase I and D. But it will not work well.

Post Reply