Three independent, stick selectable settings in EEPROM

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download

Three independent, stick selectable settings in EEPROM

Postby Mis » Fri Sep 28, 2012 9:50 pm

Hi !
Is done in r1147 8-)

For change setting number via sticks (at disarmed state):
SET1 - ROLL left + YAW left + THROTTLE min. - one confirmation beep and led blink
SET2 - PITCH up + YAW left + THROTTLE min. - two confirmation beep and led blink
SET3 - ROLL right + YAW left + THROTTLE min. - three confirmation beep and led blink
Last used setting number is stored in eeprom and and after next power up we hear one, two or three beeps indicating what settings are loaded.

Any setting have full configuration structure inside, and we must calibrate ACC and MAG in each setting separatly.
Temporarily the GUI show active setting number as "Power"... We need new GUI.
For now, after change the setting number via sticks, we must click "READ" button on GUI for read current config, then setup it, then click "WRITE"
New serial MSP command added: MSP_SELECT_SETTING - in message, Select Setting Number (0-2)

On future, the calibration data should be moved to separate "global" settings structure... But not all at once :)
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Three independent, stick selectable settings in EEPROM

Postby jevermeister » Fri Sep 28, 2012 9:58 pm

Excellent idea!Good way to implement it with the stick combos.

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

Re: Three independent, stick selectable settings in EEPROM

Postby Danal » Sat Sep 29, 2012 9:26 am

What do we want to call these? Some commercial systems *cough* vbar *cough* call this "Bank Select". Do we want to call them "banks", or something else?


And... do you want someone to take a shot at the GUI? I'd be happy to make those changes.
Danal
 
Posts: 137
Joined: Tue Oct 18, 2011 5:15 pm

Re: Three independent, stick selectable settings in EEPROM

Postby Mis » Sat Sep 29, 2012 1:47 pm

The name... hmmm maybe "Profiles" ?
In GUI we need three buttons for profile switching. Click on button should send MSP_SELECT_SETTING command with 1 byte of parameter called profile number (0..2 for profile 1..3). Then gui should perform "READ" click. Second change is displaying of current selected setting. This may be done by marking one of profile button as green, and other as red. I think about extend MSP_STATUS command adding current profile number as last one byte of payload.
Now this is commented out because current GUI not work corectly with 11byte transferred in MSP_STATUS command.

BTW
I'm working on short implementation of "global settings" for storing profile number, ACC and MAG calibration data and maybe some other global params. After this we don't need to repeat ACC and MAG calibration in each profile.
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Three independent, stick selectable settings in EEPROM

Postby Hamburger » Sat Sep 29, 2012 2:59 pm

Interesting, it was wished for for a long time.
One question:
why not have a single stick combo to increment current setting number, so you can cycle through the settings step by step?
Then it was independant of number of stored settings. Also easier to increase number of stored settings, you do not run out of stick combos so fast - we only have a limited number of stick combos for all future features to come.
User avatar
Hamburger
 
Posts: 2553
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: Three independent, stick selectable settings in EEPROM

Postby howardhb » Sat Sep 29, 2012 3:08 pm

+1 ! Awesome!

Name them "Flight mode" as in heli setups?
User avatar
howardhb
 
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: Three independent, stick selectable settings in EEPROM

Postby Hamburger » Sat Sep 29, 2012 3:29 pm

not sure whether it is safe to switch during flight, but maybe we could also offer a checkbox item for tying the 'flight mode' selection to aux channels?
User avatar
Hamburger
 
Posts: 2553
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: Three independent, stick selectable settings in EEPROM

Postby Mis » Sat Sep 29, 2012 5:46 pm

Hamburger, you can't switch profile (i like this name :-) ) during flight. Switching is only possible if disarmed, even from PC.
I'm not use sequential change via single stick combination because we not have sure feedback about current setting number. If you enable RCOPTIONSBEEP (i like this option), you can hear additional beep during profile change, because BOXes can have different layout. In current implementation if you switch to first profile and hear two beep's, and you not sure about selected profile, you can switch one more time to first profile, and now propertly hear only one beep.

