Page 2 of 7

Re: Helicopter integration

Posted: Mon Jun 25, 2012 9:13 pm
by Hamburger
palton wrote:As I have understood that EXT_MOTOR_RANGE extends the pwm range to increase from 125 steps resolution to 250 steps resolution, for higher resolution with ESC flashed with wii-esc software with 250 steps resolution.

correct.

Re: Helicopter integration

Posted: Mon Jun 25, 2012 9:15 pm
by Hamburger
PatrikE wrote:Single/Duocopter uses motor[] same way as multis.. so no probs there.

Heli 120/90 and airplane use servo[7] To eleminate the need of expensive digial servos for IC motors.

ok, now I get it. Since I only use electric motors I never thought of gas engines requiring a servo for throttle control.
[quote]
I will have a look how to resolve this.

Re: Helicopter integration

Posted: Tue Jun 26, 2012 6:39 pm
by Hamburger
Hi Patrik ,
(anyone else here using the helicopter code besides us?)

I found an easy way to implement both variants. servo[7] uses pin9, and motor[0] uses pin9 as well! So it is pin compatible.
Here is how I did it:
duplicate throttle value from servo[7] to motor[0].
In config.h define HELI_USE_SERVO_FOR_THROTTLE, if throttle output must drive analog servo for IC engine. It will set NUMBER_MOTOR and PRI_SERVO_TO accordingly.

Nice effect: this fixes broken powermeter and wii-esc support for helicopter with electric motor via pwm ESC.

Works for me, maybe you can test it too?

Re: Helicopter integration

Posted: Tue Jun 26, 2012 6:48 pm
by copterrichie
howardhb wrote:
Sequential%20PPM%20connection%20diagram.jpg

Orange rx can' give ppm sum, but with simple inexpensive converter.

Video your results please!



Question please, can any NPN transistor be used or does it have to be the one specified on the drawing?

Re: Helicopter integration

Posted: Tue Jun 26, 2012 10:19 pm
by PatrikE
At the beginning i had a option to select motor or servo.
Thats why it's pin compatible.

It was removed when it was moved to official to simplify a little.
But it's easy to reimplemate as you discovered. ;)

Re: Helicopter integration

Posted: Wed Jun 27, 2012 8:21 am
by crashlander
copterrichie wrote:
howardhb wrote:
Sequential%20PPM%20connection%20diagram.jpg

Orange rx can' give ppm sum, but with simple inexpensive converter.

Video your results please!



Question please, can any NPN transistor be used or does it have to be the one specified on the drawing?


In my case it works without transistor and with 6.7kOhm pull-down.

Re: Helicopter integration

Posted: Wed Jun 27, 2012 8:41 am
by polo_fly2
hello,
Jsust a question about gyro-smoothing. Yesterday I played a little with my setup for a Tri and found that gyro smoothing affects
the behavior of my yaw servo in a very positive way. It reduces the small nervous over corrections on the yaw servo nearly to zero .
I think the Tri -yaw correction does not need to be so superfast. Till now I am using very sleepy and big servo (Hitec HS-325HB).
This one worked best for me.

Now I found the gyro-smoothing can make also smaller servos usable too, and its very comfortable to adjust.

Because this is heli-related thread ( I could not find a better one :-)) my side -question:

IS it possible to use the gyro_smoothing with parameter (0,0,30) without affecting the normal calculation of pitch and roll

of a tricopter ?

maybe somebody knows ?
thank you
Georg

Re: Helicopter integration

Posted: Wed Jun 27, 2012 9:19 am
by Hamburger
Georg,
I think you must never use a value of 0 for gyro.smoothing. So it would have to be (1,1,30).
BUT
you should check for vibrations first. Do it twice. Only then check if for your sensor a special in-sensor_Hz_filter is available. Only then you might try gyro.smoothing.

Please be aware that you are on your own with gyro.smoothing for a multi copter. It is kinda official politics this is not good practice and is not supported. Also, there is a second implementation of gyro filter available. Check the config.h for it.

As always, if it works for you, fine :)

Re: Helicopter integration

Posted: Wed Jun 27, 2012 9:23 am
by PatrikE
Tri already uses 3 as default.
It should be ok to increase the smoothing.
But use 1,1,3 or more.
0.0.3 can crash your machine.

Re: Helicopter integration

