# Using GPS for Yaw - CUAV C-RTK 2HP

I am in search of advice on usage of GPS Yaw for a non drone application

I am contemplating the usage of CUAV RTK 2HP heading module for an application other than drones.

I am currently developing a product which needs to measure accurate heading ( w.r.t true north and not magnetic north) of objects which are 2km - 2.5 km away from me. The device i am developing measures latitude and longitude of features i point it at. A monocular scope is provided on the device which is aligned with the compass axis.

Since one degree of heading error translates into a horizontal error of almost 43 meters at a distance of 2.5 km, I require very high accuracy and repeatability for heading readings in my application. I am illustrating my use case by the following example

Example:- From my terrace, if i see a building at a distance of 1 km ( distance is measured with a separate laser rangefinder) i point my device at the building ( by locating the building through the monocular scope) to measure the accurate heading to it ( lets say 240 deg bearing from true north). Once i get this bearing , It is passed to my single board computer which calculates the latitude and longitude of the building using the distance reading from my range finder and a mathematical formula similar to Haversine’s formula . This latitude and longitude would be grossly incorrect if my heading reading was inaccurate. Even 1 deg error in the heading measurement will cause the lat long to be far away from the building I was pointing at. I made this device and got it working too but i realized that the compass errors are too much for it to work with any usable accuracy. as of now the latitude and longitude calculated by my device is almost 80 to 100 m away from the actual feature / building i pointed at.

That is why i need a robust heading measurement device

The CUAV C-RTK 2HP unit will be mounted with antennas perfectly aligned with a monocular scope (y off-set zero) so that whatever is captured by the cross hairs of the monocular scope would be what the compass is pointing at. With a standard digital compass such as IST8310, i was getting inconsistent errors . Even while looking at the readings of the magnetic compass I am using, I can see that the range of fluctuation of the values is 1 deg and sometimes even 2 deg( consistent errors are also acceptable since the code can have a fixed correction )

I believe that there are many expert in this forum who have tested and tried GPS for yaw or may even have tested the CUAV dual antenna unit I am referring to.
Can anyone tell me if the accuracy of moving baseline yaw would be good for an application like this?
Does the yaw measurements output by the device fluctuate a lot like the output of magnetic compasses ( like more than 1 deg)?
Can it be used with any flight controller which supports DroneCAN? I am using a Pixhawk 2.4.8 with AC version 4.5.4

My product can accommodate placement of the two antennas at a distance of 30 to 40 cm and not more than that.

Any guidance in this regard would be very helpful to me as I am stuck in a tight spot in my product development

warm regards
Atul

The C-RTK 2HP is based on the UM982. The specs for the receiver says it has a 0.1 degree heading accuracy for a 1 m baseline (1 m between both antennas).

I couldn’t find a graph showing the heading accuracy as a function of the baseline, but the u-blox F9P has such a graph. The accuracy is inversely proportional to the baseline. For the F9P, at 1m, it has an accuracy of 0.4 degrees, and at 0.4m it’s around 0.6 degrees. Maybe that can give you an idea of the expected accuracy for the UM982.

I don’t have that receiver model, so I couldn’t confirm it’s behaviour.

Thanks for the inputs. Is it safe to assume that the inverse proportionality is linear. I definitely won’t be able to place the antennas at 1M distance. May be .5 m . That would probably make the accuracy of heading to 0.2 deg.

My real worry is would the readings be stable or would they be fluctuating randomly. The issue with random fluctuations is that every alternate reading would be different.

Warm regards

I can’t give you an answer for the IM982, but when I used two F9P for yaw, with a 0.6m baseline, here are the fluctuations over 10 minutes (without moving the antennas):

and when I zoom in on a minute:
.
So maybe you can expect something similar. Mind you, this log was taken outdoors under a clear sky, with a full 360 view of the sky (so under ideal conditions). If you plan to setup under a tree or near a building, results may vary.

However, the flight controller will use its gyro to help estimate yaw. It will eliminate the high frequency noise, but unfortunately can’t do much about the low frequency fluctuations (the EKF yaw estimation is in blue):

In this case, no magnetometers were contributing to the yaw estimation. The EKF was only using the GPS and the gyros.

However, the sensors in the Pixhawk 2.4.8 are outdated, you can find good cheap flight controllers with better sensors (ICM42688), like the F4, F7 and H7 flight controllers from Mateksys.

You might also like to look into using an RM3100 magnetometer. Mateksys also has this sensor. The following figure shows magnetometer values logged by a different drone, over 3ish minutes while stationary on the ground. In blue/green, those are the outputs for the RM3100, and orange/yellow are from the internal compass of a CubeOrange+ (ICM20948):

As you can see, virtually no noise. The internal compass of the Pixhawk 2.4.8 is probably even worse than the one in the CubeOrange+.

But no matter the choice you make, if you want to avoid high frequency twitching of your scope, due to high frequency noise is your yaw estimation, then a better gyro is necessary. If you want to avoid slow fluctuations, I don’t know if you’ll manage that with a dual antenna GPS.

Dear Bobzwik

That was a very very very useful input. Infact those graphs are really awesome and was exactly what I wanted to see.

I see that a good compass like RM3100 also gives pretty stable ( and reasonably low noise) data . Yes the gyros on my pixhawk 2.4.8 may be poor quality ( even worse since I’m using a clone ) . So my approach would be like this to solve my compass inaccuracies problem

First set up a good compass ( such as RM3100 ) along with a good flight controller such as a cube orange ( something which has a reliable gyro ) and use the ekf estimate for yaw. I will disable the internal compasses of the FC in this case.
I believe the ‘hdng’ provided by Globa_position_int_message is the EKF output. Check if this set up improves my compass accuracy

If that doesn’t work out
I get a dual antenna CUAV unit (or in case I am unable to ascertain if the chipset is having comparable performance to that of a Zed F9P I may even find a good zf9p RTK module from holybro and use two of them for moving base ) the fluctuations are much less than half a degree in the graphs which is much much better than what I am seeing now . In this case too I would use a better FC for better gyro inputs . I would definitely disable use of compass in yaw calculation in this case . My application would be deployed with perfect visibility of the sky and also it does not move . It is placed at one location to measure geo coordinate of distant buildings and features. So it may have a comparable performance as was in your graph. Or atleast I can hope so.

The above order of choice is due to budget considerations, else I would have chosen the moving base ahead of the better compass config since the moving base would also take out magnetic interferes/ EMI out of the equation

I can’t thank you enough for the pointers.
Absolutely grateful

Cheers
And warm regards
Atul