MultiWii 1.9

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

I have Pull-ups For WMP enabled, for ITG disabled.

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: MultiWii 1.9

Post by UndCon »

I did my 1st flight with 1.9 today. I have not used the Quad since my drift issues several weeks ago...

I took of in acro mode and hit level and flew for ~5 minutes - perfect performance I would say!

A bit drift but not surprising as there was a breeze so I did not bother calibrating level mode.

When I get home and review the recordings I see I have Jello effects, rolling shutter motions all over the picture - 1st time I have this with my GoPro and Quad...
A bit later on I discovered that I recorded in r5 mode - I usually record in r3 so the rolling shutter effect might be related to recording mode.

Overall great performance.

//UndCon

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

I found that when commenting BMA020, WMP will work and i2c_errors_count = 0
When he Uncomment i2c_errors_count WMP does not work and continuously increasing.
Apparently there is a collision WMP and BMA020 on the bus. What to do?

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

Apparently there is a collision WMP and BMA020 on the bus. What to do?

Is it a DiY custom BMA020 board, the BOB BMA020 board from ELV, or something else? Please post a link to the supplier's catalog page or post the schematic to it.

I have Pull-ups For WMP enabled ...

As a test, edit the sketch and disable the BMA020 and the internal pullups. Does the WMP still work (with 0 errors) after you do this?

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

BMA020 is from ELV.
recapitulation:

Code: Select all

WMP     BMA020    Pull-ups(internal)         version     working
enable  disable     disable                    1.9         yes
enable  disable     enable                     1.9         yes
enable  enable      enable                     1.9         no
enable  enable      disable                    1.9         no
enable  enable      enable                     dev201129   yes
enable  enable      enable                     1.8p2       yes
ITG3205 enable      disable                    all         yes

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

Re: MultiWii 1.9

Post by Alexinparis »

Stalk wrote:BMA020 is from ELV.
recapitulation:

Code: Select all

WMP     BMA020    Pull-ups(internal)         version     working
enable  disable     disable                    1.9         yes
enable  disable     enable                     1.9         yes
enable  enable      enable                     1.9         no
enable  enable      disable                    1.9         no
enable  enable      enable                     dev201129   yes
enable  enable      enable                     1.8p2       yes
ITG3205 enable      disable                    all         yes


Hi, interesting,
could you try with this line uncommented (in Sensors.pde)

Code: Select all

  //  while(TWCR & (1<<TWSTO));                // <- can produce a blocking state with some WMP clones

->

Code: Select all

    while(TWCR & (1<<TWSTO));                // <- can produce a blocking state with some WMP clones

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

When I this uncommented, does not work.

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

Re: MultiWii 1.9

Post by Alexinparis »

Stalk wrote:When I this uncommented, does not work.


ok another try:

Code: Select all

  TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN) ; // send REPEAT START condition

->

Code: Select all

  TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN) | (1 << TWSTO) ; // send REPEAT START condition

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

Nothing has changed, WMP does not work, BMA020 works.

spagoziak
Posts: 171
Joined: Thu Jan 20, 2011 1:18 am

Re: MultiWii 1.9

Post by spagoziak »

Alexinparis wrote:ok another try:

Code: Select all

  TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN) ; // send REPEAT START condition

->

Code: Select all

  TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN) | (1 << TWSTO) ; // send REPEAT START condition


I've finally had a chance to try this too... the issue still persists for me. I'm using the 1.9 version from this link and have applied the change described above.

I'm using an original WMP and a BMA020. I've disabled BMA in the code to simplify the process and still Debug2 counts up at about 1100 per second, resetting somewhere near 40k back to -30k and up again. My gyro lines stay a solid 0 no matter what I do to the machine. When enabled, the BMA020 responds in the GUI very sluggishly and only slightly.

Here's the code I'm running on the quad--I reversed acc roll and gyro pitch in sensors.pde. I've placed comments next to those with my initials, CMK.


spag
Attachments
MultiWii19I2CIssue.zip
Exactly what's on my arduino right now; no gyro functionality at all.
(51.16 KiB) Downloaded 208 times

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

It's good to see Alex has joined the fight. :) It's not good to have too many cooks in the kitchen, so I'll step back while he offers his fantastic support. But a couple comments:

I'm using an original WMP and a BMA020. I've disabled BMA in the code to simplify the process and still Debug2 counts up at about 1100 per second, resetting somewhere near 40k back to -30k and up again. My gyro lines stay a solid 0 no matter what I do to the machine. When enabled, the BMA020 responds in the GUI very sluggishly and only slightly.

Your issue is similar to Stalk's, but not exactly the same. It appears that his WMP works if the BMA020 is disabled. If the BMA020 is enabled it works, but the WMP does not. Since your WMP does not work at all with V1.9, and the BMA020 works poorly, then this may indicate that you might have more than one problem. Perhaps it would be helpful to get an o-scope on your I2C buss and see if the signals are up to par.

Also, in both of these WMP/BMA020 installations there was success with V1.8p2. But the earlier code seems to have masked I2C problems. Whether this was a good or bad thing, it certainly gave the impression that everything was perfect, even when there were I2C communication problems. I suggest that both users install V1.8p2 with the I2C R/W test code patch discussed elsewhere in this forum. If there are no I2C errors with that test then we can be assured that the sensors and I2C buss are fine and that problem with V1.9 is only in the new code. If the V1.8p2 I2C chirp test fails then I think it would be wise to find out why *before* masking the issue with code tricks. Otherwise the issue may just come back in the future to haunt us again.

I2C R/W Test Code: viewtopic.php?f=8&t=884

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

Re: MultiWii 1.9

Post by Alexinparis »

Thank you too to help to find out what could be the problem.
One thing is still strange for me: with the previous I2C code of 1.8p2, problem occurs in 1.9 and not in 1.8p2.
There is maybe something more hidden somewhere. I will try to compare in details all the differences.
Even if there is a hardware latent problem regarding I2C settings, I think 1.9 should be at least equivalent to 1.8, not worse ;)

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

Re: MultiWii 1.9

Post by PatrikE »

With the last changes on the 1.9 code.
My NB stops working after a couple of seconds.
The wmp contiues normally.

If i press reset it works 2-3 sec again then acc freezes.
1.9 ver before last changes works but cyckletime flickers between 4900 to 5100.
Used to be 6000 before.

maba
Posts: 1
Joined: Tue Nov 15, 2011 6:28 pm

MultiWii 1.9

Post by maba »

Hello
Im Markus from Switzerland and this is my first Multiwii X-Quad
Thanks Alex for your great Work !!!

One Question: on Debug1 I see the Baro value ? ;)

My Configuration:
WC Board matt black
FreeIMU 0.3.5MS
KDA20-26M
SS Series 18-20A ESC
weight 900 g
2650 Akku 30C
Futaba T7C


Regards Markus
Attachments
ScreenHunter_01 Nov. 15 17.45.jpg

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

I suggest that both users install V1.8p2 with the I2C R/W test code patch discussed elsewhere in this forum. If there are no I2C errors with that test then we can be assured that the sensors and I2C buss are fine and that problem with V1.9 is only in the new code. If the V1.8p2 I2C chirp test fails then I think it would be wise to find out why *before* masking the issue with code tricks. Otherwise the issue may just come back in the future to haunt us again.

I2C R/W Test Code: viewtopic.php?f=8&t=884

I tried it. 1000 errors I counted over 5 minutes.
I'm not sure it's something. WMP is powered by the D12 because it "freezes", ie is also likely that they will make mistakes.
It was with WMP and BMA020. I repeated the test with just WMP. It was the same.
Interestingly, the errors increasing by six.
Sorry for my English
Last edited by Stalk on Tue Nov 15, 2011 8:19 pm, edited 1 time in total.

jalves
Posts: 3
Joined: Wed Nov 09, 2011 12:04 am

Re: MultiWii 1.9

Post by jalves »

Alexinparis wrote:Thank you too to help to find out what could be the problem.
One thing is still strange for me: with the previous I2C code of 1.8p2, problem occurs in 1.9 and not in 1.8p2.
There is maybe something more hidden somewhere. I will try to compare in details all the differences.
Even if there is a hardware latent problem regarding I2C settings, I think 1.9 should be at least equivalent to 1.8, not worse ;)


Alex,

I have FAR less problems in my quad with fw_v1.9 than with the previous 1.8patch2 (I am new to this multiwii, start with 1.8patch2 two weeks ago), the stable is REALLY stable (with 1.8 stable lead to unwanted closed loopings with a slight breeze of the wind) and the Acro is really Acro (excellent manoeuvrability) . I2C problems ZERO! (don't know if with 1.8 it had, mrRC-cam patch code didn't run in my 1.8)

