PDA

View Full Version : MultiWii software on AQ hardware



itod
01-12-2011, 12:23 PM
Alex announced today:
http://www.rcgroups.com/forums/showpost.php?p=17075234&postcount=6244
that MultiWii software is now working on AeroQuad shield 2.0. You'll have to use totally different Configurator, you can find one with older software version here (http://radio-commande.com/wp-content/uploads/2010/06/MultiWiiV1_5.zip). Since it is specifically written to be run Arduino Pro Mini, it uses Kalman filter, not DCM.

It should work not only on tricopters with Wii sensors, but also with quads with our sensors.

Here is nice video of it flying:


http://vimeo.com/18351861

Honk
01-12-2011, 12:34 PM
MultiWii software is now working on AeroQuad shield 2.0
Oh no... Now there will be a 100% confusion! :P A million combinations now.

As to those flips... Wow! That's in the same league as the laboratory coper with the 100 cameras!

Pollitt
01-12-2011, 12:43 PM
WOW that is some cool flying. Looks like + mode may have an edge on X mode for some of the acro stuff then? Or is it just the pilots ability?

Honk
01-12-2011, 12:48 PM
For the acro, it's been suggested that X mode is actually quicker making flips since you have "twice" the power to complete a flip since it's two against two motors instead of one against one. Don't know if it's true, I have yet to complete a full flip without crashing :)

itod
01-12-2011, 12:53 PM
Or is it just the pilots ability?

Pilot (Warthox) is amazing. One more video of him flying MultiWii, now we all can fly like that :)


http://vimeo.com/17304786

Pollitt
01-12-2011, 01:30 PM
OK..... He's good...... Is it possible for something to be so inspirational and depressing at the same time?

lokling
01-12-2011, 03:08 PM
Stay tuned for some news from me and Honk the next few days - I´m working on a safe way to practice crazy manouvers :-)

piratedninja
01-12-2011, 07:32 PM
I tried out multiwii code last night and must say its very impressive. I accidentally did a few flips right into a metal cage type ceiling and finally broke my first prop on the mini quad.

There are some quirks with the multiwii configurator but nothing major. Just a small bug where sometimes you cant "stop"/disconnect the com port, and if you close the program, it doesn't stop communicating with the com port making you unplug and re-plug in the usb to upload new code to the arduino.
It could also just be my setup, I'm not 100% sure.

But the multiwii software is great and has a ton of potential. Maybe we can borrow a few ideas ideas from that and make AQ even better:)

p0lar
01-12-2011, 08:15 PM
how did you accidentally do some flips? software bug? or you?

piratedninja
01-12-2011, 08:44 PM
I have dual rates setup on my tx and usually have it turned on when i fly but I accidentally flipped the switch turning off dual rates and it amplified my pitch control by 3x while it was all the way forward.

Before I could react and bring the quad down, it had already hit the ceiling.

I guess I need to tape that dual rates switch down :)

p0lar
01-12-2011, 09:24 PM
wow... yeah something :) but other than that it was stable?

itod
01-12-2011, 10:20 PM
Stay tuned for some news from me and Honk the next few days - I´m working on a safe way to practice crazy manouvers :-)

Your in-hardware-loop AeroQuad X-Plane simulator is done? Can't wait!

lokling
01-12-2011, 10:23 PM
Argh, revealed ;-) Its working, need to polish configuration of ports etc, make a build for win32. Hope to have it ready over the weekend.

Honk
01-13-2011, 12:14 AM
But the multiwii software is great and has a ton of potential. Maybe we can borrow a few ideas ideas from that and make AQ even better
Well, actually there are already parts of MultiWii inside the standard AQ code (if it hasn't been removed). Namely the filter specifically made/tuned for the Wii sensors. I forced Mikro to put it in. To use it you'll just have to construct an object called FlightAngle_MultiWii flightAngle; into any possible hardware setup instead of the one present. But as said, it's made for the Wii sensors so it'll probably work best if you use those. What other thing could it possibly be that makes a difference?


Your in-hardware-loop AeroQuad X-Plane simulator is done? Can't wait!
Nono, we've designed a quad safety cage... :)

Mikro
01-13-2011, 08:10 AM
A simulator??? You rock Lokling... looking forward to it.

Just saw the videos... WHHHAAAA??? Ok, that's it, I'm going to try this with the AeroQuad. I'm taking off the safety code to see if I can fly loops that tight! (I love challenges!!!)

I don't remember being forced to put in the MultiWii filter :), but I was curious as to how good it was. Their filter is in FlightAngle.h, but at least my quick try didn't seem much of a significant improvement. It really might just be that I need to tune it right, so if any of you guys have time to try it out, please let us know!

lokling
01-13-2011, 08:21 AM
Just to not have the speculations spin off about the simulator: My work is a plugin in C++ and quad models (Honks contribution) for the X-plane simulator (x-plane.com), which is both cross platform and one of the best in realism. It talks to the aeroquad over serial where it receives back motor and sends sensor values from the sim. Hoping for a weekend initial release :-) Now back to topic.