Dev r1148 commited. Added global_conf struct for calibration datas storage.
From now calibration of MAG and ACC on each profile is not needed. Calibration is independent from selected profile.
If calibration datas is bad - the LED constantly blink (like in high tilted state) until we calibrate ACC.
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Three independent, stick selectable settings in EEPROM

Postby jevermeister » Sat Sep 29, 2012 8:06 pm

Wouldnt it be good to add a buzzer alarm for not calibrated acc?

The beeps of aux kicking in is an issue i could not get rid od yet :-(.
Any ideas?
User avatar
jevermeister
 
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am

Re: Three independent, stick selectable settings in EEPROM

Postby Mis » Sat Sep 29, 2012 10:06 pm

jevermeister wrote:Wouldnt it be good to add a buzzer alarm for not calibrated acc?

Maybe this is not a buzzer :D , but for now you see constantly blinking onboard LED, and can't arm the copter. Until you calibrate ACC.
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Three independent, stick selectable settings in EEPROM

Postby jevermeister » Sun Sep 30, 2012 12:47 am

Being unable to arm is very good. I killed a couple of props by forgetting to calibrate ;-)
User avatar
jevermeister
 
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am

Re: Three independent, stick selectable settings in EEPROM

Postby Alexinparis » Sun Sep 30, 2012 6:35 pm

I think it's an interesting mod which should allow a switch between cool & 3D config.
Some items could probably also migrate in the global_conf struct, like angleTrim
Alexinparis
 
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Three independent, stick selectable settings in EEPROM

Postby Mis » Sun Sep 30, 2012 9:16 pm

I not add the angleTrims because I'm not sure about role of angleTrim, but OK, i can move it to global_config. Some more variables should be global ? I think about battery alarm levels, but someone need two configurations for flying with 3S or 4S battery, and in this case different alarms should be good option.
Last edited by Mis on Sun Sep 30, 2012 9:19 pm, edited 2 times in total.
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Three independent, stick selectable settings in EEPROM

Postby jevermeister » Sun Sep 30, 2012 9:17 pm

Yeah! I like where this is goong. Another very important and handy feature added.
User avatar
jevermeister
 
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am

Re: Three independent, stick selectable settings in EEPROM

Postby Mis » Sun Sep 30, 2012 11:14 pm

One more question about angleTrims. This is not depended from copter setup (e.g. additional weight at front - with camera) ?. If yes, this should be moved to global.conf. I do not want to hunt for it with a million of #ifdef options.
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Three independent, stick selectable settings in EEPROM

Postby Hamburger » Mon Oct 01, 2012 8:33 am

Alexinparis wrote:I think it's an interesting mod which should allow a switch between cool & 3D config.

that is what I thought too. But Mis commented on that idea already:
Mis wrote:Hamburger, you can't switch profile (i like this name :-) ) during flight. Switching is only possible if disarmed, even from PC

Any chance to maybe separate those settings that could safely altered during flight and those that could not? Or is it simply the time penalty for reading and re-initializing that forbids switching profiles?
I would like to see the profile select bound to a 3 position switch and an aux channel, same as is possible with acro-horizon-angle mode today.

Mis, keep going please.
User avatar
Hamburger
 
Posts: 2553
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: Three independent, stick selectable settings in EEPROM

Postby Mis » Sat Oct 06, 2012 12:51 am

I'm not sure, if it's safe for switching profile during flight. IMHO better is leave as is, eg. select profile before arming.
BTW. Now we need new PC configuration software with selecting profile support. I'm not PC side programmer, and can't make this.
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Three independent, stick selectable settings in EEPROM

Postby jevermeister » Sat Oct 06, 2012 8:07 am

Me neither but if noone is ti be found I will try.
Btw.: I noticed Andras (Eosbandi) hasn' t been here for a while. Anyone knows where he went?
User avatar
jevermeister
 
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am

Re: Three independent, stick selectable settings in EEPROM

Postby Danal » Sat Oct 06, 2012 10:35 am

Mis wrote:I'm not sure, if it's safe for switching profile during flight. IMHO better is leave as is, eg. select profile before arming.
BTW. Now we need new PC configuration software with selecting profile support. I'm not PC side programmer, and can't make this.


I will volunteer for the PC/GUI side, if you are OK with that.

Danal
Danal
 
Posts: 137
Joined: Tue Oct 18, 2011 5:15 pm

Re: Three independent, stick selectable settings in EEPROM

Postby copterrichie » Sat Oct 06, 2012 2:41 pm

jevermeister wrote:Me neither but if noone is ti be found I will try.
Btw.: I noticed Andras (Eosbandi) hasn' t been here for a while. Anyone knows where he went?


I asked that same question here, where is Andras: viewtopic.php?f=16&t=2558
copterrichie
 
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Three independent, stick selectable settings in EEPROM

Postby Alexinparis » Sat Oct 06, 2012 5:11 pm

I had some time this afternoon, and did the mod ;)
Alexinparis
 
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Three independent, stick selectable settings in EEPROM

Postby timecop » Sat Oct 06, 2012 5:16 pm

Alexinparis wrote:I had some time this afternoon, and did the mod ;)


258 - headSerialReply(10);
258 + headSerialReply(11);


wasn't the whole point of new serial protocol so stuff like this doesn't happen?
so now GUI software will need to check length of MSP_STATUS and if its 10 bytes, thats old version and if its 11, its new?

< dongs> if they're gonna start doing profiles
< dongs> they need a whole new shit
< dongs> get/set profile stuff
< dongs> not tacking it on some totally unrelated shit
timecop
 
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Three independent, stick selectable settings in EEPROM

Postby Alexinparis » Sat Oct 06, 2012 5:29 pm

1) If the GUI third party soft is implemented like the java one, the message length can change transparently because it must be read during the protocol recognition process.
2) If a new var is added at the end of an existing message (the order is important), there should be no consequence for "non aware" GUI.
It is just stacked in the read message buffer and ignored. I checked with an old version of the GUI.
Alexinparis
 
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Three independent, stick selectable settings in EEPROM

Postby Sebbi » Sat Oct 06, 2012 5:43 pm

Alexinparis wrote:1) If the GUI third party soft is implemented like the java one, the message length can change transparently because it must be read during the protocol recognition process.
2) If a new var is added at the end of an existing message (the order is important), there should be no consequence for "non aware" GUI.
It is just stacked in the read message buffer and ignored. I checked with an old version of the GUI.


1) MultiWiiConf doesn't use the length of the message and just assumes MSPs are of a certain length ;-) In other words, the MSP_STATUS case of the switch statement assumes there are 11 bytes available now, but if an old MultiWii version is connected there will be only 10 bytes in that message and the GUI will break. Tested for that?
2) That is true, but it still is a new feature that would have deserved its own MSPs, does it not?
Sebbi
 
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany

Re: Three independent, stick selectable settings in EEPROM

Postby jevermeister » Sat Oct 06, 2012 5:48 pm

Hi,
could you please add a beep_confirmation=1 when finised writing params, blinkLED does not trigger the buzzer anymore.
I found it useful to let the copter beep when I succesfully uploaded params from gui or bluetooth,
also get rid of the if b==1, b is not set by gui or bluetooth.


Thank you, nils
User avatar
jevermeister
 
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am

Re: Three independent, stick selectable settings in EEPROM

Postby Alexinparis » Sat Oct 06, 2012 6:16 pm

Sebbi wrote:
Alexinparis wrote:1) If the GUI third party soft is implemented like the java one, the message length can change transparently because it must be read during the protocol recognition process.
2) If a new var is added at the end of an existing message (the order is important), there should be no consequence for "non aware" GUI.
It is just stacked in the read message buffer and ignored. I checked with an old version of the GUI.


1) MultiWiiConf doesn't use the length of the message and just assumes MSPs are of a certain length ;-) In other words, the MSP_STATUS case of the switch statement assumes there are 11 bytes available now, but if an old MultiWii version is connected there will be only 10 bytes in that message and the GUI will break. Tested for that?
2) That is true, but it still is a new feature that would have deserved its own MSPs, does it not?