In a nutshell, a hell of upgrade!

Thanks!

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

I thought I'd stay out, but like a moth to a flame ... :)

Even if there is a hardware latent problem regarding I2C settings, I think 1.9 should be at least equivalent to 1.8, not worse

The earlier versions tended to hide the I2C problems that some users were experiencing. Although this allowed some models to fly, I don't think that continuing to mask I2C problems is the best solution.

Case in point is that after I fixed my I2C problems, I now have more precise acro and stable modes. Keep in mind I never knew I had I2C problems and I thought my model was flying fine. But it could have flown much better from the beginning had I known earlier what I know now. I also think that it is holding back your PID code optimization efforts. What I mean is that better PID code might appear to work worse on models with I2C issues. So the resulting user complaints might have caused you to make compromises in your code improvements.

While Alex is checking on the software, I would like to offer some assistance from the hardware perspective. So in case I can help, I have some questions.

It's not clear to me if anyone using the WMP *and* ELV BMA020 BOB board has had any success with V1.9. Can anyone confirm success with these two sensors (used together with no other sensors) on V1.9?

Does anyone have a schematic of the ELV BMA020 board that they can post? I can't find one online; perhaps a hard copy was included with the ELV board purchase that can be shared.

I don't have the WMP / BMA020 setup to check over on my test equipment. So if it is not too much trouble, I have some homework for a couple of you, as follows:

I tried it. 1000 errors I counted over 5 minutes.

@Stalk, unsolder the SDA and SCL wires from the BMA020 board. In the V1.8p2 and V1.9 sketches, disable the BMA020, enable the internal pullups, and select 100KHz speed. Repeat your tests on both software versions. Are the error counts the same as before? Anything change?

I'm using an original WMP and a BMA020. I've disabled BMA in the code to simplify the process and still Debug2 counts up at about 1100 per second, resetting somewhere near 40k back to -30k and up again. My gyro lines stay a solid 0 no matter what I do to the machine. When enabled, the BMA020 responds in the GUI very sluggishly and only slightly.

@Spagoziak, edit the sensors.pde as follows
Find the section that says: "#if defined(BMA020)"
About 10 lines below this is the ACC_getADC() function.
In ACC_getADC() comment out the first line that says "TWBR = ((16000000L / 400000L) - 16) / 2; "
In other words that line should be changed to "//TWBR = ((16000000L / 400000L) - 16) / 2;"
This will force the BMA020 to use the 100KHz clock, which is slightly more tolerant of marginal pullup resistor choices.
For sure, this won't fix your problem, but with this code change, does the BMA020 respond exactly the same way as before? Is the sluggishness identical or is it more responsive?

One Question: on Debug1 I see the Baro value ?

That is correct; debug1 has been showing the baro altitude value for several versions.

- Thomas
Last edited by mr.rc-cam on Tue Nov 15, 2011 10:22 pm, edited 2 times in total.

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: MultiWii 1.9

Post by Wayne »

I too have 1.9 working best it ever has.
When 1.9 came out I was one with the dead copter slow blink.
Alex fixed it but it was said to be a hardware problem workaround.
I could fly the fix but it just was not right so I went out to find my hardware problem.
I have…Hex6X, Paris V3, WM+, NK, Baro w/LLC and SpekSat.
I determined that because I had my WM+ / NK powered with only 3.3V I had to have both the Paris Bd. pull-ups and the software pull-ups enabled in order for it to work. (this setup worked up to 1.9)
Yesterday I moved the WM+ wire from 3.3V to 5V and disabled the software pull-ups and like I said,
Best Ever!

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: MultiWii 1.9

Post by jevermeister »

I use genuine Wmp and bma020 without problems but I also use baro and mag.

Nils

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

Re: MultiWii 1.9

Post by EOSBandi »

mr.rc-cam wrote:Does anyone have a schematic of the ELV BMA020 board that they can post? I can't find one online; perhaps a hard copy was included with the ELV board purchase that can be shared.

Yepp, I purchased the ELV publication article a while ago. Here it is for the grater good :D
EOSBandi
Attachments
ELV BMA020 board schematics
ELV BMA020 board schematics

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: MultiWii 1.9

