gauteh / omb-2024-nano

3 stars 0 forks source link

GPS: power off on EINT #1

Open gauteh opened 6 months ago

gauteh commented 6 months ago
gauteh commented 5 months ago

https://github.com/gauteh/omb-2024-nano/commit/d0eb11eef1c604de9c59426c9b017606099dcb5e

Now sleeping for 1 hour, hope that works. Should it sleep for longer?

jerabaul29 commented 5 months ago

I guess it depends on the GPS measurement frequency you want to use? :)

gauteh commented 5 months ago
gauteh commented 3 months ago

I'm seeing around 24 mA @ 5V when logging IMU. Seems a bit high to me? I guess I will see the low when the IMU is done sampling and it goes to sleep, would be helpful if the IMU sample window could be decreased to e.g. 30 seconds for in the test-mode.

gauteh commented 3 months ago
content: 0x47 | 0x1 | 0x46 | 0x5E | 0x16 | 0xB2 | 0x66 | 0xAB | 0xCF | 0xFD | 0x23 | 0x8E | 0x83 | 0x2D | 0x3 | 0x45 |
Rock7 format content: 4701465E16B266ABCFFD238E832D0345
--------------------
turn gnss off
putting gps to sleep.
Attempting to put gps to sleep
gnss wire started
success starting GNSS
gps sleeping...
gps sleeping.
success.
turn iridium on
turn gnss off
putting gps to sleep.
Attempting to put gps to sleep
gnss wire started
success starting GNSS
gps sleeping...
gps sleeping.
success.
Calling internalBegin
IridiumSBD::beginSerialPort
>> AT
Waiting for response OK
jerabaul29 commented 3 months ago

Yes, this is surprisingly high, these are the values I was getting (from the OMB paper):

Screenshot from 2024-08-06 14-37-16

I.e. with the MCU on in boost mode + the IMU, all the rest off (no power to iridium not to gps), I would expect at most around 8mA (maybe even a bit less, since there was quite a bit of extra stuff on the artemis board).

jerabaul29 commented 3 months ago

can it be that the gps / iridium modem are not really sleeping and taking quite a bit of power?

gauteh commented 3 months ago

Yes, that is what I'm trying to get them to do :)

gauteh commented 3 months ago

Pretty sure it's the GPS, because unplugging the LiIon on the rockblock does not change the current draw.

jerabaul29 commented 3 months ago

you can use the functionality test mode firmware version: https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/main/legacy_firmware/firmware/functionality_test_mode/tracker.ino to do checks that go much faster

it is modified to log the imu only for a short time (you can turn on or off the different test blocks with if (false)):

https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/129916e1e05f97facc37a9b5c94781a2f2e4fec0/legacy_firmware/firmware/functionality_test_mode/tracker.ino#L69-L76

the change is to hard code taking just a few imu measurements:

https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/129916e1e05f97facc37a9b5c94781a2f2e4fec0/legacy_firmware/firmware/functionality_test_mode/wave_analyzer.cpp#L62

gauteh commented 3 months ago

Relevant code is here: https://github.com/gauteh/omb-2024-nano/blob/main/src/gnss_manager.cpp#L7

gauteh commented 3 months ago

the change is to hard code taking just a few imu measurements:

https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/129916e1e05f97facc37a9b5c94781a2f2e4fec0/legacy_firmware/firmware/functionality_test_mode/wave_analyzer.cpp#L62

Thanks, I have to do this, since lots of ports and pins are changed from original OMB.

jerabaul29 commented 3 months ago

ok - not sure how well the sleep gnss call works, since on the OMB I just "brutally" turn the GNSS on and off by using the provided mosfet - so I never really had a need for checking if / how well the gnss sleep mode works

jerabaul29 commented 3 months ago

curious: if you unplug both the gnss and the iridiu, do you get down when logging the imu to O(8mA) at most? :)

gauteh commented 3 months ago

Can't unplug the GNSS, its mounted on board.

gauteh commented 3 months ago

Are the measurements above with the power led on? I'm at 19-20 mA when the IMU is logging now.

jerabaul29 commented 3 months ago

the measurements above should be with no LEDs

jerabaul29 commented 3 months ago