1) To be more accurate, MultiWiiConf just assumes MSPs are of a minimum length to fill correctly the GUI. But if this length is smaller (an old MultiWii version for instance), a weird data is read in the message buffer, no crash to expect.
2) current profile setting is a kind of status indication, but if you find a dedicated message should be used, why not I understand he point
Alexinparis
 
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Three independent, stick selectable settings in EEPROM

Postby Sebbi » Sat Oct 06, 2012 6:31 pm

1) I looked at the code again and it seems you are right. But read8() will use and old byte from the inputbuffer (e.g. from the last received MSP) and not wait forever because this byte will not arrive. But it doesn't check the value ... so it might not break the GUI, but it still is reading and displaying false data when used with 10-byte MSP_STATUS Wii versions ;-)
Sebbi
 
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany

Re: Three independent, stick selectable settings in EEPROM

Postby Mis » Sat Oct 06, 2012 7:07 pm

In my opinion if any protocol have lenght field, we should use it. At PC side the serial buffer should have lenght bigger than longest message, and should be first cleared, then we should read "length" bytes from serial port, then parse data from the read buffer. In this way we always get right data or 0 in missing fields.
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Three independent, stick selectable settings in EEPROM

Postby copterrichie » Sat Oct 06, 2012 7:15 pm

Xbee to my present knowledge and I am sure there are other devices that have a limited buffer size.
copterrichie
 
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Three independent, stick selectable settings in EEPROM

Postby jevermeister » Mon Oct 08, 2012 9:21 pm

Hi,
I found a problem,
with the current stick combo, it is impossible to activate inflight calibration (YAWLEFT+ THROTTLE LOW+ PITCH FORWARD+ROLL RIGHT)

Can you try to fix that?

Maybe put it after inflight acc activation.

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

Re: Three independent, stick selectable settings in EEPROM

Postby Hamburger » Mon Oct 08, 2012 9:26 pm

Yes, more specific stick combos must be handled before lesser specific ones.
User avatar
Hamburger
 
Posts: 2553
Joined: Tue Mar 01, 2011 2:14 pm
Location: air

Re: Three independent, stick selectable settings in EEPROM

Postby Pedro14755 » Mon Oct 02, 2017 7:29 am

Hi I know that this is a very old post but I am wondering if this can be implemented in 2.4.

I am using an AlienWii flight controller and would love to be able to select three different profiles like what is currently possible in BetaFlight. I can't let those 32bit guys have all the fun :D

I see that the box marked in the lower right hand side can be adjusted from zero to two - presumably for the three different profiles but the button on the top left will not adjust other than momentarily.

Any details and or help in regard to this would be appreciated Thanks Pedro.
Attachments
MW Profiles.jpg
User avatar
Pedro14755
 
Posts: 42
Joined: Tue Jul 14, 2015 12:56 am
Location: Canberra Australia

Re: Three independent, stick selectable settings in EEPROM

Postby PatrikE » Wed Oct 04, 2017 12:44 pm

It's not active by default In config.h
Just enable and it will work in 2.4.
Code: Select all
  /*************      Support multiple configuration profiles in EEPROM     ************/
    //#define MULTIPLE_CONFIGURATION_PROFILES


https://github.com/multiwii/multiwii-fi ... ig.h#L1012
PatrikE
 
Posts: 1923
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Three independent, stick selectable settings in EEPROM

Postby Pedro14755 » Sun Oct 08, 2017 11:16 am

Thanks for that PatrikE
User avatar
Pedro14755
 
Posts: 42
Joined: Tue Jul 14, 2015 12:56 am
Location: Canberra Australia

Re: Three independent, stick selectable settings in EEPROM

Postby Pedro14755 » Sun Oct 08, 2017 11:50 am

Thanks for that PatrikE. So the only information in the first post of this thread appears to be about accessing stored config settings via stick commands but nothing about how they are actually stored. Would you please be able to elaborate a little so I can have a clearer understanding as I would love to be able to do this :)
User avatar
Pedro14755
 
Posts: 42
Joined: Tue Jul 14, 2015 12:56 am
Location: Canberra Australia


Return to Software development

Who is online

Users browsing this forum: No registered users and 2 guests