GPS NMEA antenna aiming tracker.

Thread Starter

camerart

Joined Feb 25, 2013
3,840
hi,
Is there really a 'space' character after the first 2 digits of the altitude.???
E
Hi E,

The examples you have pointed out, were in a section of poor reception (The GPS/Notebook was on my passenger seat, so not best), it could be a glytch in the writing of the sentence. The length of the sentence did keep indenting.

This is the first time I've tried this sort of test. Once I get better at interpreting the results, I'll send more.

C.
 

ericgibbs

Joined Jan 29, 2010
21,459
This is the first time I've tried this sort of test. Once I get better at interpreting the results, I'll send more.
OK,
The latest program is almost complete, it works with any parameter length.
I will use your posted messages for a test.
E

EDIT
:
Have you deleted this section from the messages.?
$GPGGA

EDIT:
This is a Sim output using your messages, I have added a routine to strip out unwanted Spaces. [I have added the $GPGGA header to the messages.]
The Lat/Lon and Alt are Oshonsoft FP number values.
 

Attachments

Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,840
OK,
The latest program is almost complete, it works with any parameter length.
I will use your posted messages for a test.
E

EDIT
:
Have you deleted this section from the messages.?
$GPGGA

EDIT:
This is a Sim output using your messages, I have added a routine to strip out unwanted Spaces. [I have added the $GPGGA header to the messages.]
The Lat/Lon and Alt are Oshonsoft FP number values.
Hi E,

If you would like some worst case 'sentences' from today here are some more:
,105320.00,5039.01828,N,00205.85097,W,1,04,2.02,83.2,M,47.8,M,

,105321.00,5039.02600,N,00205.85469,W,1,05,1.85,83.1,M,47.8,M,

,105322.00,,,,,0,04,16.16,,,,,,*65
$GPGSA,A,1,24,17,14,12,,,,

,105323.00,5039.04043,N,00205.86663,W,1,05,1.85,83.0,M,47.8,M,

,105324.00,5039.04782,N,00205.86804,W,1,06,1.85,83.0,M,47.8,M,

,105325.00,5039.05458,N,00205.87066,W,1,05,5.41,82.9,M,47.8,M,

,105326.00,5039.06203,N,00205.87279,W,1,04,5.40,82.8,M,47.8,M,

,105327.00,,,,,0,00,99.99,,,,,,*64
$GPGSA,A,1,,,,,,,,,,,,,99.

,105328.00,5039.07945,N,00205.87516,W,1,04,5.40,82.7,M,47.8,M,

,105329.00,5039.08754,N,00205.87839,W,1,04,5.39,82.5,M,47.8,M,

,105330.00,5039.09687,N,00205.88035,W,1,04,5.39,82.5,M,47.8,M,

,105331.00,,,,,0,00,99.99,,,,,,*63
$GPGSA,A,1,,,,,,,,,,,,,99.

,105332.00,,,,,0,00,99.99,,,,,,*60
$GPGSA,A,1,,,,,,,,,,,,,99.

,105333.00,,,,,0,00,99.99,,,,,,*61
$GPGSA,A,1,,,,,,,,,,,,,99.

,105334.00,,,,,0,00,99.99,,,,,,*66
$GPGSA,A,1,,,,,,,,,,,,,99.

I have the GPS connected to the circuit RX with a little routine on the PIC that extracts the $GPGGA data from the other 'sentence' types, and strips the $GPGGA off, then only gives readings, then the TX is connected to putty logging the data. For some reason the $GPGSA is shown, this is the next 'sentence' after GGA.

C
 

THE_RB

Joined Feb 11, 2008
5,438
That's because your code always outputs X chars total.

After detecting the $GPGGA tag, you should only output chars until the next $ which is always the start of the next data block. The number of chars will vary depending on what the coords are and if the receptions drops out (which gives you blank data fields).
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
That's because your code always outputs X chars total.

After detecting the $GPGGA tag, you should only output chars until the next $ which is always the start of the next data block. The number of chars will vary depending on what the coords are and if the receptions drops out (which gives you blank data fields).
Here's the program I'm using for parsing:

C
 

Attachments

ericgibbs

Joined Jan 29, 2010
21,459
hi C,
In your Neo logging program, why are you initialising the PIC's hardware PORTC.6 and then using the Serin command, a software driven port to read the Data, instead of Hserin the hardware UART.??

