DEV r1553 - Minthrottle not setting correctly

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
Geebles
Posts: 24
Joined: Sat Jan 26, 2013 2:23 am

DEV r1553 - Minthrottle not setting correctly

Post by Geebles »

Hi devs,

I've been experimenting with latest dev r1553 (https://code.google.com/p/multiwii/source/detail?r=1553) and have found an odd behaviour using a Crius AIOP V2 (Mega) (probably not specific to this board but I thought I'd mention it)

1. Calibrated ESCs to 1000 - 2000 externally
2. Flashed 'clear eeprom' to FC
3. Flashed with 'MINTHROTTLE 1150' and 'MAXTHROTTLE 1850'
4. Power up FC, GUI reports the values above
5. Using oscilloscope, when disarmed the waveform is ~20% ON (normal - looks like its at 'MINCOMMAND 1000')
6. When armed, oscilloscope reads ~1% ON! (not right, this is a very very low PWM output)
7. Increasing throttle until 90% reads on oscilloscope ~60% ON and then the motors come to life!! Before this the motors do not respond (SimonK FW)

I have checked and I have not enabled the 0 - 2000 PWM mode (EXT_MOTOR...) I've literally just checked the code out, set my board and flashed!

My code is here: https://dl.dropboxusercontent.com/u/2831810/MW2.2_r1553.zip

Any ideas? I'm fairly with it in terms of set up, but not enough to actually dig through the code and work out what is being set incorrectly in the registers/somewhere that is causing the PWM scale to be from 0-100%..

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

Re: DEV r1553 - Minthrottle not setting correctly

Post by Alexinparis »

Hi,

5. Using oscilloscope, when disarmed the waveform is ~20% ON (normal - looks like its at 'MINCOMMAND 1000')

not really normal: disarmed means signal = 1000us => at 490Hz, the waveform should be around 50%
I would start investigation here

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

DEV r1553 - Minthrottle not setting correctly

Post by doughboy »

Not sure if I'm running into the same problem. I've had my quad on pre 2.2 software and everything works fine. I just upgraded to latest and now the motors don't turn on at all (it arms) with my throttle curve settings I used on 2.1 motors don't come on at all even at 100% throttle. If I reset to default, motor only comes on when throttle is pushed up halfway.

I then restored back to my old firmware and the quad works just fine. Motors turn on arm.

It looks like the throttle lookup table calculation may be ending up with values that are too low. The 2.1 code does not have this lookup table.

Any ideas what I need to do to fix this?

Thanks

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

Re: DEV r1553 - Minthrottle not setting correctly

Post by PatrikE »

Clear Eeprom with the Arduino example sketch.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: DEV r1553 - Minthrottle not setting correctly

Post by doughboy »

PatrikE wrote:Clear Eeprom with the Arduino example sketch.


I thought that clearing eeprom issue was resolved by adding the checksum.
anyway, I cleared it and it did not make any difference.

I tried the 2.2 release and everything works fine.
so something got messed up between 2.2 release and the current head revision.
2.2 default setting works great.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: DEV r1553 - Minthrottle not setting correctly

Post by doughboy »

Alexinparis wrote:Hi,

5. Using oscilloscope, when disarmed the waveform is ~20% ON (normal - looks like its at 'MINCOMMAND 1000')

not really normal: disarmed means signal = 1000us => at 490Hz, the waveform should be around 50%
I would start investigation here


I agree with Geebles observation. It does look like the calculations resulted in throttle (or the motors calculation in mixTable) have way less value than it is supposed to. I had to push the throttle up to around 50% before the motors start to spin.

The 2.2 stable works fine. I tried to find what change could have caused this but there are too many changes in between.

Geebles
Posts: 24
Joined: Sat Jan 26, 2013 2:23 am

Re: DEV r1553 - Minthrottle not setting correctly

Post by Geebles »

doughboy wrote:
Alexinparis wrote:Hi,

5. Using oscilloscope, when disarmed the waveform is ~20% ON (normal - looks like its at 'MINCOMMAND 1000')

not really normal: disarmed means signal = 1000us => at 490Hz, the waveform should be around 50%
I would start investigation here


I agree with Geebles observation. It does look like the calculations resulted in throttle (or the motors calculation in mixTable) have way less value than it is supposed to. I had to push the throttle up to around 50% before the motors start to spin.

The 2.2 stable works fine. I tried to find what change could have caused this but there are too many changes in between.


That sounds exactly like what I was seeing, around that kind of throttle level before the motors would even start! I'll get the output of oscilloscope and put it here to show what I mean, you say its in the mixTable the error has changed? I'll try and look through the logic but it sounds like you have a better idea than I do! :P What hardware/config are you using?

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: DEV r1553 - Minthrottle not setting correctly

Post by doughboy »