Posted: Wed Jun 27, 2012 9:59 am
by polo_fly2
Hello Hamburger, hello Patrik,

Thank you for the warnings and tips with the zero and 1 . I have one original wmp an one MPU6050 for trying, I´ll be carefull with testing.
I´ll report how it works, maybe next week or so.

Georg

Re: Helicopter integration

Posted: Wed Jun 27, 2012 2:00 pm
by copterrichie
crashlander wrote:In my case it works without transistor and with 6.7kOhm pull-down.


Thank you, I kinda figured the transistor was used for as an isolating buffer.

Re: Helicopter integration

Posted: Thu Jun 28, 2012 5:46 am
by little nellie
Hi, I see the code is base on either 90 or 120 swash CCPM. How hard it is to convert to non CCPM system?

Thanks for your time.

Re: Helicopter integration

Posted: Thu Jun 28, 2012 10:24 am
by PatrikE
90 degree is the conventional mix with a Roll + Nick servo.
And a separate Collective servo.

Re: Helicopter integration

Posted: Fri Jun 29, 2012 4:18 am
by little nellie
Hello Patrik, thanks.. I found the diagram from your website of the 90 degree. I have a Crius SE board, reading the Arduino code in config, is that all I need to do is #define crius_se?

Thanks for your time.

Re: Helicopter integration

Posted: Fri Jun 29, 2012 4:22 am
by PatrikE
It will work fine with a Cirus MutliWii.
Or any other MWii card.
Just check that all servpins is pinned out.
It's easier to not have to remap the outputMix.

/Patrik

Re: Helicopter integration

Posted: Fri Jun 29, 2012 4:30 am
by little nellie
OK, thanks..

/Silas

Re: Helicopter integration

Posted: Fri Jun 29, 2012 4:53 am
by little nellie
Hello Patrik,

Do I use the MultiWiiConf_dev_20120504.. or the standard version to config the MultiWii?
The helicopter I will be installing this in has a nitro engine, there is no ESC, is this a concern? Does the MultiWii care?
Is the reason why Throttle and collective is process thru the MultiWii for auto levelling?

Thanks

/Silas

Re: Helicopter integration

Posted: Fri Jun 29, 2012 6:08 am
by PatrikE
The serial comunication differs between the dev versions.
Use the MultiWiiConf_ thet comes with the MWii version you use.
They are matched to each other.

You don't need to run throttle and collective thru Mwii to fly.
But you must have throttle connected to be able to do AccTrim and other stick config...(Y-cable?)

The 120 heli was made first and 90 heli is just a remix.
Thats why all cahnnels is mixed in 90 to.

There is support for servo in throttlecannel and you can pass it thru the Mwii.
It's a kill switch programmed in the code so the card must be armed before throtleservo moves.

Re: Helicopter integration

Posted: Fri Jun 29, 2012 2:47 pm
by justk1w1
Hi All,

Just looking at setting up a both a heli and a quad using the Mwii code. Excuse the newbie questions, but for the heli what mode do you set the transmitter up in (acro, Heli 120) - I have a flymentor attached to a second heli in which I had to configure the transmitter in heli mode , but 90 degree with no mixing - means there is no passthrough mode to take manual control if required.

Many Thanks

Re: Helicopter integration

Posted: Fri Jun 29, 2012 3:07 pm
by PatrikE
Hi and welcome to the MWii world...

Mwii code will do all the mixing or the swash for you.
Passthrough mode will only disable gyro/acc.

You can use Acro(Airplane) with collective same as throttle channel.
Or
Heli(90) if you want to be able to program thro/Pitch curves in the TX

Re: Helicopter integration

Posted: Fri Jun 29, 2012 4:52 pm
by little nellie
PatrikE wrote:It's a kill switch programmed in the code so the card must be armed before throtleservo moves.


Hello Patrik,

I try to arm the card by (mode 2) YAW to right, hold for a few sec and the throttle servo will not respond. I use MultiWiiconf to monitor the movement and the board is receiving 2000. Any idea how to correct?

Or is there a way to reprogram the code to bypass the arming requirement?

thanks

/Silas

Re: Helicopter integration

Posted: Fri Jun 29, 2012 5:57 pm
by PatrikE
Throttle must be on Low for arm to work.

I use ARM via AUX channel, Select in gui what AUX to use.


You can remove it in Output file. (DEV 0622)

