PB, check out this interesting battery consumption

More
03 Nov 2012 15:57 - 03 Nov 2012 16:02 #2630 by suvsuv
As I mentioned in another thread, current deviation 10's battery consumption is confirmed to be too high after comprehensive test, due to the scanning frequency in the main event loop .

By using a multimeter series connecting to a devo10 and its battery, I got the following test data
tx powercurrent deviation(Backlight 1)factory firmware(Backlight off)
150mw195mAn/a
100mw(20db)181mA143mA
30mw(15db)166mA131mA
10mw(10db)160mA117mA
3mw(5db)157mA109mA
1mw(0db)156mA108mA
300uw(-5db)154mA106mA
100uw155mAn/a

So our current deviation10 consumes 30% - 50% more than Walkera's factory firmware, which cause the TX reach battery alarm very soon
Last edit: 03 Nov 2012 16:02 by suvsuv.

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 16:06 #2632 by PhracturedBlue
Replied by PhracturedBlue on topic PB, check out this interesting battery consumption
yes, there are several things that can be done to lower battery consumption. I haven't started to look at it yet. I can get a couple of hours from my devo8 running deviation, and I'd expect the devo10 to get significantly more. I will eventually start to look at it, but probably not until the next release is out.

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 16:10 - 03 Nov 2012 16:30 #2633 by suvsuv
Since entering the most complicated page, e.g. the Complex template page,shows the TX consumes the same power as in the main page. So I believe the main event loop relates to the battery performance. By tweaking codes in the EventLoop() for many times, I found that commenting out any 1 of the statement inside the block of "if (CLOCK_getms() > next_redraw) { " will reduce the power consumption a lot, even lower than Walkera's FW. (no timer on, no binding dialog/safety warning dialog showing, so these statement are just some if-else checking)
I finally figured out that we can't finish all these checking within the period of 200ms --SCREEN_UPDATE_MSEC.

As I don't believe we need to check timer, battery alarm and Telemetry alram so frequent, I change these 3 scanning method to frequency of 1 seconds, codes are as follows:
if (CLOCK_getms() > next_scan) {
MIXER_CalcChannels();
BUTTON_Handler();
TOUCH_Handler();
PAGE_Event();
next_scan = CLOCK_getms() + CHAN_UPDATE_MSEC; //5ms
}

if (CLOCK_getms() > next_redraw) {
GUI_RefreshScreen();
TIMER_Update();
next_redraw = CLOCK_getms() + SCREEN_UPDATE_MSEC; // 200ms
}

if (CLOCK_getms() > next_lowprijobs) {
PROTOCOL_CheckDialogs();
TELEMETRY_Alarm();
BATTERY_Check();
next_lowprijobs = CLOCK_getms() + LOW_PRI_UPDATE_MSEC; // 1 second
}
Last edit: 03 Nov 2012 16:30 by suvsuv.

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 16:13 #2634 by suvsuv
Now the test result is just satisfied :evil:
tx powercodes with new scanning frequency(Backlight 1)factory firmware(Backlight off)
150mw152mAn/a
100mw(20db)138mA143mA
30mw(15db)124mA131mA
10mw(10db)116mA117mA
3mw(5db)113mA109mA
1mw(0db)111.7mA108mA
300uw(-5db)111.0mA106mA
100uw111.8mAn/a

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 16:13 - 03 Nov 2012 16:19 #2635 by suvsuv
The current power consumption is about 10mA lower than Walkera's - Walkera's data is measured when backlight is off while Deviation's data is measure by setting backlight 0, If I turn of the backlight in deviation's ,will minus 8-10mA consumption.

Another issue is there is no TX power changing on the fly. the TX power setting takes effect only after rebooting or rebinding. So I add the following codes to provide TX power changing on the fly.

There is some minor side-effect: if changing the TX power too quick, the TX might reboot from time to time. The work-around is to add a save button to slow down the TX changing. However, I would like PB to help figure out if calling "CYRF_WriteRegister(CYRF_03_TX_CFG, 0x08 | Model.tx_power)" is not the bets way

static const char *powerselect_cb(guiObject_t *obj, int dir, void *data)
{
(void)data;
(void)obj;
u8 changed;
Model.tx_power = GUI_TextSelectHelper(Model.tx_power, TXPOWER_100uW, TXPOWER_LAST-1, dir, 1, 1, &changed);
if (changed) {
switch(Model.protocol) { // if changed to quick ,the TX will reboot, need to add some codes to slow down changing actions
case PROTOCOL_DEVO:
CYRF_WriteRegister(CYRF_03_TX_CFG, 0x08 | Model.tx_power);
break;
case PROTOCOL_WK2801:
case PROTOCOL_WK2601:
case PROTOCOL_WK2401:
CYRF_WriteRegister(CYRF_03_TX_CFG, 0x28 | Model.tx_power);
break;
case PROTOCOL_DSM2:
CYRF_WriteRegister(CYRF_03_TX_CFG, 0x08 | Model.tx_power);
CYRF_WriteRegister(CYRF_03_TX_CFG, 0x28 | Model.tx_power);
break;
case PROTOCOL_J6PRO:
CYRF_SetPower(Model.tx_power);
break;
default:
break;
}
}
return RADIO_TX_POWER_VAL[Model.tx_power];
}
Last edit: 03 Nov 2012 16:19 by suvsuv.

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 16:25 #2638 by suvsuv
Another minor issue is that the power consumption will rise and won't get back down after binding, so it is better to warn user to reboot the TX after binding, even though the TX can change protocol on-the-fly.
tx powerbefore bindingafter binding
10mw116mA124
100mw(20db)138mA180mA

