Page 1 of 1

Three independent, stick selectable settings in EEPROM

Posted: Fri Sep 28, 2012 9:50 pm
by Mis
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 :)

Re: Three independent, stick selectable settings in EEPROM

Posted: Fri Sep 28, 2012 9:58 pm
by jevermeister
Excellent idea!Good way to implement it with the stick combos.

Nils

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 29, 2012 9:26 am
by Danal
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 29, 2012 1:47 pm
by Mis
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 29, 2012 2:59 pm
by Hamburger
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 29, 2012 3:08 pm
by howardhb
+1 ! Awesome!

Name them "Flight mode" as in heli setups?

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 29, 2012 3:29 pm
by Hamburger
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?

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 29, 2012 5:46 pm
by Mis
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 29, 2012 8:06 pm
by jevermeister
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?

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 29, 2012 10:06 pm
by Mis
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sun Sep 30, 2012 12:47 am
by jevermeister
Being unable to arm is very good. I killed a couple of props by forgetting to calibrate ;-)

Re: Three independent, stick selectable settings in EEPROM

Posted: Sun Sep 30, 2012 6:35 pm
by Alexinparis
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

Re: Three independent, stick selectable settings in EEPROM

Posted: Sun Sep 30, 2012 9:16 pm
by Mis
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sun Sep 30, 2012 9:17 pm
by jevermeister
Yeah! I like where this is goong. Another very important and handy feature added.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sun Sep 30, 2012 11:14 pm
by Mis
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Mon Oct 01, 2012 8:33 am
by Hamburger
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 12:51 am
by Mis
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 8:07 am
by jevermeister
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?

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 10:35 am
by Danal
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

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 2:41 pm
by copterrichie
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

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 5:11 pm
by Alexinparis
I had some time this afternoon, and did the mod ;)

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 5:16 pm
by timecop
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

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 5:29 pm
by Alexinparis
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 5:43 pm
by Sebbi
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?

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 5:48 pm
by jevermeister
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

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 6:16 pm
by Alexinparis
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

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 6:31 pm
by Sebbi
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 ;-)

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 7:07 pm
by Mis
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Oct 06, 2012 7:15 pm
by copterrichie
Xbee to my present knowledge and I am sure there are other devices that have a limited buffer size.

Re: Three independent, stick selectable settings in EEPROM

Posted: Mon Oct 08, 2012 9:21 pm
by jevermeister
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

Re: Three independent, stick selectable settings in EEPROM

Posted: Mon Oct 08, 2012 9:26 pm
by Hamburger
Yes, more specific stick combos must be handled before lesser specific ones.

Re: Three independent, stick selectable settings in EEPROM

Posted: Mon Oct 02, 2017 7:29 am
by Pedro14755
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.

Re: Three independent, stick selectable settings in EEPROM

Posted: Wed Oct 04, 2017 12:44 pm
by PatrikE
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

Re: Three independent, stick selectable settings in EEPROM

Posted: Sun Oct 08, 2017 11:16 am
by Pedro14755
Thanks for that PatrikE

Re: Three independent, stick selectable settings in EEPROM

Posted: Sun Oct 08, 2017 11:50 am
by Pedro14755
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 :)

Re: Three independent, stick selectable settings in EEPROM

Posted: Sun Jun 10, 2018 10:34 am
by Pedro14755
So a friend of mine who is delving into some MultiWii development looked into the code and was able to show me how to store and then access these setting. I made these quick videos on how to do it in case anyone in the future wants to implement this feature in MultiWii. I apologise for the video standard but I did the best that I could with what I have available and the information is solid. Thanks again to all those who have contributed to MultiWii and of course to Alex for starting this whole quadcopter revolution. Here are links to the two videos.

https://www.youtube.com/watch?v=r0S81XXpqJs

https://www.youtube.com/watch?v=xBZZM15O5zI

Re: Three independent, stick selectable settings in EEPROM

Posted: Sat Sep 08, 2018 5:40 am
by RCvertt
Thank for posting that info Pedo. Very helpful.