MultiWii_dev_20120528

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

MultiWii_dev_20120528

Post by PatrikE »

In MultiWii_dev_20120528
there's some rename PID values.
#define PIDVEL 4
Changed to
#define PIDPOS 4

Resulting in that LCD is broken. :cry:

/PatrikE

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: MultiWii_dev_20120528

Post by nhadrian »

Yes, all variables are renamed, and also, VEL doesn't exists anymore but there are new parameters for the new GPS code.
I had to debug the OLED_LCD part, because LCD.ino is still the older one. So I'm sure none of LCD will work with this code unless code is repaired by yourself......

User avatar
mbrak
Posts: 136
Joined: Sat Dec 03, 2011 8:08 pm
Location: Germany, Lemgo

Re: MultiWii_dev_20120528

Post by mbrak »

hi

new dev wont compile with bmp085 and oled selected.

got some errors from lcd.ino

Code: Select all

LCD:766: error: 'lcd_param_text14' was not declared in this scope
LCD:766: error: 'PIDVEL' was not declared in this scope
LCD:767: error: 'lcd_param_text15' was not declared in this scope
LCD:767: error: 'PIDVEL' was not declared in this scope
LCD:768: error: 'lcd_param_text16' was not declared in this scope
LCD:768: error: 'PIDVEL' was not declared in this scope

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

Re: MultiWii_dev_20120528

Post by Alexinparis »

Hi,

I'm going to fix it today.
PIDVEL will be reintroduced but not in GUI for the moment.
So that the current LCD code will still work.

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: MultiWii_dev_20120528

Post by EOSBandi »

Hi Alex,
this one is missing from the setup()
In Multiwii.ino around line 495 enter this (Its close to the end of setup() )

Code: Select all

  #if defined(I2C_GPS)
   GPS_Enable = 1;
  #endif


WIthout this, i2cgps is not enabled even when defined in config.h

I just flown a couple of packs with 20120528, controls and i2c gps code is working perfectly.

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

Re: MultiWii_dev_20120528

Post by copterrichie »

Kudos!!!

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: MultiWii_dev_20120528

Post by dramida »

This is how dev20120528 works. Complete features video: Gps return-to-Home, GPS Position Hold, Altitude Hold, Magnetic Head Hold.
http://www.youtube.com/watch?v=952DYF3XV8s

sismeiro
Posts: 173
Joined: Tue Feb 21, 2012 12:33 pm

Re: MultiWii_dev_20120528

Post by sismeiro »

dramida wrote:This is how dev20120528 works. Complete features video: Gps return-to-Home, GPS Position Hold, Altitude Hold, Magnetic Head Hold.
http://www.youtube.com/watch?v=952DYF3XV8s

I don't know the other multicopter controllers out there but this seems very good to me, good altitude hold and good GPS positioning hold. I used to do geocaching so I understand well the error that GPS positioning have and how much the distances can vary. Thank you for your video.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: MultiWii_dev_20120528

Post by nhadrian »

Hi,

Another catch from Howard:
in IMU.ino, the magnetic declination is missing.

This part:

Code: Select all

  #if MAG
    // Attitude of the cross product vector GxM
    heading = _atan2( EstG.V.X * EstM.V.Z - EstG.V.Z * EstM.V.X , EstG.V.Z * EstM.V.Y - EstG.V.Y * EstM.V.Z  ) / 10;
  #endif


should be:

Code: Select all

   #if MAG
    // Attitude of the cross product vector GxM
//******************************************EOSBANDI - removed /10 to increase precision of decliniation calc   
    heading = _atan2( EstG.V.X * EstM.V.Z - EstG.V.Z * EstM.V.X , EstG.V.Z * EstM.V.Y - EstG.V.Y * EstM.V.Z  );
//******************************************EOSBANDI 
    //add declination
    //Heading is -180 - 180 had to wrap up accordingly
    heading = heading + (MAG_DECLINIATION * 10);

   heading = heading /10;               // /10 moved here from above
   
    if ( heading > 180)
       heading = heading - 360;
    else if (heading < -180)
       heading = heading + 360;
//***************************************************   
  #endif 


Thanks for catching it!

BR
Adrian

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: MultiWii_dev_20120528

Post by nhadrian »

And another one... :

