MultiWii as CP Helicopter FBL (or just stabilization)?

MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Tue Aug 16, 2011 10:13 am

Hello!
Has anybody try to modify code for TRI copter into 120deg CP helicopter. I believe that in theory we could reuse most of the code but instead of 500Hz PWM for controlling ESCs we need somehow lower (50Hz or up-to 150Hz) for controlling ordinary or digital servos!
Probably we can avoid touching throttle in code or just do pass thru for it (normally TH curve is flat 80, 90 or even 100%).
My programing skills are probably insufficient for the task, but I can be tester for it if somebody stands up to do it! :)

Regards
Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby Hamburger » Tue Aug 16, 2011 9:33 pm

it has been on my mind for some time.
You could look for an older special version 1.2 of MWii that was meant to support CP multicopter, so it was altered to drive servos. Might give you an idea if you are up to it.
From what I heard the big FBL units do some more dynamic stuff to support specific flight situations. We should just try probably. Did you hook up a digital servo and check if it worked? There might be some servos that did. That would be the easiest route! Else I am tied up with other projects around MWii related to flying so I will not activiely persue this matter any time soon.
Hamburger
User avatar
Hamburger
 
Posts: 2557
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Wed Aug 17, 2011 8:31 pm

I know some newer digital servos support refresh rate (PWM) with high rate but I'm not sure if can support 500Hz.
Can you please point me to release with servo support (1.2) I can not find it in main repository.
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby Hamburger » Thu Aug 18, 2011 7:53 am

search for MultiWiiV1_2_CP.zip over at RCG in the MultiWii thread.
User avatar
Hamburger
 
Posts: 2557
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Fri Aug 19, 2011 7:02 pm

Hi Andrej

I now have a Helimode ready to test.
Based on the Aeroplane mode iw'e made previously.
http://www.youtube.com/watch?v=_duj6Xtio5U
It's setup on my Belt CP.
Who's not flyable but the swach works.

Everything looks right But the PID needs tuning

#define HELI_120_CCPM

It's the pins i have on my Jussiboard.
D3 NICK servo
A1 LEFT servo
D6 RIGHT servo
D7 YAW servo

490hz ESC PIN 9
50hz ESC PIN A0


I also made a 90 degree mix.

#define HELI_90_DEG

D3 NICK servo
A1 ROLL servo
D6 COLLECTIVE servo
D7 YAW servo

490hz ESC PIN 9
50hz ESC PIN A0

Haven't made a GUI-modell yet.
TRI-copter is shown in gui .

I'm using AUX2 for CollectivePich With radio in Heli mode.
This makes it possible to adjust thr/pitch curves.

AUX1 is free to use with the gui.


/ Patrik

*EDIT
File moved to
http://www.multiwii.com/forum/viewtopic.php?f=7&t=611&start=10#p3330
Last edited by PatrikE on Sun Aug 21, 2011 8:59 pm, edited 2 times in total.
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Sat Aug 20, 2011 12:33 pm

Hi Patrik
Thank You!
I'll try your code next week (I'm waiting for parts to repair my HK-450).
Some more questions:
-is there special motor arming procedure (on 450 it can be problematic to rapidly start engine with high rpm) :)

Regards
Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Sat Aug 20, 2011 1:09 pm

The Swash-mix and TailServo is controlled by MWii.

Plastic gerar dont like Big revChanges... :oops:
MotorControl and CollectivePich is direct passthru from RX.
It should follow the ThrottleStick.

Program your Curves for thro and pitch in the TX.
When we know everyting works it's possible to let MWii handle that to.
Spoolup, thr-hold, Alt-Hold etc....

First try if it can fly.

/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Sun Aug 21, 2011 9:04 am

Is it possible to map your pins D7 and D6 to one of D13, A0,A1 since I don't have serial sum PPM receiver.
And use schematics as this one http://radio-commande.com/wp-content/up ... 06/tri.jpg ?
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Sun Aug 21, 2011 11:05 am

Problem is you only get 5 channels without PPM.
only AUX is supported at the moment.
But I know Alex have a solution for AUX2 comming up.

The code reqire PPM.
Why not go for an 8 ch PPM encoder?.
http://h9z6z.kmn9z.servertrust.com/product_p/br-ppme.htm
Then you get a lot of free pins..... ;)

But i will look at it.

/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Sun Aug 21, 2011 4:58 pm

On basic TRI we have a lot of free pins but probably by using them you could create configuration not supported by most of shields "out there" . :)
Since I'm soldering my own shields I can physically access any pin and don't need Batt monitor or Li-Po alarm. And since we normally use only 50Hz or 490Hz ESC we can take the other pin for servo.
On the other side I can use Mega (if I really need), but in that case your pin assignments are probably different?!

Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Sun Aug 21, 2011 8:57 pm

Pins is now remapped. :)
using D10 & D11 Instead of D6 & D7.

It's not implemented on the MEGA yet... Only PRO mini :roll:
*************************************************
#define HELI_120_CCPM
D3 NICK servo
A1 LEFT servo
D11 RIGHT servo
D10 YAW servo

D9 490hz ESC
A0 50hz ESC
*************************************************
#define HELI_90_DEG
D3 NICK servo
A1 ROLL servo
D11 COLLECTIVE servo
D10 YAW servo

D9 490hz ESC
A0 50hz ESC
*************************************************
Made a simple Gui-modell for 120 deg.
Showing servoValues.
90 deg shows a TRI.

If throttle is used on D9 it reqire Arming like the multirotors.
To keep rotor from starting when armed.
Set #define MINTHROTTLE 1000 or lower.

Use with care...

/Patrik
Attachments
Heli.rar
New file With different mapping.
(107.27 KiB) Downloaded 235 times
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Thu Aug 25, 2011 10:41 am

Hello!
I'm not in the air yet! :)
Some more questions:
<disregard read EDIT1>- according to GUI pitch and roll responses are messed up in software, when I move pitch I get correct response in input part of GUI but probably wrong in output (left right change instead of front to back), same thing happens with roll (see attached snapshot). </disregard read EDIT1>
Screen Shot 2011-08-25 at 10.20.26.png
(14.12 KiB) Not downloaded yet

<disregard read EDIT0>- since I have no idea what to use AUX1 for and don't have serial sum ppm receiver it would be nice to move pitch from AUX2 to AUX1!</disregard read EDIT0>

- how do I limit cyclic and tail servo throw (in GUI with RC rate all same?!)


Andrej

EDIT0: Changed AUX1 and AUX2 alias in MultiWii.pde, and now I can see proper pitch movement
EDIT1: I understand GUI shows actual servo signal and since servos are inverted it is logical that one goes left and the other right.
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Thu Aug 25, 2011 2:28 pm

Hi Andrej

crashlander wrote:- how do I limit cyclic and tail servo throw (in GUI with RC rate all same?!)


Code: Select all
 servo[0]  = constrain(rcData[AUX2]   - HeliNick, 1020, 2000); 


1020 and 2000 is the maximum endpoints for each servo.
Closer to 1500 gives smaller throw.
For me 1200,1800 is ok on yaw.

If you don´t intend to fly advanced you can use rcData[THROTTLE] to control the collective pich.
Pich follows throttle.
Then you can use AUX1 to swich modes with the gui.(Acro/Sable/Baro/MAG....)

/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Thu Aug 25, 2011 4:04 pm

PatrikE wrote:If you don´t intend to fly advanced you can use rcData[THROTTLE] to control the collective pich.
Pich follows throttle.

My normal throttle curve in normal mode goes 0, 80, 95,95, 100 to get high head speed for stability and good tail authority.
And pitch goes -3, inh., 0 ,inh., +12 so pitch follows throttle is not good.
At this point I will only use original WM+ so there is no need for actual AUX1, that's why I remapped AUX2 into AUX1,
Code: Select all
#define AUX1       5
#define AUX2       4

since on 6 ch RX I'm getting pitch data from AUX1 channel.

Andrej

BTW: I'm still waiting for tail shaft to rebuild my heli. :(
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Thu Aug 25, 2011 5:49 pm

