- 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
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
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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
}
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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 |
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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];
}
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
PROTOCOL_SetPower() which can be modeled off of the PROTOCOL_Bind() function.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.
Please Log in or Create an account to join the conversation.
- sbstnp
- Offline
- Posts: 649
Devo 10 + 4in1
FrSky Taranis + TBS Crossfire
Please Log in or Create an account to join the conversation.
- suvsuv
- Topic Author
- Offline
- Posts: 268
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.
- Forum
- News, Announcements and Feedback
- Feedback & Questions
- PB, check out this interesting battery consumption
- Home
- Forum
- News, Announcements and Feedback
- Feedback & Questions
- PB, check out this interesting battery consumption