With this I get false MAG calibration, N and S are ok, but E and W have 5-6 degrees error:

Code: Select all

    #if defined(HMC5883)
      magCal[ROLL]  =  1160.0 / abs(magADC[ROLL]);
      magCal[PITCH] =  1160.0 / abs(magADC[PITCH]);
      magCal[YAW]   =  1080.0 / abs(magADC[YAW]);
    #else


So I had to change to this for proper mag working:
magCal[ROLL] = 1000.0 / abs(magADC[ROLL]);
magCal[PITCH] = 1000.0 / abs(magADC[PITCH]);
magCal[YAW] = 1080.0 / abs(magADC[YAW]);

#else[/code]

I don't know why...

BR
Adrian

Andix
Posts: 1
Joined: Wed May 30, 2012 6:34 pm

Re: MultiWii_dev_20120528

Post by Andix »

Hi

in the GUI
green/red- on/off Button for AUX2 is not activ

and i can't see the Channel bars on the right side ?

andix

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

Re: MultiWii_dev_20120528

Post by Alexinparis »

nhadrian wrote:And another one... :

With this I get false MAG calibration, N and S are ok, but E and W have 5-6 degrees error:

Code: Select all

    #if defined(HMC5883)
      magCal[ROLL]  =  1160.0 / abs(magADC[ROLL]);
      magCal[PITCH] =  1160.0 / abs(magADC[PITCH]);
      magCal[YAW]   =  1080.0 / abs(magADC[YAW]);
    #else


So I had to change to this for proper mag working:
magCal[ROLL] = 1000.0 / abs(magADC[ROLL]);
magCal[PITCH] = 1000.0 / abs(magADC[PITCH]);
magCal[YAW] = 1080.0 / abs(magADC[YAW]);

#else[/code]

I don't know why...

BR
Adrian


Could someone else could reproduce also this problem ?
It was changed thanks to this info:
viewtopic.php?f=8&t=1387&p=10658

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: MultiWii_dev_20120528

Post by nhadrian »

Hi,

after reading the link you posted and followed this method, now it works with 1160/1160/1080 :

- rotate yaw 360 degree (x,y calibration)
- rotate pitch 360 degree (y z calibration)
- point multicopter west
- roll 360 degree (x z calibration)

So, the code is OK, but the method I used till now (rotate the copter around all axes, but in level) may result false calibration, so the methon mentioned above must followed!!!

BR
Adrian

schmuggler
Posts: 5
Joined: Wed Apr 18, 2012 11:50 am

Re: MultiWii_dev_20120528

Post by schmuggler »

Hallo
i tested airplane mode but all servos go crazy .
i have the same setup as in aero heli .
in the gui every think looks fine.
thanks jan

sismeiro
Posts: 173
Joined: Tue Feb 21, 2012 12:33 pm

Re: MultiWii_dev_20120528

Post by sismeiro »

[quote="mbrak"]hi

new dev wont compile with bmp085 and oled selected.

got some errors from lcd.ino

Code: Select all

LCD:766: error: 'lcd_param_text14' was not declared in this scope
LCD:766: error: 'PIDVEL' was not declared in this scope
LCD:767: error: 'lcd_param_text15' was not declared in this scope
LCD:767: error: 'PIDVEL' was not declared in this scope
LCD:768: error: 'lcd_param_text16' was not declared in this scope
LCD:768: error: 'PIDVEL' was not declared in this scope


I just commented the lines where the PIDVEL was used and compiled :

Code: Select all

#if BARO
  &lcd_param_text11, &conf.P8[PIDALT], &__P,
  &lcd_param_text12, &conf.I8[PIDALT], &__I,
  &lcd_param_text13, &conf.D8[PIDALT], &__D,
  //&lcd_param_text14, &conf.P8[PIDVEL], &__P,
  //&lcd_param_text15, &conf.I8[PIDVEL], &__I,
  //&lcd_param_text16, &conf.D8[PIDVEL], &__D,
#endif

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

Re: MultiWii_dev_20120528

Post by Alexinparis »

nhadrian wrote:Hi,

after reading the link you posted and followed this method, now it works with 1160/1160/1080 :

- rotate yaw 360 degree (x,y calibration)
- rotate pitch 360 degree (y z calibration)
- point multicopter west
- roll 360 degree (x z calibration)