this may be a bit more hacky, but do you have the possibility to cut the GNSS power track "just for now" and put a jumper back on it for later on, to test if it is the GNSS using power?

jerabaul29 commented 3 months ago

btw, you mention that you are @ 5V - the values I give were @ 3.3 V

gauteh commented 3 months ago

I think that will destroy the board, I should probably just try this: https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/blob/main/examples/Example22_PowerOff/Example22_PowerOff.ino

jerabaul29 commented 3 months ago

ok! :)

one more thing: can it be a power leak somewhere else? some floating / non floating pins on the MCU, other cross talks etc? I would expect that these effects show up only when going to the uA domain, but never know. the OMB has quite a few of these "dark magics settings" set up in

https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/129916e1e05f97facc37a9b5c94781a2f2e4fec0/legacy_firmware/firmware/functionality_test_mode/board_control.cpp#L24-L36

and is setting quite a few of these (just copied from SF examples) before sleeping

https://github.com/jerabaul29/OpenMetBuoy-v2021a/blob/129916e1e05f97facc37a9b5c94781a2f2e4fec0/legacy_firmware/firmware/functionality_test_mode/sleep_manager.cpp#L90-L109

gauteh commented 3 months ago

Yes, good point. I can remove the Artemis to test that. There are also some broken artemises, that use much more power.

jerabaul29 commented 3 months ago

can it also be the intrinsic power consumption of the artemis? (you use a nano right? :) ) I do not know how you measure the power draw and if for example the consumption you measure includes the serial to usb converter, if the microphone is off (but that should be quite little power), if there are leds, etc? :)

gauteh commented 3 months ago
gauteh commented 2 months ago

If this dosen't work we need to add some on/off circuit.

jerabaul29 commented 2 months ago

Ok! Yes, SF uses a simple mosfet, it should be possible to just copy their setup :) .

gauteh commented 2 months ago

Maybe @zerblatt007 has the chance to help us set up the MOSFET circuit, here's the schematic from SparkFun: https://cdn.sparkfun.com/assets/f/4/5/3/4/SparkFun_Artemis_Global_Tracker_SCHEMATIC_v10.pdf ?

zerblatt007 commented 2 months ago

GPS power switch should be easy enough.. :)

On 29 Aug 2024, at 09:24, Gaute Hope @.***> wrote:

Maybe @zerblatt007 https://github.com/zerblatt007 has the chance to help us set up the MOSFET circuit, here's the schematic from SparkFun: https://cdn.sparkfun.com/assets/f/4/5/3/4/SparkFun_Artemis_Global_Tracker_SCHEMATIC_v10.pdf ?

— Reply to this email directly, view it on GitHub https://github.com/gauteh/omb-2024-nano/issues/1#issuecomment-2316894486, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSMTNYLTT5VAT2Y6HHL6RTZT3EEHAVCNFSM6AAAAABIFVK7D6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJWHA4TINBYGY. You are receiving this because you were mentioned.

zerblatt007 commented 2 months ago

I have inserted the Q1 FET on A16 and updated the PCB, just to see how things pan out. This is just more or less dumped on there, so check if it looks ok to you.. There was a new R5 also? And an extra BAT2 ..

fre. 30. aug. 2024 kl. 08:43 skrev Roger Storvik @.***>:

GPS power switch should be easy enough.. :)

On 29 Aug 2024, at 09:24, Gaute Hope @.***> wrote:

Maybe @zerblatt007 https://github.com/zerblatt007 has the chance to help us set up the MOSFET circuit, here's the schematic from SparkFun: https://cdn.sparkfun.com/assets/f/4/5/3/4/SparkFun_Artemis_Global_Tracker_SCHEMATIC_v10.pdf ?

— Reply to this email directly, view it on GitHub https://github.com/gauteh/omb-2024-nano/issues/1#issuecomment-2316894486, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSMTNYLTT5VAT2Y6HHL6RTZT3EEHAVCNFSM6AAAAABIFVK7D6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJWHA4TINBYGY . You are receiving this because you were mentioned.Message ID: @.***>

gauteh commented 2 months ago

Nice. Adding the artemis module directly (with USB to serial) would be next on the wishlist ! (should have a JTAG header holes just in case as well).