Code: Select all

  /* Throttle & YAW
  ********************
  Handeled in common functions for Heli */
    if (!f.ARMED){
      //servo[7] = 900; // Kill throttle when disarmed
      servo[7]  = rcData[THROTTLE]; // Disables ARM function
      if (YAWMOTOR){servo[5] =  MINCOMMAND;} else {servo[5] =  yawControll; } // Kill YAWMOTOR when disarmed
    }else {   
      servo[7]  = rcData[THROTTLE]; //   50hz ESC or servo
      if (YAWMOTOR && rcData[THROTTLE] < MINTHROTTLE){servo[5] =  MINCOMMAND;}
      else{ servo[5] =  yawControll; }     // YawSero   
    }


If you replace this part you can select Arm function or not..

Re: Helicopter integration

Posted: Sat Jun 30, 2012 2:30 am
by little nellie
Hello Patrik,

I got the arm function to work.. Turns out the throttle channel need to be reverse and I also use the sub trim to set Nick and Roll and Yaw to 1500 center since Futaba is 1530 center.

I commented out
//servo[7] = 900; // Kill throttle when disarmed
and added the disable ARM code
servo[7] = rcData[THROTTLE]; // Disables ARM function

and it works also.

thanks again for your help

/Silas

Re: Helicopter integration

Posted: Sat Jun 30, 2012 3:40 am
by little nellie
Hello Patrik,

in your earlier post, you mention that MultiWii is for FBL only. If I have a flybar helicopter, if I change the PID value to 0,0,0 for Nick and Roll... that should stop the gyro and acc from providing correction and let the flybar provide stablization. Than only correction is left is the YAW gyro and acc... The MultiWii board now becomes a heading hold gyro kind of as in a Futaba GY401?? Does this sound right to you?

thanks

/Silas

Re: Helicopter integration

Posted: Sat Jun 30, 2012 9:21 am
by PatrikE
HI Silas.

It's not for FBL Only.
It just do the same work as the FB.
You can set GyroP very low and increase after some flying and feal how the response is.
The Acc can still be used for levelmode if GyroPIDs is set low.

To use as a CPPM mixer only.
Just use Passthru...
Passthru only effect Pitch & Roll.
Yaw will always be Gyrocompensated.

On a FBL system i don't think it's wise to use Passthru.. :twisted:

Other testers say the Yaw Gyro dont feel as crisp as a real gyro.(gy401)
It may need some Pid tuning to feel beter.
But if you use MAG it should do HH for you.

Good luck.. 8-)

Re: Helicopter integration

Posted: Sat Jun 30, 2012 9:25 am
by Hamburger
Silas,
that is right. But you may find that MWii is not the best HH gyro one could want to have. For the time being, I have fallen back on flying in rate mode with MWii. If you succeed in tuning the PIDs to behave satisfactorly in HH, then please post your yaw PIDs here please.
in general:
rate mode: PD with I=0
HH mode: PID with lower P than with rate mode
good luck

Re: Helicopter integration

Posted: Sat Jun 30, 2012 11:05 am
by justk1w1
PatrikE,

Thanks for the quick reply on that - Couple more quick questions -
1.when are you looking at upgrading to the next release of MWii (new serial comms). I've tried to implement the I2c GPS, however the code I got for this is alined with the latest dev release and now that I am getting a lot of I2c errors I am assuming that there might be a bit of incompatibility going on.
2. I have the choice between a standard UNO or a leo stick, of which I would like to use the Leo (due to size), but the I2C bus is on D2 and D3 which I assume is going to conflict with the tail and engine pin configs. Where and how would be the best place to reconfig these.

Thanks

Re: Helicopter integration

Posted: Sat Jun 30, 2012 1:27 pm
by PatrikE
Heli is fully integrated in latest dev.
The servo settings have been added to Lcd config.
You can still change in the config file but you must press the reset button in the gui before it take effect.

Re: Helicopter integration

Posted: Sat Jun 30, 2012 1:40 pm
by PatrikE
A0 - A2 is availble for servos.
They must be activated in def. Servo from....
And is servo[0] to servo[2].

Re: Helicopter integration

Posted: Sat Jun 30, 2012 4:19 pm
by little nellie
Hello Patrik and Hamburger,