Code: Select all
servo[0]  = constrain(rcData[AUX2]   - HeliNick, 1020, 2000);


You can also change AUX2 to AUX1 in the Mixtable.
But that's a little more work... ;)

I still tink you should get a PPM encoder or RX with PPM. :P


/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Sat Aug 27, 2011 9:07 am

On first "dry run" I have noticed that elevator (I believe you called it Nick) and yaw correction goes in wrong direction. What part of code controls that?

What does 3000 in:
Code: Select all
servo[3]  = constrain(3000-rcData[AUX2] - HeliNick*0.5 + HeliRoll , 1020, 2000);    //   D11  RIGHT  servo

Should that 3000 be changed if I change 1020, 2000 part?

Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Sat Aug 27, 2011 10:15 am

Change
constrain(3000-rcData[AUX2] - HeliNick*0.5 + HeliRoll ,
To
constrain(3000-rcData[AUX2] +HeliNick*0.5 - HeliRoll ,
It Will reverse the servos on nick and tilt..

3000- reverse collectivePich.

/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Sat Aug 27, 2011 2:11 pm

On further testing I noticed there must be a bug that increases cycle time from 3600 unto 7000 when I move cyclic (roll or nick) from any position to maximum (left or right, front or back), at the moment i pass 1900 or 1100 (as seen in GUI), if I limit travel adjust on TX to not pass those values than everything works normal. Also throttle and yaw can get from 1000 to 2000 without that problem.

Also each time Arduino is reset (connecting to GUI) 50Hz throttle goes to half speed for second or two!!! Probably the problem from servo initialization routine (servo centering shouldn't be done for ESC).

Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Sat Aug 27, 2011 6:59 pm

For the init of the servos you can do this change.
for servo[1]
Code: Select all
//In outpt.pde
volatile uint8_t atomicServo[6] = {125,1,125,125,125,125};

Change to 1 Or 255 for endpoints.

I cant reproduce the other problem you discribe.
I can go from 900-2100 on any cannel on my radio.(Hitec OPTIC6 sport)
My cykletime only changes 20-50 no matter what i do.

There can be some overflow somewhere in the project
and should effect other models to.
Test to change to ex. FLYING_WING to se if the behaivior is the same.

You can also test to passthru from RX to se if it's ok then.
Code: Select all
 int HeliRoll=(1500-rcData[ROLL]);
 int HeliNick=(1500-rcData[PITCH]);


/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Sun Aug 28, 2011 9:53 am

Today even I can not reproduce that behavior again! It works from 1000 to 2000 flawlessly!
Maybe it was TX problem because of weak battery!? Spektrum DX7.

Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Sat Sep 03, 2011 1:26 pm

Today I did some hand tests and it seems that some filtering of gyro data is needed. It seems that CP Hely vibrates too much even for original WM+. I had to lower Yaw P to 2 to remove oscillations, but was unable to remove oscillations of cyclic (with blades on servos are jumping around). Also with P of 1.
Unfortunately my head exploded (rotor head) and I'm back to the "drawing board".... :)

Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby dialfonzo » Tue Jan 17, 2012 2:59 am

Anybody ever fly it finaly ??
User avatar
dialfonzo
 
Posts: 62
Joined: Sun Nov 20, 2011 3:18 pm
Location: Quebec, Canada

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Tue Jan 17, 2012 12:44 pm

Hi,
I have stopped my tests because of oscillations on cyclic servos and have not returned to those tests after exploded head on HK-450.
The funny part it is that now you can get true FBL unit that is cheaper than Arduino and WM+
http://www.hobbyking.com/hobbyking/stor ... duct=20996

Regards
Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby dialfonzo » Tue Jan 17, 2012 1:19 pm

crashlander wrote:Hi,
I have stopped my tests because of oscillations on cyclic servos and have not returned to those tests after exploded head on HK-450.
The funny part it is that now you can get true FBL unit that is cheaper than Arduino and WM+
http://www.hobbyking.com/hobbyking/stor ... duct=20996

Regards
Andrej


Yes i know, but i have already "Many" MultiWii flight controller... ;)
Just want the "AutoLevel" feature on my t-rex 500..

Why there was an oscillation on servo ?
User avatar
dialfonzo
 
Posts: 62
Joined: Sun Nov 20, 2011 3:18 pm
Location: Quebec, Canada

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Tue Jan 17, 2012 3:13 pm

A heli has a lot of virations in different frequenses and is hard to isolate.

The code should be safe to test but start with low P values and use the passthru to disable gyro on roll and nick.

The code is based on V1.8 .
/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby dialfonzo » Tue Jan 17, 2012 3:19 pm

Ok
Mine don't have any vibrations, everything is balanced.
A lot less than my MultiCopter.. lol

Have to look and try... ;)
User avatar
dialfonzo
 
Posts: 62
Joined: Sun Nov 20, 2011 3:18 pm
Location: Quebec, Canada

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Tue Jan 17, 2012 3:25 pm

Bee careful... :o
It's to se as untested...
As i know only crachlander has "tested" it. :?

But with a virationfree frame it should work.
What kind of swach do you use?
90 or 120deg.

God luck.
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby dialfonzo » Tue Jan 17, 2012 3:31 pm

120deg CCPM swashplate.
I will test it on ground without motor anyway... ;)

