darksidelemm / RS41HUP

RS41HUP - Firmware for Vaisala's RS41 for Amateur Radio use
GNU General Public License v2.0
21 stars 9 forks source link

GPS returns to unstable state ? #3

Closed zanco closed 3 years ago

zanco commented 3 years ago

Hi, we have been running experiments with the RS41 board on solar and direct battery power. Connected directly to the board and skipping the power button which is out of reach when the unit is flying. In the early days of the CR123 battery powered flights I noticed every now and then that there was something strange when soldering the wire to the battery, if lucky you got GPS fix in 2 minutes, if unlucky you only would get zero's for time and GPS data.

Adding a small header with jumper to re-power the tracker often solved that.

Later on, trying to run on solar power, something like that also happened. Wiring a reset chip to the reset of the uP which pulls the reset low if the Vin < 2.93 V worked nicely, the tracker got to "halt" status is the power dropped and started again nicely if the voltage got > 2.93 Volt, but when it restarted also the GPS only gave zero's, for over an hour in full sun and good view of the GPS satellites.

Creating shadow and having the tracker starting again sometimes fixed that.

PE1MJA did some investigation on an unmodified tracker and noticed that the reset for the GPS comes from pin 38 on the processor, "PA15" , after powering on the original state RS41 the GPS reset is switched to "high" and stays high, but on the re-programmed tracker the GPS reset switches to high for a short time and appears to be "undefined" after that. We call it undefined because pointing to the contact with the wire from the multimeter has influence on the state.

Wiring the reset pin for the GPS to + with 10 K and hard wiring to the reset at the uP does appear to work all ok but I would prefer a software fix if that is possible.

ED6E0F17 commented 3 years ago

The documentation I have shows that the Ublox 6 has an internal pull-up, and the RS41 has an external pull-up, so I suspect that Vaisala are only forcing the pin high because they want to pull it low first.

It is sensible to use a hardware reset now that you have identified the right pin. Can you tell if this does anything:

https://github.com/ED6E0F17/RS41HUP/commit/182694b91b2ed63458616b65ab48fbfa8191ac89

darksidelemm commented 3 years ago

I've merged these particular changes into https://github.com/darksidelemm/RS41HUP/tree/gps_fixes so you're not testing a lot of other changes at the same time.

@zanco if you run 'git checkout gps_fixes' on your working dir, update the config file, and try building and running that branch, that would be appreciated.

zanco commented 3 years ago

Hi, thanks for you support! Downloaded the zip on Windows. edited the config file and started playing around.

So far, very good. Restarted the RS41 8 times so far, powered directly on MCU_V+ en had 8 out of 8 GPS fix (behind HR++ double glass) within 2 minutes. As a matter of fact, if you see the time in the telemetry string jump from 00:00:00 to 23:59:55 that is a sign that there is communication and the GPS will lock . I deleiberatly bounced the V+ or V- connection multiple times and no problem at all so far.

I will repeat the test another 15 times tonight. If 25 out of 25 do succeed I would call this a good solution !

Might have no actual sun this week to test

( 9 out of 9 now....)

zanco commented 3 years ago

25 out of 25 succesfulll :-)

Had to test one with the "old firmware" and managed to get lock 2 out of 5 times and zeroes 3 out of 5 times.

PE1MJA will test te same in daylight with 7 monster solar panels

73 Ben

ED6E0F17 commented 3 years ago

I have never had to remap pins on stm32, so I missed a step. PA15 should be power-on reset to a JTAG pin, so I think it is luck that it gets remapped by some other part of the code.. Happy that it is working.

darksidelemm commented 3 years ago

@ED6E0F17 I've done some testing with this, and it looks like with the current code it's not actually resetting the GPS. I lengthened the delay here ( https://github.com/darksidelemm/RS41HUP/blob/master/init.c#L109 , and added another delay at the start of the function ) and looked at the V_RESET pin on the GPS with a multimeter, and didn't see it change at all during power-up. Any ideas? (I noticed your additions of a GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE); / Disable entry, it didn't seem to make any difference for me)