Thanks for the insights.. I am new to MultiWii and still learning on what all the control/config does. Is the PID adjustment is gyro only? Where is the acc comes in? I been surfing on how to set PID does on the web and still doesn't have a good feel at it. Are there seperate setting for the gyro and acc or the PID setting affect both sensors?


@Hamburger, is the YAW of MWii in non level mode acts more like a rate gyro? Your comments of rate mode PD with I=0.. so an example would be P=8, I=0, D=10?? how about rate setting? Can you share with me your PID and rate setting?

Since most of my helicopters YAW is set to rate mode using GY611s, this is just fine for me. :-o)

/Silas

Re: Helicopter integration

Posted: Sat Jun 30, 2012 7:15 pm
by little nellie
Hello Patrik,

I read your early post with Hamburger about collective pitch but unable to follow the result. The 90 degree heli drawing does not show any Collective pitch input to the MultiWii nor does it shows any output from the MultiWii. If the data is not process with the FC, how is level mode hold altitude? with just Throttle command?

thanks

/Silas

Re: Helicopter integration

Posted: Sat Jun 30, 2012 7:48 pm
by PatrikE
There's no dedicated input for Collective.
You select in config what channel to controll it with.

Code: Select all

#define COLLECTIVE_PITCH      THROTTLE
Selectable channels:= ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4

Collective output is on servo[6] Pin10 on promini.
fotoflygarn.blogspot.se/2012/04/multiwii-helicopter.html

By default throttle is used for altitude controll with Baro.
I will make a change in _shared and fix it to coolective for the helis.

Btw.
Baro can be disturbed by the huge airflow from the rotor on Heli.

Re: Helicopter integration

Posted: Sat Jun 30, 2012 8:08 pm
by little nellie
If there is no collective input from the Tx and since throttle is used for alt control, I don't think there is much use to have the collective servo route thru the multiwii. I guess the Tx can manage the collective pitch curve. Will need to make sure level mode is switched off during take off and landing.

I plan on housing the MultiWii board inside a container to help the rotor blast issue. I read somewhere that placing a breathable fiber over the baro sensor also helps. I figure if I house the board inside an enclosure, I can also have foam rubber to absorb vibration etc. Do you see an problems this may cause?

thanks

/Silas

Re: Helicopter integration

Posted: Sat Jun 30, 2012 8:26 pm
by little nellie
Hello Patrik,

I gave it more thoughts about collective pitch.. how about for 90 degree heli with nitro motor, use the input channel for collective instead of throttle. Let the MultiWii process and contol collective for level flight alt hold instead of throttle. Use a engine govenor to deal with engine RPM.

/Silas

Re: Helicopter integration

Posted: Sat Jun 30, 2012 8:42 pm
by PatrikE
VIbrations is a real enemy for the sensors.
But there's a real balance act to not isolate to much.
A sensor board who's to soft mounted will cause same problems as if it's to firmly mounted.

I looked at the code and i dont think the collective is active in althold at all now!..
But if you make a change in Outputfile.

Code: Select all

 // Limit Collective range up/down    
    int16_t collect = rcData[COLLECTIVE_PITCH]-collRange[1];
    if   (collect>0) {
      collective = collect * (collRange[2]*0.01);
    } else{
      collective = collect * (collRange[0]*0.01);
    }

Change rcData[COLLECTIVE_PITCH] to rcCommand[THROTTLE]
Then your Nitro Idé can work.

I have to admit I did never think of baroAlt for heli... :?

Re: Helicopter integration

Posted: Mon Jul 02, 2012 2:28 am
by justk1w1
PatrikE wrote:A0 - A2 is availble for servos.
They must be activated in def. Servo from....
And is servo[0] to servo[2].


PatrikE,

Lost me on this one sorry - The conflict with the Leo is for pins D2 and D3, which are now the I2C bus connection. ( derived from your Blog Diagram) D2 is the RX Throttle and D3 is the Yaw Servo . Little bit confused here though as the def.h for atmega32u4 (Promicro) defines the D3 as the RX THROTTLEPIN and D2 as the RX YAWPIN.

Any chances you can advise me on what changes I need to make.

Thanks

Re: Helicopter integration