Post by KeesvR »

For me the same as Jevermeister.
Tomorrow i try without the last 2 sensors.

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

I use genuine Wmp and bma020 without problems but I also use baro and mag.

That is very useful information.

Yepp, I purchased the ELV publication article a while ago. Here it is for the grater good

Thank you! I see that its 10K pullups require user configuration. Plus as I have discovered, the 10K ohm pullup value might be marginal in some installations.

Additional homework items for Stalk, Spagoziak, and jevermeister:
1. On the BMA020 schematic is a pair of I/O wire connection areas labeled ST1 and ST2. Please post the details to where you have connected each of their five pins/pads.
2. There is a PCB jumper pad labeled J1. Is yours open (no solder short) or closed (solder shorted)?

- Thomas

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: MultiWii 1.9

Post by jevermeister »

I installed the BMA on Paul Bake's Flydusense V2.0 I soldered a LLC onto that board to use with the Baro and Mag, Do you need a closeup of the Flydusense? The board is covered in Black Paint, but I may try to route the connections.

Nils

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

jevermeister wrote:I installed the BMA on Paul Bake's Flydusense V2.0 I soldered a LLC onto that board to use with the Baro and Mag

Useful information indeed. It gives me hope that the WMP/BMA020 problem may involve the external pullup resistor choices. For example, LLC's similar to Sparkfun's have 10K pullups too. So when it gets installed with ELV's BMA020, the effective HV pullup value is 5K ohms. The lower pullup value may be one of the reasons why your installation is working. For the record, I had to use 2.2K pullups to achieve success. But every installation is different and some will be fine with higher values.

Do you need a closeup of the Flydusense?

Let's hold off on that. For now it would be most helpful to know the answers to the BMA020 wiring homework I threw at you. :)
Last edited by mr.rc-cam on Tue Nov 15, 2011 11:14 pm, edited 1 time in total.

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

@Stalk, unsolder the SDA and SCL wires from the BMA020 board. In the V1.8p2 and V1.9 sketches, disable the BMA020, enable the internal pullups, and select 100KHz speed. Repeat your tests on both software versions. Are the error counts the same as before? Anything change?

BMA020 unsoldered and disabled in soft, enabled internal pullups, spedd i2c 100kHz. In V1.8p2 WMP working with errors, as previously, in V1.9 working great without errors, debug2=0.

1. On the BMA020 schematic is a pair of I/O wire connection areas labeled ST1 and ST2. Please post the details to where you have connected each of their five pins/pads.


I wired it according to schedule:
http://multiwii.googlecode.com/svn/trunk/Doc/Diagrams/8%20Connection%20diagram%20Seeeduino%20Mega.png

2. There is a PCB jumper pad labeled J1. Is yours open (no solder short) or closed (solder shorted)?

i have open J1.

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: MultiWii 1.9

Post by jevermeister »

Hi

Did my Homework:

Image

The SCL is additionally passed through to the LLC that is onboard the Flydusense, it is equipped with 2.2k resistors.


Do you need something else?

Nils

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

Stalk wrote:BMA020 unsoldered and disabled in soft, enabled internal pullups, speed i2c 100kHz. In V1.8p2 WMP working with errors, as previously, in V1.9 working great without errors, debug2=0.

Thanks for the info.
Just to clarify, after unsoldering the BMA020's SDA and SCL wires, did the V1.8p2 I2C error count increase at about the same rate as before, or were there less errors per minute?


1. Using your voltmeter, with the meter's ground probe on the BMA020 GND pin, what voltages do you measure at its UIN and UPullup pins?
2. What switch position did you choose for your Seeeduino ATMEGA1280's 3.3_VCC_5V switch?


jevermeister wrote:Hi
Did my Homework:
{Snip Image}
The SCL is additionally passed through to the LLC that is onboard the Flydusense, it is equipped with 2.2k resistors.
Do you need something else?

Thanks for the info, it is useful. Especially the news that your shield's LLC has 2.2K pullups. So your homework is complete, for now. :)

- Thomas

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

1. Using your voltmeter, with the meter's ground probe on the BMA020 GND pin, what voltages do you measure at its UIN and UPullup pins?

3.29V
2. What switch position did you choose for your Seeeduino ATMEGA1280's 3.3_VCC_5V switch?