I tried to follow the code in the mix tables function, and I cannot see any problem. I did manual calculations etc and everything checks out.
so then I noticed on the MWGUI, the voltage is showing some funny value, so I started changing the value of VBAT_SCALE, and tried out a few different values and the vbat value started to get closer to the correct value, and finally, I ended up back to the original VBAT_SCALE value of 131! and now the vbat voltage is correct, and the quad arms and motor spins. I did not change any code from the case that worked and one that did not other than uploading the sketch a few more time due to trying out different VBAT_SCALE values!

I'm guessing there might be an issue with storing or reading conf values from eeprom that is causing all this. perhaps the throttle lookup table is not storing or getting the right value from eeprom. But I don't see how that can be because the code uses checksum to verify the data read from eeprom. maybe that checksum verification code is allowing bad data to pass as good.

anyway, I got my quad flying again using the latest code.

Pat1300
Posts: 12
Joined: Fri Aug 03, 2012 11:31 am
Location: Wavre - BELGIUM

Re: DEV r1553 - Minthrottle not setting correctly

Post by Pat1300 »

Are you sure that you are using MultiwiiConf from 2.2, not MultiwiiConf from 2.1 ??
I got exactly same issue when using MultiwiiConf 2.1 with FW Multiwii 2.2 : some values, like minThrottle, were overwritten by uninitialized values from MultiwiiConf 2.1...

Patrick

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: DEV r1553 - Minthrottle not setting correctly

Post by doughboy »

hmm, I am using MW conf from 2.2 release (compiled), not the shared one (source only).
I did say that 2.2 release FW I did not have any problem, only on shared.

if mismatched gui and fw will cause problem, perhaps there should be a check in gui if the fw matches.
but if that is the case, I shouldn't be able to get my quad to work still using the 2.2 release gui and shared fw, but yet I did.
perhaps the 2.2 gui has that problem you described as well.

I guess it's still a good idea to make sure the gui and fw match. I'll test later using the shared gui.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: DEV r1553 - Minthrottle not setting correctly

Post by doughboy »

ok, Patrick, you got the correct answer.

The MultiWiiConf_shared MUST be used when using MultiWii_shared firmware!!

this is what I posted in the vbat thread

ok, I ran into this issue, as well as the throttle issue.
and as others pointed out, the MW GUI is the problem.
If you are using code in shared, you must use the Gui from shared, as that has the page that allows you to set the VBATSCALE, MINTHrOTTLE, etc. Without this, I think they just get a value of 0 (more so if you cleared the eeprom).
As an example, with the throttle problem, when I arm, I have to push throttle to halfway before motors starts to spin.
I have also seen when I arm, the low battery warning alarm sounds right away, even when my battery is fully charged!

resetting in gui will only work if you are using the shared version of gui, not the 2.2 release gui.

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

Re: DEV r1553 - Minthrottle not setting correctly

Post by Alexinparis »

doughboy wrote:ok, Patrick, you got the correct answer.

The MultiWiiConf_shared MUST be used when using MultiWii_shared firmware!!

this is what I posted in the vbat thread

ok, I ran into this issue, as well as the throttle issue.
and as others pointed out, the MW GUI is the problem.
If you are using code in shared, you must use the Gui from shared, as that has the page that allows you to set the VBATSCALE, MINTHrOTTLE, etc. Without this, I think they just get a value of 0 (more so if you cleared the eeprom).
As an example, with the throttle problem, when I arm, I have to push throttle to halfway before motors starts to spin.
I have also seen when I arm, the low battery warning alarm sounds right away, even when my battery is fully charged!

resetting in gui will only work if you are using the shared version of gui, not the 2.2 release gui.


Ok, nice to see you solved your problem.

some complement:
MW GUI is retroactive: with MW GUI 2.2 dev, you can control a 2.2 FC

but, with MW GUI 2.2 you can't control fully a 2.2 dev FC
the reset button will work, but everytime you hit on write button, things like minthrottle will get weird values.

User avatar
Benik3
Posts: 25
Joined: Mon Aug 26, 2013 1:06 pm
Contact:

Re: DEV r1553 - Minthrottle not setting correctly

Post by Benik3 »

I have the same problem, but I'm not able to find, where to get the GUI 2.2 dev which will work with the dev MultiWii :/

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: DEV r1553 - Minthrottle not setting correctly

Post by -ralf- »

Benik3 wrote:I have the same problem, but I'm not able to find, where to get the GUI 2.2 dev which will work with the dev MultiWii :/

It's part of this archive

http://code.google.com/p/multiwii/downloads/detail?name=MultiWii_dev_2013_08_23_r1555.zip&can=2&q=

User avatar
Benik3
Posts: 25
Joined: Mon Aug 26, 2013 1:06 pm
Contact:

Re: DEV r1553 - Minthrottle not setting correctly

Post by Benik3 »

I got it, thanks :)
BTW x64 app doesn't work for me, 32bit yes (I have Windows 7 HP x64)...

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: DEV r1553 - Minthrottle not setting correctly

Post by doughboy »

processing 2.0 has disabled 64 bit support for serial library. If you really want 64 bit, you can use processing 1.5. I believe you need to find and install 64 bit rxtx dll for 64 bit to work in processing 1.5.

Post Reply