kinderkram
01-14-2011, 04:50 PM
Just saw the videos... WHHHAAAA??? Ok, that's it, I'm going to try this with the AeroQuad. I'm taking off the safety code to see if I can fly loops that tight! (I love challenges!!!)

That's why I "hired" Markus (warthox) and Norf (Norbert #2) to fly under the Pirates' flag! :cool:

Norf made vimeo pages for the MultiWii (http://vimeo.com/user4628894/videos/sort:date) and ArduPirates (http://vimeo.com/groups/acp) and is also an incredible great pilot:

His Pirate Quad in Acro mode (http://vimeo.com/groups/acp/videos/18495721)
His Pirate Hexa in Stable mode (http://vimeo.com/groups/acp/videos/18330661)

And Markus shows off his MultiRotor Carreer: KK, MultiWii, ArduPirates (http://warthox.bplaced.net/)

pial
03-08-2011, 09:58 PM
I am using the MultiWii v1pre7 firmware on aeroquad hardware with a few modifications to correct the sensor orientation and it works great in stable mode on my mini quad.

RCvertt
03-08-2011, 10:50 PM
I am using the MultiWii v1pre7 firmware on aeroquad hardware with a few modifications to correct the sensor orientation and it works great in stable mode on my mini quad.I completely missed this thread some how. Can you zip it up and post it for us?

In the v2.2 code if we choose (#define AeroQuad_Wii) or (#define AeroQuadMega_Wii) are we flying with MultiWii code or AeroQuad code that that uses just the wii sensors.

itod
03-08-2011, 11:25 PM
I completely missed this thread some how. Can you zip it up and post it for us?

In the v2.2 code if we choose (#define AeroQuad_Wii) or (#define AeroQuadMega_Wii) are we flying with MultiWii code or AeroQuad code that that uses just the wii sensors.

You are flying AeroQuad code if you use 2.2 with Wii defines, not MultiWii. If you want to fly MultiWii, download it from official repository:
http://code.google.com/p/multiwii/source/browse/#svn%2Ftags

pial
03-09-2011, 12:23 AM
Itod is correct, I downloaded it from http://code.google.com/p/multiwii/so...se/#svn%2Ftags and modified the code for sensor orientation and removed parts of the code for the mega board and sensors that I do not use (like wii sensors, BMP085, BMA020 etc.). I am only using ITG3200 and BMA180 sensors. If you are interested in my stripped down code, I can post it, or you can always download it from the official repository and modify it slightly for sensor orientation correction and rc receiver input pins and it will be fully compatible with aeroquad hardware.

Scotth
03-27-2011, 05:00 AM
Could you post this code? I am interested in trying it out. Thanks,
Scott

kevo
03-27-2011, 05:54 AM
Could you post this code? I am interested in trying it out. Thanks,
Scott

Likely it is best you go grabe the code from the repo directly

Configuration of the source is pretty straight forward. Read the comment in the first 100 lines or so , and it will walk you through commenting / uncommenting the required lines. The code uses #defines , so "stripping out" things really has no affect on the resulant .hex .. If its not defined , it is not included in the compiled product.


Project home page is Here (http://www.multiwii.com/)

The official code repo is Here (http://code.google.com/p/multiwii/)

pial
03-27-2011, 01:39 PM
Hi Scotth,
You can grab the code from the link kevo posted. You will need to uncomment the defines to use ITG3200 gyro, BMA180 accel and other sensors (baro/mag) if you have any.
Then update these two code blocks for itg3200 and BMA180 to correct the address and roll/pitch orientation:
ITG3200:

// **************************
// I2C Gyroscope ITG3200
// **************************
// I2C adress: 0xD2 (8bit) 0x69 (7bit) // for sparkfun breakout board default jumper
// I2C adress: 0xD0 (8bit) 0x68 (7bit) // for FreeFlight IMU board default jumper
// principle:
// 1) VIO is connected to VDD
// 2) I2C adress is set to 0x69 (AD0 PIN connected to VDD)
// or 2) I2C adress is set to 0x68 (AD0 PIN connected to GND)
// 3) sample rate = 1000Hz ( 1kHz/(div+1) )
#if defined(ITG3200)
static uint8_t rawADC_ITG3200[6];

void i2c_Gyro_init() {
delay(100);
i2c_rep_start(0XD2+0); // I2C write direction
i2c_write(0x3E); // Power Management register
i2c_write(0x80); // reset device
i2c_write(0x16); // register DLPF_CFG - low pass filter configuration & sample rate
i2c_write(0x1D); // 10Hz Low Pass Filter Bandwidth - Internal Sample Rate 1kHz
i2c_write(0x3E); // Power Management register
i2c_write(0x01); // PLL with X Gyro reference

gyroPresent = 1;
}

void i2c_Gyro_getADC () {
TWBR = ((16000000L / 400000L) - 16) / 2; // change the I2C clock rate to 400kHz
i2c_rep_start(0XD2); // I2C write direction
i2c_write(0X1D); // Start multiple read
i2c_rep_start(0XD2 +1); // I2C read direction => 1
for(uint8_t i = 0; i < 5; i++) {
rawADC_ITG3200[i]=i2c_readAck();}
rawADC_ITG3200[5]= i2c_readNak();

gyroADC[ROLL] = + ( ((rawADC_ITG3200[2]<<8) | rawADC_ITG3200[3])/5/4 );
gyroADC[PITCH] = - ( ((rawADC_ITG3200[0]<<8) | rawADC_ITG3200[1])/5/4 );
gyroADC[YAW] = - ( ((rawADC_ITG3200[4]<<8) | rawADC_ITG3200[5])/5/4 );
}
#endif

BMA180:
void i2c_ACC_getADC () {
TWBR = ((16000000L / 400000L) - 16) / 2; // Optional line. Sensor is good for it in the spec.
i2c_rep_start(0x80); // I2C write direction
i2c_write(0x02); // Start multiple read at reg 0x02 acc_x_lsb
i2c_rep_start(0x80 +1); // I2C read direction => 1
for(uint8_t i = 0; i < 5; i++) {
rawADC_BMA180[i]=i2c_readAck();}
rawADC_BMA180[5]= i2c_readNak();

accADC[ROLL] = - (((rawADC_BMA180[1]<<8) | (rawADC_BMA180[0]))>>2)/10; // opie settings: + ; FFIMU: -
accADC[PITCH] = - (((rawADC_BMA180[3]<<8) | (rawADC_BMA180[2]))>>2)/10;
accADC[YAW] = - (((rawADC_BMA180[5]<<8) | (rawADC_BMA180[4]))>>2)/10;
}

Then build and upload your code. Run the configurator and check if your sensors orientation is correct or not and also if you receiver channels are correctly connected.

Honk
03-27-2011, 03:21 PM
That's certainly another architecture than we use... Lot less built up in levels, but instead code straight from up to down... Disadvantage is when you wanna switch between 2 or 3 complete hardware sets. That's what AQ works with and is gonna get even more combination-friendly, so you can mix whatever sensors you have really easily. But there will always be the sign of the sensor to watch out for.

Scotth
03-27-2011, 04:48 PM
Pial, thanks so much. I just want to see how this software flies, and I am waiting on my multiwii stuff.
Scott

pokem
04-11-2011, 10:14 PM
BTW: if anyone wants I have shield 1.7 sensors on multiwii 1.7preter - flies very well. But no I2C sensors since all analog pins are taken.

Curious if anyone had made 1.7 shield fly properly in AQ 2.3 or 2.4?

schebb
04-22-2011, 02:04 AM
Pial,

Could you please verify. If I download the Multiwii V1_7 code, make the changes you show in post #24, and choose the correct configurations at the top of the file, it will fly an Aeroquad X with mega and 2.0.7 shield. Thanks.

Steve

Scotth
04-22-2011, 02:16 AM
Here is the software that will work on the AQ shield.
http://aeroquad.com/showthread.php?2366-Problems-with-2.4-Mega2560-Wii-Slow-artifical-Horizon&p=25302&viewfull=1#post25302

If you take his changes to the gyro and accel files in his version, and put them in 1_7, it will work fine. The gyro and accel orientation is different between AQ shield and the Multiwii config. John's changes reflect this.

pial
04-22-2011, 07:19 PM
Pial,

Could you please verify. If I download the Multiwii V1_7 code, make the changes you show in post #24, and choose the correct configurations at the top of the file, it will fly an Aeroquad X with mega and 2.0.7 shield. Thanks.

Steve

Schebb, you will also need to switch the pins of Throttle and Roll channels in the code and you should be good to go.

//RX PIN assignment inside the port //for PORTD
#define THROTTLEPIN 4
#define ROLLPIN 2

After uploading the code check your orientation in MultiWii config. If you see the quad is moving in wrong direction, just reverse the sign (if it was -, make it+ and vice versa).

RCvertt
04-23-2011, 05:15 AM
---Opps---

schebb
04-23-2011, 04:08 PM
Well this is quickly becomming far more trouble that it is worth!! :-).

Our 2.4 flies just fine on our Mega with 2.0.7 shield but wanted to try Multiwii for fun? So much for fun. Have a few questions:

Instead of using MultiwiiV1_7, I used file from post #29 from Scotth above which is claimed to be a working file. Seemed straight up enough, made all the correct choices as best I know but after an upload no joy. Green LED near red LED flashes about once per second and Green LED in other corner about twice per second. Found some info that said fast flash means no gyro so enabled I2C pullups in defines and tried again with no luck. Should I2C pullups be enabled?

Cannot get configurator to run, must be an idiot! There are no posts on the Multiwii site about anyone with this problem yet I get error 'cannot find javaw.exe'. When I take a copy of this file from elsewhere on my computer and put it in the same folder as the configurator it runs past this error to the next one 'cannot find jave runtime'. Any assistance from tech savy folks would be appreciated.

Lastly, why would there be a .pde for the configurator, Multiwiiconf1_7.pde in a source folder. The 1_7 configurator I am trying to run came with a download of 1_7 flight software and this .pde file sits in a Source folder with a file called Multiwiiconf1_7.java?

Aeroquad website, instructions, equipment, information, forums, and everything associated with AQ seems much easier than Multiwii, all the people involved do a great job! Thanks.

Steve

pial
04-23-2011, 08:33 PM
You will need to install JRE (java runtime) to get rid of the error messages. It can be downloaded from http://www.oracle.com/technetwork/java/javase/downloads/jre-6u25-download-346243.html
There is a .exe file for the configurator for windows, mac etc. version in it's own folder. You can double click the .exe and run the configurator.
I agree aeroquad is doing a great job documenting the instructions. I prefer MultiWii for the smaller code base (everything fits easily in atmega328) and simpler code and I really like the stability it provides with such smaller code size. Also I can easily modify the code for my own customizations. :)

Scotth
04-24-2011, 05:59 AM
If you are using Windows 7, you will also need service pack 1 to run the MultiWii GUI reliably. I find both AQ and MultiWii to run equally well. Just takes a bit of research.

schebb
04-24-2011, 04:17 PM
Pial and Scotth,

Thank you guys. Reloading Java solved my configurator start problem and after a bit of playing I learned how to use it
Couldn't get 1.7 to run as per Pial's instructions. Must have missed something. Control inputs resulted in correct motor action but if I pitched the craft forward the resulting motor control would try to correct with a roll command. Anyway the file from post #29 worked. I will compare it to the ITG and BMA code and see what part of Pial's changes I missed. By the way.........it flies great on the Aeroquad hardware! Thanks again guys.

Steve

pial
04-24-2011, 05:15 PM
Pial and Scotth,

Thank you guys. Reloading Java solved my configurator start problem and after a bit of playing I learned how to use it
Couldn't get 1.7 to run as per Pial's instructions. Must have missed something. Control inputs resulted in correct motor action but if I pitched the craft forward the resulting motor control would try to correct with a roll command. Anyway the file from post #29 worked. I will compare it to the ITG and BMA code and see what part of Pial's changes I missed. By the way.........it flies great on the Aeroquad hardware! Thanks again guys.

Steve

Steve, it sounds like a radio channel pin configuration issue. Can you confirm your radio stick changes are reflected accordingly in MultiWii configuration GUI?

schebb
04-24-2011, 06:09 PM
Pial,

I can confirm that all controls and reactions to movement are proper in configurator.

Your recommended changes in post above:

ITG3200

gyroADC[ROLL] = + ( ((rawADC_ITG3200[2]<<8) | rawADC_ITG3200[3])/5/4 );
gyroADC[PITCH] = - ( ((rawADC_ITG3200[0]<<8) | rawADC_ITG3200[1])/5/4 );
gyroADC[YAW] = - ( ((rawADC_ITG3200[4]<<8) | rawADC_ITG3200[5])/5/4 );


BMA180:

accADC[ROLL] = - (((rawADC_BMA180[1]<<8) | (rawADC_BMA180[0]))>>2)/10; // opie settings: + ; FFIMU: -
accADC[PITCH] = - (((rawADC_BMA180[3]<<8) | (rawADC_BMA180[2]))>>2)/10;
accADC[YAW] = - (((rawADC_BMA180[5]<<8) | (rawADC_BMA180[4]))>>2)/10;

What worked for me in file downloaded from Scotth's post above:

ITG3200

gyroADC[ROLL] = + ((rawADC_ITG3200[0]<<8) | rawADC_ITG3200[1]); // AeroQuad Orientation
gyroADC[PITCH] = + ((rawADC_ITG3200[2]<<8) | rawADC_ITG3200[3]); // AeroQuad Orientation
gyroADC[YAW] = - ((rawADC_ITG3200[4]<<8) | rawADC_ITG3200[5]);

BMA180

accADC[ROLL] = + (((rawADC_BMA180[3]<<8) | (rawADC_BMA180[2]))>>2)/10; // AeroQuad Orientation
accADC[PITCH] = - (((rawADC_BMA180[1]<<8) | (rawADC_BMA180[0]))>>2)/10; // AeroQuad Orientation
accADC[YAW] = - (((rawADC_BMA180[5]<<8) | (rawADC_BMA180[4]))>>2)/10;

I 'see' the difference but you will 'understand' the difference! Maybe there are some other portions of the code that were changed from 1.7 to make the file I am using, but I went through both in a line by line comparison and I could not find any statements that varied in the numbering of pins, references, devices, inputs, or defines. Don't worry about it Pial. You folks have helped me get our quad flying and it flies great, will post some video later. Much thanks.

Steve

Scotth
04-25-2011, 12:34 AM
Thank John, he wrote the code. The changes are for differences in orientation of the sensors.

schebb
04-25-2011, 04:07 AM
Scotth,

I totally understand that the changes are for different sensor orientation. What I wanted to point out to Pial is that his changes did not match John's changes for the same hardware and John's did work, Pial's did not. The code differences are shown above for interests sake. Flies great, video to come. Thanks.

Steve

pial
04-25-2011, 06:53 AM
Schebb, thanks for pointing that out. I don't have any aeroquad shield and sparkfun sensor break out boards. My sensor board is custom homemade and I use the orientation used in Free IMU. So it is highly likely the orientation could be bit diffrent, which could easily be fixed by switching roll and pitch and the direction by +/-. Good to know your quad is flying well. I know it's a lot of fun. :) Here is very short video of mine hovering indoor:


http://youtu.be/ePjMuS7yNpM

RCvertt
04-25-2011, 04:25 PM
Since AeroQuad is meant to be a test bed for different code bases I recommend that MultiWii become a #define.

Last I heard Alex is keeping the mega part of his code compatible with the AeroQuad shield.

Scotth
04-25-2011, 04:42 PM
MultiWii a define? It's a different code entirely. Just load it and fly on your current hardware.

RCvertt
04-25-2011, 04:54 PM
MultiWii a define? It's a different code entirely. Just load it and fly on your current hardware.

Sorry wasn't clear. I see a lot of MultiPilot and Arducopter code in the AQ code. Would be nice to maybe include some MultiWii motor, receiver, and servo code so we could test with that by choosing a #define.

I wouldn't say it's completely different. It looks a lot more like 1.7.1 than the current code does.

Scotth
04-25-2011, 05:01 PM
Gotcha. I have been doing entire software swaps on my big quad to see/feel the differences. Would be easier with some defines.

schebb
04-26-2011, 01:38 AM
Here is some video of my son flying all Aeroquad hardware (mega, 2.0.7 shield, ITG3200, BMA180, baro and mag) with John's multiwii 1.7 software.

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

Scotth
04-26-2011, 01:56 AM
Very nice flying. I like the piro'ing circles.