Also your RXD receive buffer is only 42 bytes long, when the message can be as long as 74 bytes, even when you skip the header string $GPGGS, the message can still be 68 characters.??

Using this program will give you confusing fragmented GPS messages.:)

Rich (BB code):
Dim gga(42) As Byte '''you have a 43 byte long RXD array

For x = 1 To 62 
Serin PORTC.7, 9600, gga(x) ''' and you are trying to put 62 bytes into the RXD array
Next x

'Hserout CrLf, "62 characters saved after start code GGA follow", CrLf
'WaitMs 500 ' whats this delay for.???
For x = 1 To 62
Hserout gga(x)  'spit the array elements down the rs232 hardware UART
Next x
Hserout CrLf, CrLf
Eric
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
hi C,
In your Neo logging program, why are you initialising the PIC's hardware PORTC.6 and then using the Serin command, a software driven port to read the Data, instead of Hserin the hardware UART.??

Also your RXD receive buffer is only 42 bytes long, when the message can be as long as 74 bytes, even when you skip the header string $GPGGS, the message can still be 68 characters.??

Using this program will give you confusing fragmented GPS messages.:)

Rich (BB code):
Dim gga(42) As Byte '''you have a 43 byte long RXD array

For x = 1 To 62 
Serin PORTC.7, 9600, gga(x) ''' and you are trying to put 62 bytes into the RXD array
Next x

'Hserout CrLf, "62 characters saved after start code GGA follow", CrLf
'WaitMs 500 ' whats this delay for.???
For x = 1 To 62
Hserout gga(x)  'spit the array elements down the rs232 hardware UART
Next x
Hserout CrLf, CrLf
Eric
Hi Eric,

As I said in post#1, I'm no programmer:)

I just played around with a web copied program, till it showed in putty, then went out to get data, which it did for my purpose.

I only posted it to show the program I used. Sorry for the diversion.

C
 

ericgibbs

Joined Jan 29, 2010
21,459
Hi Eric,

As I said in post#1, I'm no programmer:)

I just played around with a web copied program, till it showed in putty, then went out to get data, which it did for my purpose.

I only posted it to show the program I used. Sorry for the diversion.

C
hi C,
I don't see much point in me posting further tested/working programs if you do not use them.

E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
hi C,
I don't see much point in me posting further tested/working programs if you do not use them.

E
Hi Eric,

I was only practising programming, with more simple programs, I'm reluctant to change your programs to get different effects.

Camerart.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
Hi,

The motors have arrived, and they seem very suitable for the tracker. They are 45mm diameter.

I've done a few strength tests, and I'm pretty sure they will be happy, without any gearing, it would be good if this is so, especially as I might introduce backlash. Later I can add gears if necessary.

I have drawn an opto disk, and bought some photo interrupters. http://uk.farnell.com/sharp/gp1s096hcz0f/photointerrupter/dp/1618497?Ntt=161-8497

Now I've got to figure how to mount them. I've attached an SVG of the disk, it should print out at 40mm. I will make a film disk from it.

I tried to post the SVG of the disk, but it wasn't accepted

Camerart.
 

ericgibbs

Joined Jan 29, 2010
21,459
hi C,
Looking at the d/s for the slotted opto it states a Slit width 0.3mm, so I would say if the opto disk had 0.3mm wide 'opaque' area followed by a 0.3mm wide 'clear' area, that would mean for a 1 degree resolution 360*0.6mm [ dark/light] = 216mm circumference, which is ~35.5mm radius.

ie: a minimum of ~70mm diameter.?

You must also consider how you plan to determine the direction of rotation.
E
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
hi C,
Looking at the d/s for the slotted opto it states a Slit width 0.3mm, so I would say if the opto disk had 0.3mm wide 'opaque' area followed by a 0.3mm wide 'clear' area, that would mean for a 1 degree resolution 360*0.6mm [ dark/light] = 216mm circumference, which is ~35.5mm radius.

ie: a minimum of ~70mm diameter.?

You must also consider how you plan to determine the direction of rotation.
E
Hi E,

Probably the best compromise it to lower the resolution to 180 divisions. I'm trying to get 40mm dia.

There is a shaft on the other end of the motor 100:1 2400 RPM, for alternative ideas.

I'm hoping to use two photo interrupters, to give quadrature output, for direction, then if it's too much work for the program, I'll add HCTL 2000 encoder chips.

