Maker Pro
Maker Pro

GPS NMEA, Failover Circuit upgrade attempt.

The GPS's are capable of delivering up to 7 (i think) NMEA sentences and i can choose between it's database which i want and how many i want, up to 7. So for testing i may just deactivate the rest of them and leave only GSA
 
But can an old dog teach himself new tricks ?

Of course ;) its called brain plasticity

So there will be no need to sample GPS output's to serin picaxe pin ?

That's right we can use any pin. I think we need a small signal diode if we use a different pin. Like shown below.

picaxedidoe.png


However I'm not sure if this only applies to 08M picaxe.
 
Last edited:
I've been looking at all the samples you've given, too see whats common in every $GPGSA sentence with no signal, compared to the ones that all work.

I
GPS_3_D_Fix.png


It seems every working $GPGSA sentence which we can use, seem to have a number 3.
Those with no signal, or missing data which we cannot use, seem to have either a 1 or 2.

We can reliably use IF Statements to check each $GPGSA sentence as it comes in. If its a 1 we can mark that GPS as no signal. If its a 2 we can ignore it since there is data missing. If its a 3 we will check and compare DOP.

We can guarantee that the sentence will contain a 1,2 or 3.
 

Attachments

  • GPS WITH SIGNAL.txt
    5 KB · Views: 123
  • GPS NO SIGNAL.txt
    3.3 KB · Views: 112
Last edited:
It seems every working $GPGSA sentence which we can use, seem to have a number 3.
Those with no signal, or missing data which we cannot use, seem to have either a 1 or 2.
True and that will really make our work easyer.

We can reliably use IF Statements to check each $GPGSA sentence as it comes in. If its a 1 we can mark that GPS as no signal. If its a 2 we can ignore it since there is data missing. If its a 3 we will check and compare DOP.

Also true. The only thing concerns me is that some times one GSA comes 1 or 2 and then 1 second later it comes 3 and we have good sentence. the picaxe programm will have to be adjusted so it will only change the outputs state if 2 or 3 sentences are bad (1 or 2)
 
Yeah, I understand what you mean. You can create a variable which you can keep in the range of 0-3. Increment when there is a bad sentence, decrement when there is a good sentence.

If the variable reaches three, the necessary action is taken.
 
I've started writing some code, although I do not know how to create a variable for the following:

GPS1_Signal
GPS1_Data
GPS2_Signal
GPS2_Data

The program reads each GPS serial input, each number/comma/dot data is dumped into b0, since they are not used.

b1 contains our 1,2 or 3 value for GPS1
b6 contains our 1,2 or 3 value for GPS2

b2,b3,b4,b5 contains the DOP value for GPS1
b7,b8,b9,b10 contains the DOP value for GPS2

Once a sample of the sentence has been read and dumped into each b(n), the program then checks whether the sentence includes a 1,2 or 3 for each GPS. Then the GPS_Signal and GPS_Data is set, which tells us whether there is no signal or if there is bad data.

This is actually my first written code for a picaxe chip.. so bare with me. I need help create a variable for the signal & data.
 

Attachments

  • GPS.txt
    1.4 KB · Views: 124
In this one i have set the gps to run a simulation (as if i was really moving).
 

Attachments

  • LOG9 SIMULATION.txt
    22.3 KB · Views: 111
There's only one other sentence pattern which could go through and give us bad data:

$GPGSA,A,3,19,30,20,13,,,,,

If this sentence is received b0 will not read ',' and we can filter this out using an IF statement.


I've managed to simulate SERIN and parse the data as hoped.

SERIN_Simulation.png
 
Last edited:
Dear friend i must confess that i dont understand a thing from the picture above ! :p

That's okay :D just understand that the GPSA sentence is being read properly by the picaxe, nd I can parse the sentence to read what we need.

I'm not the best teacher and cannot explain things well. Otherwise I'd help you understand abit more whats going on with the code.


At this point, if were able to read the GPSA sentence I can see us making this work.. unless the hardware is wrong.
 
After it is complete i will field test it many, many times before i put it to use so we should be ok.

About Fieldtesting it now the problem i will face is that i will have no way of actually monitoring the DOP of each GPS to check that Picaxe is working ok.

On other thing that worrys me is that if DOP value changes too fast then picaxe will switch the relay too fast and that will not be good.

Ho and something else that poped in my mind. There will have to be an other rule in the program that if DOP of both GPS's is the same then output must go higi or low.....
 
About Fieldtesting it now the problem i will face is that i will have no way of actually monitoring the DOP of each GPS to check that Picaxe is working ok.

I'm not sure how to go about this.

On other thing that worrys me is that if DOP value changes too fast then picaxe will switch the relay too fast and that will not be good.

A delay can be put into the program while comparing the DOP values and switching the relay. To limit the relay switching time between each DOP check.

However the DOP check is just one part of the program that switches the relays:
1.The program first checks there is signal coming from each GPS (With a filter of 3 bad sentences to filter anomalies). If there is no signal from a GPS after 3 bad sentences the relay or buzzer will switch accordingly.
2.The program then checks the data is correct and nothing is missing
3.If both GPS are active and data ok.. DOP values are checked.
4.Loop back to 1

So shall I put a delay during DOP check.. or put a delay in the whole program loop?


Ho and something else that poped in my mind. There will have to be an other rule in the program that if DOP of both GPS's is the same then output must go higi or low.....

I thought about this and created a default GPS if both DOP's were the same value. But then I changed it back.. if both DOP's are the same then its best to leave the relay in its current state and limit switching rather than keep switching back to default every time. Like you said switching the relay more than necessary is bad.
 
Looking back at post #3 i notice the negative pulses.
Can they harm the picaxe chip ?
What do you think ?

The enhanced serial cable uses a diode on Serin that grounds negative pulses from the PC to picaxe but the standard serial cable does not.
 
Top