So, the code is OK, but the method I used till now (rotate the copter around all axes, but in level) may result false calibration, so the methon mentioned above must followed!!!

BR
Adrian


Just to understand:
Where did you read that the copter must be leveled while rotating the copter around all axes.

so the methon mentioned above must followed!!!

False: there is no need to respect a specific order as long as you cover all directions.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: MultiWii_dev_20120528

Post by nhadrian »

Hi, just to explain a bit. A time ago it was said that copter must turn into any direction. My idea was that in level I turned around yaw, roll, pitch axes while copter pointed to north, then when copter pointed to west. Theoretically I covered all directions. I thought.

But, I forgot to copy a sentence into my previous post:
- point to the north 3d in your zone (for europe point north and down, it is near 45 degree down to earth)

When I turn the copter around all axes in level, there will be some positions which are not covered as when the copter points to north 3D. (yaw axis)

So I would say previously that I got good calibration only when I made the turns while pointing to the real north 3D direction (to north and 45-50 degrees down).

krzysztof21
Posts: 3
Joined: Thu May 31, 2012 7:26 pm

Re: MultiWii_dev_20120528

Post by krzysztof21 »

Hello, Is there a mistake in recognizing WMP + NC. In version 2.0 works fine but there is no choice for WMP + NC.
While defining dev_20120528 added to WMP and NC, and now soft does not correctly detect this configuration.

What a pity :( there is Airplane mode

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

Re: MultiWii_dev_20120528

Post by PatrikE »

In the newest Dev wmp and nb is not default.
They must be defined as any other sensors.

It saves some memory if other sensors is used

krzysztof21
Posts: 3
Joined: Thu May 31, 2012 7:26 pm

Re: MultiWii_dev_20120528

Post by krzysztof21 »

Hi Patrik. I know that you need to define, but after defining WMP + NC can not read data from the sensors properly. Do DEV ran in this configuration? Can you paste the lines to activate the WMP + NC. Maybe it's me behaving badly ;)

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

Re: MultiWii_dev_20120528

Post by copterrichie »

Personally I believe it is time to consider moving to an ATmega1280, ATmega2560 or something more radical like a ST32 processor. The Atmega328 has served this community well and deserve a proper retirement. :)

Scotth72
Posts: 23
Joined: Sat Jan 21, 2012 4:11 am

Re: MultiWii_dev_20120528

Post by Scotth72 »

I don't have access to pin 19 on my Mega, and I would like to use PPM sum. I used to use this code to move the ppm pin to pin 2, but I can't find the pin order in the new code.


changing this:
#define PPM_PIN_INTERRUPT attachInterrupt(4, rxInt, RISING); //PIN 19
#define MOTOR_ORDER 3,5,6,2,7,8 //for a quad+: rear,right,left,front //+ for y6: 7:under right 8:under left

to this:
#define PPM_PIN_INTERRUPT attachInterrupt(0, rxInt, RISING); //PIN 2
#define MOTOR_ORDER 3,5,6,9,7,8 //for a quad+: rear,right,left,front //+ for y6: 7:under right 8:under left

How would I achieve the same result in the new code?
Thanks.

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: MultiWii_dev_20120528

Post by rbirdie001 »

