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
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.

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

Re: Helicopter integration

Post by PatrikE »

Using MAG should work same as for a TRI.

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

Re: Helicopter integration

Post by Hamburger »

I have given up using MAG because it was only supported for tilt < 25 degrees and produces jump on tail when transitioning that tilt angle. With TRI and even more so with heli I have tilt > 25 degrees very often.

Does it work for you?

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

Re: Helicopter integration

Post by copterrichie »

@Hamburger, Just curious, have you tried the latest modifications made by EOSBandi to the Mag?

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

Re: Helicopter integration

Post by Hamburger »

no. I am still at the revision of my last commit to the repo _and_ my current MWC heli boards do not have a working mag.

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

Re: Helicopter integration

Post by olaf45 »

Hi,

Some feedback of my integration on my HDX450 with a FBL Tarot DFC.
I use an IMU ( GY 85 ) I decided to separate from arduino shield. I put on at the same place of the gyro. It's not the best place for mag because of magnetic interaction with tail servo but it was worst near the controller or brushless motor !

DSCF2119.JPG


DSCF2120.JPG


DSCF2121.JPG


It's flyable , the tuning is still not very fine but in acro mode I don't have any jerk in the three axes. Perhaps too smoothy because not very stable.

I thinks with a little more tuning the result should be as good ( better ) than commercial FBL module.

I have a "rookie" question. How to use a more recent multiwiiconf .I try 2.1 but it doesn't match with this soft ?

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

Re: Helicopter integration

Post by PatrikE »

God to hear That you have hope for the HeliMode..:)

I dont know what version you use.
Every Version have a matched multiwiiconf packed in the Zip/Rar file.
If you load V2.1 in the copter you need to use multiwiiconf v2.1!

/Patrik

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

Re: Helicopter integration

Post by Hamburger »

not the best place for mag because of magnetic interaction with tail servo

do you fly the tail with MAG activated, if so, how does it feel? I found the tail jerking when transitioning the 25 degree limit (mag only getss factored in for tilt < 25 degrees). In the end I have swapped to gyro+acc controllers.

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

Re: Helicopter integration

Post by olaf45 »

Hi,

I have gived up the mag not for tilt reason but because of interaction with tail servo. When I move the tail servo ( not in flight ) the heading change. Nevertheless , according to this article (https://www.loveelectronics.co.uk/Tutor ... o-tutorial) it's possible to have a tilt compensation till 40° (not enough for heli ).

regards

User avatar
AlouetteIII
Posts: 27
Joined: Tue Jan 25, 2011 2:34 pm
Location: AU Australia
Contact:

Re: Helicopter integration

Post by AlouetteIII »

@PatrikE - I want to try a 120° swash helicopter with your code - using only Gyro/Acc on a 328CPU - leaving the tail servo to pass direct to the Quark spartan which does a really great job of HH by itself.

Is there any way to move Pin12 over to D3 or A0? What code lines do I need to change to do this - which ever is the easier.

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

Re: Helicopter integration

Post by PatrikE »

You can copy the data from servo 3 to servo 5 ( D12 to D3 )
Insert servo[5] = servo[3]; last In the mixer code.

Code: Select all

    for(i=3;i<8;i++){
      servo[i]  = constrain( servo[i], servoEndpiont[i][0], servoEndpiont[i][1] );
    }
    servo[5] = servo[3];
  #endif
 
// End of PatrikE Experimentals

It will output same pwm on both outputs.

You can disable pwm on D12 by uncommenting
//#define D12_POWER

Post Reply