After figuring out and solving above battery issue, we are more closer to Beta version now B)

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 16:44 #2640 by suvsuv
I believe the current binding need to improve as using DEVO protocol without fixed ID consumes more battery, which is not good. We need to figure out why current doesn't drop back after binding is finishedl

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 18:05 #2649 by PhracturedBlue
Replied by PhracturedBlue on topic PB, check out this interesting battery consumption
If you want to update the tx power output, you should define a new function:
PROTOCOL_SetPower() which can be modeled off of the PROTOCOL_Bind() function.

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 18:15 #2650 by PhracturedBlue
Replied by PhracturedBlue on topic PB, check out this interesting battery consumption
You are putting the cart before the horse.
The current refresh rate of 10/sec should not cause significantly different performance than a rate of 5/sec unless the calculations take so long (in a non-update scenario) that there is no downtime between the loops. If that is the case, we need to fix that, rather than slowing down the update frequency, as it implies we will not get consistent channel updates.

So I don't want to fix the issues by slowing down the update rate, but instead understand where the bottlenecks are, and work on those instead. If we need to reduce the update rate later, so be it, but it is too early to make such changes.

The underlying requirement is that channel inputs are processed at a consistent rate. If the display code is getting in the way of that, then the channel processing code needs to be handled via an interrupt.

Please Log in or Create an account to join the conversation.

More
03 Nov 2012 23:51 - 04 Nov 2012 00:08 #2660 by suvsuv
I don't agree with you. The more frequent tasks(even just some if-else checking) run, the more battery consumes. The only way to reduce power consumption is to reduce task-running frequency for low priority jobs.
Above codes didn't change channel updating frequency(still once per 5ms ) and GUI refresh rate(once per 200ms). They just do less scanning of protocol dialog, battery and telemetry scanning, which are just low-priority and unnecessary Think about that, even if I remove these scanning of alarms,it won't affect flying of helis or planes.
And the current scanning ration of battery and telemetry is 1ms, which is even too fast to for battery and telemetry alarm.

In terms of Protocol dialog checking , I don't really understand why we need to check it all the time. In my previous , I would rater check the binding only during power-on(no fixed id) or when the binding button is pressed.

Anyway, this is a high-pri bug, as the TX can't run for half an hour if the TX power is set to above 30mw, very bad user-experience. I will test these codes for more flights
Last edit: 04 Nov 2012 00:08 by suvsuv.

Please Log in or Create an account to join the conversation.

More
04 Nov 2012 00:03 #2661 by suvsuv
And furthermore, I would suggest removing safety checking from the main loop. This checking should be event-driven instead of polling all the time. We just need to check safety setting in 3 senario: power-on,binding and loading new model.

Please Log in or Create an account to join the conversation.

More
04 Nov 2012 00:15 - 04 Nov 2012 00:16 #2662 by PhracturedBlue
Replied by PhracturedBlue on topic PB, check out this interesting battery consumption
It is very odd that you only get 30mins on a Devo10. the Devo8 should use a lot more power, and at least mine lasts a lot longer than that. the devo10 has twice the voltage of the devo8, so should get a a lot more life.

1st, current update is 100msec, not 200 so you've slowed down screen update.
2nd the alarms and timer are updated every 100msec which, given how little they do, should not cause any significant power draw

The processor runs at 72MHZ, so it can do several million operations between the 100msec tick. If we are really doing so much that this is a busy loop, then the code itself neds to be reworked. Reducing these values from 100msec to 1sec should not have an issue, and if it does, it indicates bigger problems.
In the current code, nothing runs on 1msec. the channels, buttons, and touch are rescanned on 5msec interval. the page event is also done on a 5msec interval. That last may not be a good idea, actually.
The timer, dialog, alarm, and battery are all done on 100msec interval.


Edit:
Even at 200mA, you should be getting 10hours on 2000maH batteries. Something else must be wrong.
Last edit: 04 Nov 2012 00:16 by PhracturedBlue.

Please Log in or Create an account to join the conversation.

More
04 Nov 2012 04:29 #2664 by sbstnp
I have a 2500mah LiPo in my Devo10, and after running for 2 hours at 10mw yesterday doing sim and Mini Cp, voltage dropped from 11.73 to 11.50 volts.

Devo 10 + 4in1
Spektrum Dx9
FrSky Taranis + TBS Crossfire

Please Log in or Create an account to join the conversation.

More
04 Nov 2012 14:25 #2673 by suvsuv
Today I flew both Mcpx and Minicp using the codes with modified main loop, everything is fine and the battery consumes much less than yesterday.

What I am working on is about binding: I got 2 different results for a DEVO model without fixed-id:
1) Power on, let the autobinding finished, current: 116mA(10mw) - normal result
2) Power on, stop the autobinding before it is finished, current: 158mA(10mw) - abnormal result
if pressing binding in the model page, I got the same result as #2, regardless the binding is finished or stopped.

So there should be a bug inside the binding logic

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum