- Posts: 268
- Forum
- News, Announcements and Feedback
- Feedback & Questions
- PB, check out this interesting battery consumption
PB, check out this interesting battery consumption
- suvsuv
-
Topic Author
- Offline
Less
More
03 Nov 2012 15:57 - 03 Nov 2012 16:02 #2630
by suvsuv
PB, check out this interesting battery consumption was created 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
So our current deviation10 consumes 30% - 50% more than Walkera's factory firmware, which cause the TX reach battery alarm very soon
By using a multimeter series connecting to a devo10 and its battery, I got the following test data
| tx power | current deviation(Backlight 1) | factory firmware(Backlight off) |
| 150mw | 195mA | n/a |
| 100mw(20db) | 181mA | 143mA |
| 30mw(15db) | 166mA | 131mA |
| 10mw(10db) | 160mA | 117mA |
| 3mw(5db) | 157mA | 109mA |
| 1mw(0db) | 156mA | 108mA |
| 300uw(-5db) | 154mA | 106mA |
| 100uw | 155mA | n/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.
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
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.
- suvsuv
-
Topic Author
- Offline
Less
More
- Posts: 268
03 Nov 2012 16:10 - 03 Nov 2012 16:30 #2633
by suvsuv
Replied by suvsuv on topic PB, check out this interesting battery consumption
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
}
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.
- suvsuv
-
Topic Author
- Offline
Less
More
- Posts: 268
03 Nov 2012 16:13 #2634
by suvsuv
Replied by suvsuv on topic PB, check out this interesting battery consumption
Now the test result is just satisfied
| tx power | codes with new scanning frequency(Backlight 1) | factory firmware(Backlight off) |
| 150mw | 152mA | n/a |
| 100mw(20db) | 138mA | 143mA |
| 30mw(15db) | 124mA | 131mA |
| 10mw(10db) | 116mA | 117mA |
| 3mw(5db) | 113mA | 109mA |
| 1mw(0db) | 111.7mA | 108mA |
| 300uw(-5db) | 111.0mA | 106mA |
| 100uw | 111.8mA | n/a |
- suvsuv
-
Topic Author
- Offline
Less
More
- Posts: 268
03 Nov 2012 16:13 - 03 Nov 2012 16:19 #2635
by suvsuv
Replied by suvsuv on topic PB, check out this interesting battery consumption
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];
}
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.
- suvsuv
-
Topic Author
- Offline
Less
More
- Posts: 268
03 Nov 2012 16:25 #2638
by suvsuv
Replied by suvsuv on topic PB, check out this interesting battery consumption
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.
After figuring out and solving above battery issue, we are more closer to Beta version now
| tx power | before binding | after binding |
| 10mw | 116mA | 124 |
| 100mw(20db) | 138mA | 180mA |
After figuring out and solving above battery issue, we are more closer to Beta version now
- suvsuv
-
Topic Author
- Offline
Less
More
- Posts: 268
03 Nov 2012 16:44 #2640
by suvsuv
Replied by suvsuv on topic PB, check out this interesting battery consumption
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
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
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.
PROTOCOL_SetPower() which can be modeled off of the PROTOCOL_Bind() function.
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
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.
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.
- suvsuv
-
Topic Author
- Offline
Less
More
- Posts: 268
03 Nov 2012 23:51 - 04 Nov 2012 00:08 #2660
by suvsuv
Replied by suvsuv on topic PB, check out this interesting battery consumption
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
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.
- suvsuv
-
Topic Author
- Offline
Less
More
- Posts: 268
04 Nov 2012 00:03 #2661
by suvsuv
Replied by suvsuv on topic PB, check out this interesting battery consumption
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.
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
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.
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.
- sbstnp
-
- Offline
Less
More
- Posts: 649
04 Nov 2012 04:29 #2664
by sbstnp
Devo 10 + 4in1
Spektrum Dx9
FrSky Taranis + TBS Crossfire
Replied by sbstnp on topic PB, check out this interesting battery consumption
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
FrSky Taranis + TBS Crossfire
- suvsuv
-
Topic Author
- Offline
Less
More
- Posts: 268
04 Nov 2012 14:25 #2673
by suvsuv
Replied by suvsuv on topic PB, check out this interesting battery consumption
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
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
- Forum
- News, Announcements and Feedback
- Feedback & Questions
- PB, check out this interesting battery consumption
Time to create page: 0.283 seconds
-
Home
-
Forum
-
News, Announcements and Feedback
-
Feedback & Questions
- PB, check out this interesting battery consumption