I didn't dig into the code yet.. but is the motor going to MultiWii or not ?
User avatar
dialfonzo
 
Posts: 62
Joined: Sun Nov 20, 2011 3:18 pm
Location: Quebec, Canada

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Tue Jan 17, 2012 3:47 pm

Motor control is optional.
Connect direct to RX or to mwc.
Trottle is passthru in the code.
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Fri Jan 20, 2012 10:30 am

My tests were done on HK-450 with analog servos (analog servos are pain for proven FBL systems since you have to turn gain a.k.a. P all the way down).
So probably you should start with low P (between 0 and 1) on cyclic, lower head speed and maybe wooden blades.

Regards Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby dialfonzo » Fri Jan 20, 2012 12:41 pm

Thanks, but i don't want to use it wit FBL right now.
Just normal flybar to have "AutoLevel" feature.. ;)
User avatar
dialfonzo
 
Posts: 62
Joined: Sun Nov 20, 2011 3:18 pm
Location: Quebec, Canada

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Sun Jan 29, 2012 3:15 pm

The code is now updated to latest version. r486.

More info in the aeroplane thread.
http://www.multiwii.com/forum/viewtopic.php?f=8&t=364&p=8312#p8312

/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby dialfonzo » Sun Jan 29, 2012 3:18 pm

Thanks..!
Need to re-assemble my 500 before trying
User avatar
dialfonzo
 
Posts: 62
Joined: Sun Nov 20, 2011 3:18 pm
Location: Quebec, Canada

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby leadfeather » Wed Feb 15, 2012 11:57 pm

Hi Guys,

I've been working on using the MultiWii code and a Criuss flight control board on a 450 helicopter. I'm using a brushless tail motor on this project. I've got everything working. The only issue I have left is that there is too much vibration from the chopper and the swash servos jitter way too much. I need to smooth the signal from the gyro's and acc's. I think the best way to smooth the signal would be to incorporate a moving average of the signal...that should eliminate the spikes from vibration.

Does anyone have the code writing skills to do this?

Here is the thread on rcgroups for my WiiChopper http://www.rcgroups.com/forums/showthread.php?t=1592666
leadfeather
 
Posts: 7
Joined: Sat Feb 19, 2011 2:42 pm

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby Hamburger » Thu Feb 16, 2012 1:07 am

Which sensor do you use? Some allow explicit filtering internally.
User avatar
Hamburger
 
Posts: 2557
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby leadfeather » Thu Feb 16, 2012 1:11 am

Hamburger wrote:Which sensor do you use? Some allow explicit filtering internally.


Here is the thread for the Crius flight board http://www.rcgroups.com/forums/showthread.php?t=1551599

Here is a list of the on-board guts:

·Dimensions 50 mm X 50 mm
·Standard Mk style mounting holes 45mm X 45mm
·Weigh 13.9g
·SMD component design with atmega328P
·ITG3205 TRIPLE AXIS GYRO
BMA180 ACCELEROMETER
BMP085 BAROMETER
HMC5883L MAGNETOMETER
·Design with servo output for Camera Pitch and Roll
·Separate 3.3v regulated supply for the sensors
·On board logic level converter

Lite Version (Gyro + Acc only)
leadfeather
 
Posts: 7
Joined: Sat Feb 19, 2011 2:42 pm

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby Hamburger » Thu Feb 16, 2012 10:15 am

then you may start using this (from config.h) and check how far it gets you
Code: Select all
/* ITG3200 & ITG3205 Low pass filter setting. In case you cannot eliminate all vibrations to the Gyro, you can try
   to decrease the LPF frequency, only one step per try. As soon as twitching gone, stick with that setting.
   It will not help on feedback wobbles, so change only when copter is randomly twiching and all dampening and
   balancing options ran out. Uncomment only one option!
   IMPORTANT! Change low pass filter setting changes PID behaviour, so retune your PID's after changing LPF.*/
//#define ITG3200_LPF_256HZ     // This is the default setting, no need to uncomment, just for reference
//#define ITG3200_LPF_188HZ
//#define ITG3200_LPF_98HZ
//#define ITG3200_LPF_42HZ
//#define ITG3200_LPF_20HZ
//#define ITG3200_LPF_10HZ      // Use this only in extreme cases, rather change motors and/or props
User avatar
Hamburger
 
Posts: 2557
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby leadfeather » Fri Feb 17, 2012 5:43 am

Thanks!

I was shown a section under the imu tab that smooths the yaw gyro. I mimicked this code for roll and pitch and increased the value of the smoothing constants and this seemed to work pretty good. This video demonstrates the difference with and without signal conditioning.

http://www.youtube.com/watch?v=MAQVesubv-Y
leadfeather
 
Posts: 7
Joined: Sat Feb 19, 2011 2:42 pm

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby Reflex » Fri Feb 17, 2012 2:30 pm

Sub'd
watching with interest
Reflex
 
Posts: 12
Joined: Sat Sep 10, 2011 3:54 pm

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Fri Feb 17, 2012 3:17 pm

leadfeather wrote: I was shown a section under the imu tab that smooths the yaw gyro. I mimicked this code for roll and pitch and increased the value of the smoothing constants and this seemed to work pretty good.


Is it this part?
Code: Select all
  #if defined(TRI)
    gyroData[YAW] = (gyroYawSmooth*2+gyroData[YAW]+1)/3;
    gyroYawSmooth = gyroData[YAW];
  #endif

In that case it could look like this for three axis.
Code: Select all
   #if defined(HELICOPTER)   
static uint8_t Smoothing[3]  = {3,3,2}; // How much to smoothen with per axis
static int16_t gyroSmooth[3] = {0,0,0};
   
for (axis = 0; axis < 3; axis++) {
    gyroData[axis] = (gyroSmooth[axis]*(Smoothing[axis]-1)+gyroData[axis]+1)/Smoothing[axis];
    gyroSmooth[axis] = gyroData[axis];
   }
  #endif


Can you verify that i can include it in the code?

/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Fri Feb 17, 2012 7:30 pm

Idid some tests on my crappy Belt CP.
It seems to work god.
I updated the branch with this mod.
http://code.google.com/p/multiwii/source/browse/#svn%2Fbranches%2FPatrikE

The Smoothing settings is placed in MultiWii. tab

/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby Hamburger » Tue Feb 21, 2012 10:21 pm

I did add Gyro Smoothing for my FlyingWing (wmp+bma020) with [10, 10, 3] and it seems to really help.
The Wing is smallish 50cm wingspan foamie pusher, so sensors see a lot of noise.
User avatar
Hamburger
 
Posts: 2557
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Tue Feb 21, 2012 10:40 pm

I tested it on a airplane.
On a foamie it removed massive jitter on the servos.. 8-)

/Patrik
Last edited by PatrikE on Tue Mar 06, 2012 10:17 pm, edited 1 time in total.
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby babak_ea » Sat Feb 25, 2012 10:05 am

PatrikE wrote:Idid some tests on my crappy Belt CP.
It seems to work god.
I updated the branch with this mod.
http://code.google.com/p/multiwii/source/browse/#svn%2Fbranches%2FPatrikE

The Smoothing settings is placed in MultiWii. tab

/Patrik


Hi
Thanks Patrik.
I Modify Gyro Mix On your Code For SJM Helicopter( 2 Servo front and 1 servo rear)
I Tested It On SJM Helicopter, That Install On 3 DOF (Pitch ,Roll,Yaw) bench. There are two Problems:

1- when start Rotation and increase Throttle, in Special position the Helicopter Has Vibration That It Feedback To Gyro and Increase Vibration. So, the P factor should Be Very low ( 1 or 2).

But in Multirotor The Vibration Was Very low. It didn't Have important Effect On Gyro.

2- Helicopter with flybar paddle Has weak Factor For Stabilizer System And Can Not Provide Strongly Force As Multirotor.

So According 1 & 2 The Stabilizer System on Helicopter with flybar Can Not effect Very Well, Do Correct This result?
Do Any one Test It With flybarless Heli?
Sorry For My Bad English
Babak.
babak_ea
 
Posts: 1
Joined: Mon Feb 20, 2012 10:26 pm

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby leadfeather » Mon Mar 05, 2012 2:50 pm

Patrik,

The way you have written the smoothing mod is neater than my code...I'm not a programmer.

Here is a video showing the difference in servo jitter with and without smoothing.

http://www.youtube.com/watch?v=MAQVesubv-Y

Here is the first real test flight with the MultiWii, Flybarless 450 conversion.

http://www.youtube.com/watch?v=qfaKYuFnwLY

.
leadfeather
 
Posts: 7
Joined: Sat Feb 19, 2011 2:42 pm

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Mon Mar 05, 2012 6:57 pm

Hi leadfeather,

Nice to see..
Was this tests made with the code from my branch?

/Patrik
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby leadfeather » Tue Mar 06, 2012 5:12 am

I used the code I had written, I had some help with the syntax.

For the helicopter swash servos I had to use a lot of smoothing... a factor of 60 to get it working well. Because of the large numbers involved, it was recommended that some code was added to avoid numeric overflow. If you like, I can post the smoothing code I used in a couple of day after I get home.
leadfeather
 
Posts: 7
Joined: Sat Feb 19, 2011 2:42 pm

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby crashlander » Tue Mar 06, 2012 9:29 pm

leadfeather wrote:I used the code I had written, I had some help with the syntax.

For the helicopter swash servos I had to use a lot of smoothing... a factor of 60 to get it working well. Because of the large numbers involved, it was recommended that some code was added to avoid numeric overflow. If you like, I can post the smoothing code I used in a couple of day after I get home.


Please submit the smoothing code!
I still have not painted the wall hit by the rotor blade from my first Multiwii to HK450 flybareless test. :D

Regards
Andrej
crashlander
 
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby PatrikE » Tue Mar 06, 2012 10:35 pm

The code in the branch contains the smoothing.
And can be configured in the ConfigTab.
http://code.google.com/p/multiwii/source/browse/#svn%2Fbranches%2FPatrikE

Leadfeathers smoothing can be found here.
http://www.rcgroups.com/forums/showpost.php?p=20769728&postcount=35
PatrikE
 
Posts: 1931
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: MultiWii as CP Helicopter FBL (or just stabilization)?

Postby leadfeather » Wed Mar 07, 2012 4:39 am

Patrick,

That code of mine that you've linked isn't up to date with the changes to avoid numeric overflow. I'll be home on Thursday and I can get to the computer that has my code. I'll post then.
leadfeather
 
Posts: 7
Joined: Sat Feb 19, 2011 2:42 pm

Next

Return to Ideas

Who is online

Users browsing this forum: No registered users and 2 guests