Sorry, here is right scheme of my plate:
Attachments
Wii03.jpg

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

Stalk wrote:
1. Using your voltmeter, with the meter's ground probe on the BMA020 GND pin, what voltages do you measure at its UIN and UPullup pins?

3.29V

That would indicate that you are using a 3.3V version Arduino CPU board. Is that correct? If possible, please post the URL to the exact Arduino CPU board you purchased.
If instead you have the 5V Arduino CPU board then something is loading down the I/O pin; If this is the case then it would definitely be the cause of the I2C problem.

I also see a diode on the POWERPIN's power supply connection to the WMP. I don't think this is a good idea when the WMP is powered by 3.3V. Please use your voltmeter and measure the supply voltage directly at the WMP board. What voltage do you have there?

New question: Those of you that have a working V1.9 (no errors) with WMP/BMA020, is your Arduino CPU running on 3.3V or 5.0V? Rather than trust what you think you have, one way to tell is to perform the voltmeter measurement on the POWERPIN. This is the CPU I/O pin that is used to power the WMP. The voltage on this pin will closely reflect the supply voltage used by the CPU chip. Please check it and report the voltage you measured.
Last edited by mr.rc-cam on Wed Nov 16, 2011 12:58 am, edited 1 time in total.

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: MultiWii 1.9

Post by jevermeister »

mr.rc-cam wrote:
Stalk wrote:
1. Using your voltmeter, with the meter's ground probe on the BMA020 GND pin, what voltages do you measure at its UIN and UPullup pins?

3.29V

That would indicate that you are using a 3.3V version Arduino CPU board. Is that correct? If possible, please post the URL to the exact Arduino CPU board you purchased.
If instead you have the 5V Arduino CPU board then something is loading down the I/O pin; If this is the case then it would definitely be the cause of the I2C problem.

New question: Those of you that have a working V1.9 (no errors) with WMP/BMA020, is your Arduino CPU running on 3.3V or 5.0V? Rather than trust what you think you have, one way to tell is to perform the voltmeter measurement on the POWERPIN. This is the CPU I/O pin that is used to power the WMP. The voltage on this pin will closely reflect the supply voltage used by the CPU chip. Please check it and report the voltage you measured.



Hi use a Flyduino...

spagoziak
Posts: 171
Joined: Thu Jan 20, 2011 1:18 am

Re: MultiWii 1.9

Post by spagoziak »

I'll get workin on that homework but I won't be able to post results till tomorrow! Thank you for your help, Thomas!

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

mr.rc-cam wrote:
Stalk wrote:
1. Using your voltmeter, with the meter's ground probe on the BMA020 GND pin, what voltages do you measure at its UIN and UPullup pins?

3.29V

That would indicate that you are using a 3.3V version Arduino CPU board. Is that correct? If possible, please post the URL to the exact Arduino CPU board you purchased.
If instead you have the 5V Arduino CPU board then something is loading down the I/O pin; If this is the case then it would definitely be the cause of the I2C problem.

I also see a diode on the POWERPIN's power supply connection to the WMP. I don't think this is a good idea when the WMP is powered by 3.3V. Please use your voltmeter and measure the supply voltage directly at the WMP board. What voltage do you have there?

New question: Those of you that have a working V1.9 (no errors) with WMP/BMA020, is your Arduino CPU running on 3.3V or 5.0V? Rather than trust what you think you have, one way to tell is to perform the voltmeter measurement on the POWERPIN. This is the CPU I/O pin that is used to power the WMP. The voltage on this pin will closely reflect the supply voltage used by the CPU chip. Please check it and report the voltage you measured.


I have Arduino Pro Mini powered from 5V (see last schema), WMP is powered from D12 over 1 diode, BMA020 is powered from separate source 3.3V. I think it is correct.

My opinion: in version 1.8p2 it works correctly, in version 1.9 also works standalone WMP correctly without errors, but does not work with BMA020. For me, this implies that it is a collision on the bus.

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: MultiWii 1.9

Post by KeesvR »

I use my WM+ and BMA020 direct to D12 no internal or external pull-up used.
The BMP085 and HMC5883 powered by 3.3V and 2K2 pull-up.

Working with no problem.

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

I have Arduino Pro Mini powered from 5V (see last schema),