Posted: Mon Jul 02, 2012 4:27 am
by PatrikE
Found this in def.h
// Servos on atmega32u4 (Promicro)
#define SERVO_1_PINMODE DDRF |= (1<<7); // A0 = servo[0]
#define SERVO_2_PINMODE DDRF |= (1<<6); // A1 = servo[1]
#define SERVO_3_PINMODE DDRF |= (1<<5); // A2 = servo[2]
#if !defined(A32U4ALLPINS)
#define SERVO_4_PINMODE DDRD |= (1<<4); // 4 = servo[3]
#else
#define SERVO_4_PINMODE DDRF |= (1<<4); // A3 = servo[3]
#endif
#define SERVO_5_PINMODE DDRD |= (1<<7); // 6 = servo[4]
#define SERVO_6_PINMODE DDRC |= (1<<6); // 5 = servo[5]
#define SERVO_7_PINMODE DDRB |= (1<<6); // 10 = servo[6]
#define SERVO_8_PINMODE DDRB |= (1<<5); // 9 = servo[7]

/Patrik

Re: Helicopter integration

Posted: Mon Jul 02, 2012 6:09 am
by justk1w1
PatrikE,

Thanks - Just to add a little bit more to the above - I've been going through and reviewing the code and notice that the current release has a different pin config for the RX than what you have specified in your diagram.
Latest Your R_23
Throttle 3 3
Roll 4 7
Pitch 5 4
Yaw 2 6
Aux1 6 5

By changing
#elif defined(HELICOPTER)
#define NUMBER_MOTOR 0
#define PRI_SERVO_FROM 4 // use servo from 4 to 8
#define PRI_SERVO_TO 8
#endif
to be:
#elif defined(HELICOPTER)
#define NUMBER_MOTOR 0
#define PRI_SERVO_FROM 1 // use servo from 1 to 5
#define PRI_SERVO_TO 5

would change the following:

From To

Throttle A3 A0
Roll D6 A1
Pitch D5 A2
Yaw D10 A3
Mode D9 D6

However I have also noticed that there is an error in the definition of the V_BATPIN for non defined A32U4ALLPIN in that it DEFINES A2 instead of A3. I assume that these can then be moved to A4 and A5 respectively as even with the above change they would be in conflict if enabled.

In making these changes this now free's up D5 D9 and D10, which I assume I can then move the RX Yaw and Throttle to - so the final outcome would be:
Latest
Throttle 9
Roll 4
Pitch 5
Yaw 10
Aux1 6

I' hoping to go through the RX section soon, however if you can advise me off the top of your head if I have to make any changes in the RX section to enable D9 and D10 as RX input??

Regards and Thanks

Re: Helicopter integration

Posted: Thu Jul 05, 2012 5:04 am
by little nellie
Hello Patrik,

Is there a way to remotely change the rate if the FC? I see some of the commerical 3 axis gyro can change different rate for different flight condition. Would be great if somehow that can be done with the MultiWii..

/Silas

Re: Helicopter integration

Posted: Thu Jul 05, 2012 12:48 pm
by justk1w1
Managed to get the Heli config sorted out for the LeoStick

Servo's are on:
D4 Nick
D5 Yaw
D6 Roll (front Right)
D10 Roll (front Left)
D9 Throttle

RX Channels
Channel 1 MOSI
Channel 2 MISO
Channel 3 D7
Channel 4 SCK
Channel 5 (Aux 1) D8
Channel 6 (Aux 2) D11 ( had to cut the track to the buzzer )

Which leaves basically A0-A5 free to add the Power/Battery pins etc.

Re: Helicopter integration

Posted: Thu Jul 05, 2012 3:12 pm
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.

Re: Helicopter integration

Posted: Fri Jul 06, 2012 3:30 am
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

Re: Helicopter integration

Posted: Fri Jul 06, 2012 2:20 pm
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.

Re: Helicopter integration

Posted: Sat Jul 07, 2012 4:14 am
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

Re: Helicopter integration

Posted: Thu Jul 12, 2012 11:20 am
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.

Re: Helicopter integration

Posted: Thu Jul 12, 2012 3:21 pm
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

Re: Helicopter integration

Posted: Thu Jul 12, 2012 6:57 pm
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?

Re: Helicopter integration

Posted: Sat Jul 14, 2012 10:20 am
by Hamburger
Works as described here. Second helicopter in the works with 4 bladed head.

Re: Helicopter integration

Posted: Wed Aug 01, 2012 5:53 pm
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.

Re: Helicopter integration

Posted: Wed Aug 01, 2012 6:44 pm
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 :=)