I'm trying to compile MultiWii_dev_20120528 for flying wing stabilization and I want to use "old" Pro Mini 168 board+WMP for that. With attached config it compiles for 168 board without error saying "Binary sketch size: 14252 bytes (of a 14336 byte maximum)" but then doesn't work (servos locked in the endposition and doesn't connect to GUI).
The same set Pro Mini 168 + WMP worked well with 1.9 and the same build works on Pro Mini 328+the same WMP. Is there any explanation?
Additional questions:
-Are servo outputs for flying wing still using A0,A1 pins? Can it be easily remapped to another pins to allow using also gimbal at the same time?
-Is it planned that advanced parameters (like servo centrepoints) currently reachable only by LCD will be soon accessible via GUI?
Thanks!
Roman
Attachments
config.zip
(14.7 KiB) Downloaded 127 times

User avatar
kos
Posts: 286
Joined: Thu Feb 16, 2012 4:51 am
Location: Fr

Re: MultiWii_dev_20120528

Post by kos »


rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: MultiWii_dev_20120528

Post by rbirdie001 »

Pro Mini 168 5V 16MHz. I used exactly the same source and settings, only 168 or 328.
Roman

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

Re: MultiWii_dev_20120528

Post by Hamburger »

rbirdie001 wrote:-Is it planned that advanced parameters (like servo centrepoints) currently reachable only by LCD will be soon accessible via GUI?

confirmative maybe. I will probably do it together with the same task for helicopter - airplane and flying wing will come as a byproduct.

You can use the 'LCD configuration code' without an lcd or a smartphone by compiling it in (best use lcd.textstar) and then use the terminal from within the arduino.ide to connect to your arduino . Simply ignore some control characters.

about 168p - read up on the specs of this mcu what is different from 328p, that may help you identify the root of your problem. Way easier to invest in a 328p arduino, imho.

User avatar
kos
Posts: 286
Joined: Thu Feb 16, 2012 4:51 am
Location: Fr

Re: MultiWii_dev_20120528

Post by kos »

Hamburger wrote:about 168p - read up on the specs of this mcu what is different from 328p, that may help you identify the root of your problem. Way easier to invest in a 328p arduino, imho.


We have to support all different board and mcu .. i do not own any 168p , but i would gladly help if posible :geek:

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: MultiWii_dev_20120528

Post by rbirdie001 »

thanks Hamburger,
from your post I understood that there is some way accessing advanced parameters using smartphone... As I have one (at least one smart :) ) I'll try to read more about it and use it. (Direct link could save me time...Thanks!).
About 168 - I agree with you and it's already a "retired" board, I was just curious what it can be. I believed that when it compiles without error, it must work in the board... O.K. -maybe I'm naive :)
Roman

robjames
Posts: 9
Joined: Thu Dec 22, 2011 8:28 pm

Re: MultiWii_dev_20120528

Post by robjames »

Scotth72 wrote:I don't have access to pin 19 on my Mega, and I would like to use PPM sum. I used to use this code to move the ppm pin to pin 2, but I can't find the pin order in the new code.


changing this:
#define PPM_PIN_INTERRUPT attachInterrupt(4, rxInt, RISING); //PIN 19
#define MOTOR_ORDER 3,5,6,2,7,8 //for a quad+: rear,right,left,front //+ for y6: 7:under right 8:under left

to this:
#define PPM_PIN_INTERRUPT attachInterrupt(0, rxInt, RISING); //PIN 2
#define MOTOR_ORDER 3,5,6,9,7,8 //for a quad+: rear,right,left,front //+ for y6: 7:under right 8:under left

How would I achieve the same result in the new code?
Thanks.



I have a Mega with a 1280 chip . I haven't used PPM on it but my board has PIN 19 taken out to RX1 and
should be quite easy to use. I think it's the same on the 2560 version.

Scotth72
Posts: 23
Joined: Sat Jan 21, 2012 4:11 am

Re: MultiWii_dev_20120528

Post by Scotth72 »

I have the old Flyduino, where pin 19 is out to that tiny jst connector. Makes it useless. I would like to use serial 2 or 3, which do have regular pins.

robjames
Posts: 9
Joined: Thu Dec 22, 2011 8:28 pm

Re: MultiWii_dev_20120528

Post by robjames »

Scotth72 wrote:I have the old Flyduino, where pin 19 is out to that tiny jst connector. Makes it useless. I would like to use serial 2 or 3, which do have regular pins.



You should have said that in the first place. I have the same Flyduino and it's very easy to solder a small wire on the jst connector for your signal and then plug in the power and ground wires on the servo lead to the nearby connector. See photo.
Attachments
Flyduino-PPM.jpg

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

Re: MultiWii_dev_20120528

Post by copterrichie »

Thank you Rob, I have the same board.

Scotth72
Posts: 23
Joined: Sat Jan 21, 2012 4:11 am

Re: MultiWii_dev_20120528

Post by Scotth72 »

I know I could solder a wire to the connector, but I would like to do it in code. The gps has a #define for which serial port, why not for ppm?

robjames
Posts: 9
Joined: Thu Dec 22, 2011 8:28 pm

Re: MultiWii_dev_20120528

Post by robjames »

OK Scott. I don't know much about coding so I can't help you there. I can verify that the wiring does work and is easy to implement so
if you're looking to get it flying , try it. You're welcome Reverend .

Post Reply