C
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,459
Hi E,

Probably the best compromise it to lower the resolution to 180 divisions. I'm trying to get 40mm dia.

There is a shaft on the other end of the motor 100:1 2400 RPM.

I'm hoping to use two photo interrupters, to give quadrature output, for direction, then if it's too much work for the program, I'll add HCTL 2000 encoder chips.

C
Hi,
Its possible to double the pulse counts by counting the pulse edges.

If you went for 180 divisions and then used the rising edge and falling edge you could get 360 counts per revolution.

Also by offsetting the 2nd slotted opto by half a division you could get a direction indicator. [and have a resolution of 0.5 degree]

Another important point as you are using absolute azimuth degrees relative to North is a method of detecting 000degrees on the disk, so that you can align the scanner.

Get a X,Y spirit level bubble for your tripod mount, there are circular types that have single bubble in a small hemisphere, dia about3cms.

E
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,840
Hi,
Its possible to double the pulse counts by counting the pulse edges.

If you went for 180 divisions and then used the rising edge and falling edge you could get 360 counts per revolution.

Also by offsetting the 2nd slotted opto by half a division you could get a direction indicator. [and have a resolution of 0.5 degree]

Another important point as you are using absolute azimuth degrees relative to North is a method of detecting 000degrees on the disk, so that you can align the scanner.

Get a X,Y spirit level bubble for your tripod mount, there are circular types that have single bubble in a small hemisphere, dia about3cms.

E
Hi E,

Bubble no problem, orienteering compass no problem.

Regarding quadrature encoding (Two photo interrupters set half a division apart). Do you think there will be any problems adding this to the program. If the program can cope, and you can achieve 0.5 degree resolution, then would 90 divisions be better, giving 1degree? Don't go too far along this route yet in case I'm unable to fit the interrupters accurately.

C
 

THE_RB

Joined Feb 11, 2008
5,438
Why slotted? And why so many slots? :eek:
Your encoder goes on the motor shaft, which is 100:1 ratio compared to antenna movement (assuming no final gear ratio).

A slotted disk is much harder to make! I suggest using a reflective sensor and a printed disk with white and black stripes. Very easy to make.

If you have 9 white and 9 black stripes around the circumference (a "9 line" encoder) with quadrature encoding gives 36 quadrature events per rotation.

Adding your 100:1 gearing means you will get 3600 encoder events per output shaft rotation, or 10 encoder counts per degree that the antenna moves.

Since we already discussed that the antenna will be fine within a 5 degree range, having 10 counts per degree is still excellent.

Remember that the less encoder counts per degree, the less encoder events that have to be handled in software per second of movement. That eases the workload of the processor.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,840
Why slotted? And why so many slots? :eek:
Your encoder goes on the motor shaft, which is 100:1 ratio compared to antenna movement (assuming no final gear ratio).

A slotted disk is much harder to make! I suggest using a reflective sensor and a printed disk with white and black stripes. Very easy to make.

If you have 9 white and 9 black stripes around the circumference (a "9 line" encoder) with quadrature encoding gives 36 quadrature events per rotation.

Adding your 100:1 gearing means you will get 3600 encoder events per output shaft rotation, or 10 encoder counts per degree that the antenna moves.

Since we already discussed that the antenna will be fine within a 5 degree range, having 10 counts per degree is still excellent.

Remember that the less encoder counts per degree, the less encoder events that have to be handled in software per second of movement. That eases the workload of the processor.
Hi Roman,

I mentioned the other end 100:1 shaft for ideas, but my intention is to put the opto disk on the output shaft, initially with 1 line per degree (less now). Using the other shaft, running at 2400 RPM if used might only have 4 dark 4 light on it. This then needs maths for integers. (Correct me if I'm wrong)

I'm hoping to make the disk out of ortho film.

I'm looking into quadrature encoders etc, but I am also thinking about simpler ways to do this.

e,g, 90 dark 90 light, with added darks each side of the NORTH dark, for calibration. Using one interrupter combined with the motor forward reverse control to give direction input.

Camerart.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,840
The HCTL could be a problem it will require 11 PIC pins to connect.!

You could consider a 12F628 for the quadrature, provide a count and up/down to the 18F
E
Hi Eric,

Just saw these PICs: PIC18F4331/2331/4431/2431 They include 2X optical encoders.

C
 
Last edited:
Top