Yes, it is powered by 5V, but the Arduino has its own internal VReg, and that is what is important. What I mean is that the Arduino family is available with a 3.3V or 5.0V VReg, depending on the version you purchased. To fully understand your problem I think it is very important to determine if yours is really the 5V CPU model.
Here is an example of what I mean (this is for the Pro Mini, but the idea is the same for the other models):
3.3V model: http://www.sparkfun.com/products/9220
5.0v model: http://www.sparkfun.com/products/9218

WMP is powered from D12 over 1 diode,

That is why I am not certain you have a 5V Arduino. If your Arduino is the 5V model, and one diode is used to drop the POWERPIN voltage, then the WMP should be getting about something closer 4.5V rather than 3.3V. If it is the 5V CPU, then something seems wrong with your D12 voltage.

I don't use the WMP, but I understand that it is compatible with 5V, so the diode does not seem necessary.

BMA020 is powered from separate source 3.3V. I think it is correct.

If you power the BMA020 from 3.3V, and you have a 5V Arduino, then your I2C signal levels will typically be too low for reliable operation. That is because the BMA020's HV pullups will be sourced from 3.3V, but the 5V Arduino needs 5V I2C levels for reliable I2C communication. BTW, the Arduino's internal I2C pullups are very high value (25-50K ohms), so for some installations they do work well. This will explain the effects of incorrect pullup choices: http://dsscircuits.com/articles/effects ... stors.html

My opinion: in version 1.8p2 it works correctly, in version 1.9 also works standalone WMP correctly without errors, but does not work with BMA020. For me, this implies that it is a collision on the bus.

Keep in mind that poor I2C signals will cause symptoms that seem the same as buss collisions. As mentioned before, version 1.8P2 masks the I2C problems. Furthermore, your V1.8p2 reported about 1000 I2C errors/minute, so technically it is not working correctly. V1.9 does no longer hides the I2C problems; I think this is a good thing since it allows us to identify that something needs to be fixed.

FWIW, your I2C error count with V1.8p2 hints that your model may not performing as good as possible. But, if you are happy with the old I2C code and do not need maximum PID performance, then you could change V1.9 by replacing all the new I2C code (in sensors.pde) with the old versions. Or Alex could do this via a #define trick for installations like yours. But I think you would be better off with fixing the I2C problems rather than mask them in the code.

If you would like help with a I2C hardware fix then I can propose a possible solution for your installation. But so that my suggestions don't cause harm to your electronics, I must see an accurate wiring diagram that shows how you have wired the Arduino, WMP, and BMA020. I also need you to confirm that you have a 5.0V Arduino instead of the 3.3V version; As explained, they look the same, the main difference is the CPU's power supply VReg on the Arduino CPU board.

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

I have Arduino Pro Mini 5V. Accurate Wiring is on previous page (in pic named Wii03.ch). My DIY board have two connectors for I2C device: one powered from D12 over diode (as recommended in the early) a another powered 3.3V.

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

Stalk wrote:I have Arduino Pro Mini 5V. Accurate Wiring is on previous page (in pic named Wii03.ch). My DIY board have two connectors for I2C device: one powered from D12 over diode (as recommended in the early) a another powered 3.3V.

Ok, let's try to improve your I2C. Some remaining questions before I modify your schematic:
(1) Is the BMA020's four wires connected directly to JP17 on your drawing?
(2) Please measure the voltage on the Anode (CPU) side of the D12 Diode. What is the value?
(3) Please measure the voltage on the Arduino VCC output pin. What is the value?
For reference, this schematic will show you where to find the Arduino VCC pin:
http://dlnmh9ip6v2uc.cloudfront.net/dat ... ni-v12.pdf

- Thomas

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

1) BMA020 is connected via a 4-pole connector to JP17.
2) 4.69V
3) 4.95V
Thank you for your efforts

Reflex
Posts: 12
Joined: Sat Sep 10, 2011 3:54 pm

Re: MultiWii 1.9

Post by Reflex »

Hi. not sure if this is useful here
but I find BMP085 Baro won't work in 1.8 or 1.9 (tried 2 baro's)
they do however work in 1.7

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

Re: MultiWii 1.9

Post by Alexinparis »

Stalk wrote:1) BMA020 is connected via a 4-pole connector to JP17.
2) 4.69V
3) 4.95V
Thank you for your efforts

Hi,
D12 power stability is lower than a direct 5V connection.
As D12 is now not useful (no more hard reset),
could you try to power everything (WMP+BMA) via a direct 5V source without diode ?

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

Alexinparis wrote:Hi,
D12 power stability is lower than a direct 5V connection.
As D12 is now not useful (no more hard reset),
could you try to power everything (WMP+BMA) via a direct 5V source without diode ?

I agree with all of that, which is where we are going with this. However, on the first attempt to fix this problem I think the D12 power should be used so that the changes can be tested on V1.8 and V1.9.

@stalk, Here is the first I2C solution that I propose. Please try it and report what you find. If it does not help then we will do more tests. Later you can eliminate the D12 power method since it is obsolete on V1.9.
Attachments
Modified Schematic
Modified Schematic

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

When I powered WMP and BMA020 of 5V, it is the same. V1.9 many errors, status led permanently lights, WMP not works. V1.8p2 errors steps by 6, status led no lights, alarm sometimes flash, WMP and BMA020 works.
Pullups are not so easy to connect to the finished shield.

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

Stalk wrote:When I powered WMP and BMA020 of 5V, it is the same. V1.9 many errors, status led permanently lights, WMP not works. V1.8p2 errors steps by 6, status led no lights, alarm sometimes flash, WMP and BMA020 works.
Pullups are not so easy to connect to the finished shield.

At least it is not worse. :)
1. What is the D12 voltage at the power input pin on the BMA020? Measure at the BMA020, not elsewhere.
2. The new pullup resistors are important. No need to change the shield, just solder them directly to the header pins of the Arduino or the WMP. For the tests you don't have to make it look pretty.

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

1) Now is the BMA020 5V.
2) New Pullups I add Tomorrow, I go to sleep.

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

Stalk wrote:1) Now is the BMA020 5V.

My apologies, I typed BMA020 but I meant the WMP. This measurement is only of interest to me if D12 powers the WMP as shown in the schematic I posted.

2) New Pullups I add Tomorrow, I go to sleep.

Very good, a nice fresh start tomorrow.

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: MultiWii 1.9

Post by ziss_dm »

Hi,
Is D12 still used in 1.9?

regards,
ziss_dm

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: MultiWii 1.9

Post by mr.rc-cam »

ziss_dm wrote:Is D12 still used in 1.9?
ziss_dm

With v1.9 the D12 POWERPIN is no longer used to perform the hard reset when the WMP locks up. So it would be practical to use this I/O pin for something else, which is nice.

- Thomas

Stalk
Posts: 49
Joined: Tue Apr 05, 2011 12:39 pm

Re: MultiWii 1.9

Post by Stalk »

I added an external pullups 2k2. WMP and BMA020 are supplied directly from 5V.
In v1.8p2: WMP and BMA020 work, errors are about 600 in 5 minutes.
In v1.9.: Both work debug2 = 0 for 5 minutes.
Good job, thank you very much.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii 1.9

Post by shikra »

Eureka !

If anyone remembers my posts a couple of days back regarding tilt and drift in stable mode

Well, after a couple of evenings learning and understanding better the code for the PID and IMU, last night I think I pinpointed the cause for drift in level mode that is affecting me - and quite probably others that report annoying drift in level mode.

Initial tests holding the multi it in my hand look very good. Locks in well. I need to try some options with the code to get the best results and do some real world flying before looking for a few test dummies.

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: MultiWii 1.9

Post by jevermeister »

shikra wrote:Eureka !

If anyone remembers my posts a couple of days back regarding tilt and drift in stable mode

Well, after a couple of evenings learning and understanding better the code for the PID and IMU, last night I think I pinpointed the cause for drift in level mode that is affecting me - and quite probably others that report annoying drift in level mode.

Initial tests holding the multi it in my hand look very good. Locks in well. I need to try some options with the code to get the best results and do some real world flying before looking for a few test dummies.


Details!!!!!! We need deatials, what where when why whO??

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii 1.9

Post by shikra »

Patience my young grasshopper!

I have a few things to do first..
figure out how to explain concisely it so can be understood
test some code in real world
Mid week probably


It is very simple really. Sometimes one can look too hard - but at least I now understand the PID and IMU algorithms far more than I need too!

But most important. I have an amazing new toy to build..... xmas is early for me....;

Post Reply