• Announcements

    • Zapata

      Abbreviated rules   07/28/2017

      Underdawg did an excellent job of explaining the rules.  Here's the simplified version: Don't insinuate Pedo.  Warning and or timeout for a first offense.  PermaFlick for any subsequent offenses Don't out members.  See above for penalties.  Caveat:  if you have ever used your own real name or personal information here on the forums since, like, ever - it doesn't count and you are fair game. If you see spam posts, report it to the mods.  We do not hang out in every thread 24/7 If you see any of the above, report it to the mods by hitting the Report button in the offending post.   We do not take action for foul language, off-subject content, or abusive behavior unless it escalates to persistent stalking.  There may be times that we might warn someone or flick someone for something particularly egregious.  There is no standard, we will know it when we see it.  If you continually report things that do not fall into rules #1 or 2 above, you may very well get a timeout yourself for annoying the Mods with repeated whining.  Use your best judgement. Warnings, timeouts, suspensions and flicks are arbitrary and capricious.  Deal with it.  Welcome to anarchy.   If you are a newbie, there are unwritten rules to adhere to.  They will be explained to you soon enough.  
allene222

Anyone measuring tidal current?

Recommended Posts

I am trying to measure current with my boat instruments.  I think I am within 1/10 knot but I have some inconsistencies.  I am wondering if anyone else has attempted this. The basic idea is that adjust the boat speed senders gain and compass offset until going north, south, east or west I get as close to the same magnitude and direction as I can.  I go over the same point in the water and try and do it near slack water but I am not really sure.  I am also getting a few percent variation day to day on the speed senders which is troubling.  I have two speed senders and see variation between them day to day.  I am wondering what the limit on this measurement is.  Can I really do 1/10 knot or is it 1/4 or 1/2?

My next step is going to be to put a GPS in the water and measure the actual current and do my boat test and compare it to that.  But I would still like to know if anyone else is measuring current and how accurate they feel the measurements are.

Share this post


Link to post
Share on other sites

For what it's worth most coaches seem to still rely on tide sticks to measure current. I guess it removes some of the variables like windage. They just trigger the MOB on the GPS when it goes in the water, leave it in for a defined period of time and then do some maths on the distance shown when they pick it up.

Share this post


Link to post
Share on other sites

One way to do it is to turn constant circles and look for GPS drift of the center. That's how nearly all sailplane instruments calculate wind. Heading vs. GPS course too - but that is going to be tough at 1/4 knot tidal drift. I am very skeptical that a paddlewheel is that accurate. State of the art sailplane instruments can now calculate air mass movement inertially, but again not down to 1/4 knot.

Share this post


Link to post
Share on other sites
1 hour ago, DDW said:

One way to do it is to turn constant circles and look for GPS drift of the center. That's how nearly all sailplane instruments calculate wind. Heading vs. GPS course too - but that is going to be tough at 1/4 knot tidal drift. I am very skeptical that a paddlewheel is that accurate. State of the art sailplane instruments can now calculate air mass movement inertially, but again not down to 1/4 knot.

Thanks for that.  I was just thinking about that myself and it is good to hear that it might even be a reasonable approach.  However, I am concerned with a couple of error sources with circles.  One is that if I turn 360 degrees in say 3 minutes, I am turning 2 degrees per second and could introduce some huge errors.  But if I turn slower, I am covering more ground and there may be variation in the water.  Also, at slack the current is changing 1/10 knot in 8 minutes so if I take too long, I am going to get variation across the measurement time. Maybe I should measure at peak current where the change is minimum.

In the test I did yesterday I went E-W-E and N-S-N and then the goal is to have the W and S points between the repeated points.  Below is a graph of how it came out after I adjusted the gain and heading corrections for best average result of the two direction sets.  This is showing about .1 knot error but then again I adjusted the parameters to make that happen and they were somewhat different than the parameters from last time.  Ideally the triangle would be between the two squares and the diamond between the two circles. These plots are polar plots so the amount of current is the distance from the center and the direction of the angle of the current. 

graph.png

Share this post


Link to post
Share on other sites

Allen, I am starting to try to understand how the current measurement on my B&G system works. For (nearly) wind- and current-free test runs I use the (dead) end of the Santa Fe Channel in Richmond.

If I may ask, what formula do you use for the calculation? Anticipating the answer, do you set the Leeway Coefficient to zero when you are motoring?

Share this post


Link to post
Share on other sites
42 minutes ago, The Smokester said:

Allen, I am starting to try to understand how the current measurement on my B&G system works. For (nearly) wind- and current-free test runs I use the (dead) end of the Santa Fe Channel in Richmond.

If I may ask, what formula do you use for the calculation? Anticipating the answer, do you set the Leeway Coefficient to zero when you are motoring?

You made me to look at my RaceBox code to see what I did :-)  But here is the answer.  Current is the vector difference between the boat velocity over water and over land.  Velocity has speed and direction but what I do is plot the sin and cos components of this difference on a x-y graph and look for correction factors for boat velocity over water that makes the cluster of points for different headings converge.  There is no leeway in that calculation.  But I do look at the readout of current while I am on the water and for that I have not set the leeway factor to zero.  Leeway is a function of heel and there is very little heel.  But it is an error and I am glad you pointed it out as leeway is part of the heading I use to find the boat vector.  I just calculated that it would give the instrument readout about 1/2 degree error and that might be half a tenth of a knot.  I will turn leeway correction off tomorrow when I do my next round of testing at max current.

Interestingly, I had a similar issue when I was trying to find if my wind indicator was correct.  I had not set the updraft coefficient to zero when the boat was dead into the wind (no sails up).  I changed the code to zero out the updraft coefficient at shallow wind angles.  But I had not thought about leeway in current.

Thanks for pointing that out.

Share this post


Link to post
Share on other sites

@The Smokester Today I went out and did another set of measurements.  First, I learned that the tidal current is not uniform enough to get anything useful from a circle.  I did and X pattern again but this time I noted the location of the cross and used data 30 seconds plus or minus from that location. I averaged the data and plotted each point in a different color on a polar plot of current.  I also went out at max current.  That was a successful change as the current was constant across the hour of my test.  I was able to adjust the EW and NS current readings to agree internally but they did not agree with each other.  By that I eman E and W and E agreed and N and S and N agreed.  I added a correction factor the the heading of -2.5 sin(heading) and that got all 6 points within one square 0.1 knot on a side.  My conclusion is that the TackTick compass calibration was off by a tad so I just put the correction into the RaceBox.  This correction is analogous to turning the magnet adjustment on a traditional compass.  I turned leeway off.  I look forward to going out again at max current and verifying these new values.

Share this post


Link to post
Share on other sites

There's a very easy way to get the ego-motion (e.g. boatspeed) for dubins carts (e.g. boats) in moving vector fields (e.g. water currents). Check out IMU Wind Estimation (Theory) by William Premerlani, https://drive.google.com/file/d/0ByvTkVQo3tqXVzBYQUZicUNvbEE/view. I had great success implementing the airspeed estimator part of this with OpenPilot and Tau Labs, two drone autopilots I was involved with before getting into sailing. It was a very reliable estimator, albeit noisy. 

Here's the source code I wrote if you want an implementation reference: https://github.com/TauLabs/TauLabs/blob/next/flight/Modules/Airspeed/gps_airspeed.c#L99. You'll have to implement the final calcs yourself to get tidal current but those should be straightforward. Sorry I can't get you the graphs from the original pull request, it went away with the dodo when OpenPilot forums were shut down. 

Share this post


Link to post
Share on other sites

Not sure I would expect 1/10 knot precision, much less accuracy. 10 Hz GPS probably good enough if you toss outliers points for SOG and COG  

If you have a typical 30,000 pulse per nm paddle, 1/10 kt at 5 or 2% error would be 600 pulses in 12 min. 

Take a 30sec sample (at 41.67Hz average) and your error is 25 pulses over ~250 feet travelled. 

Take ~1 sec samples ( or time to 40 or 50 pulses) and your time base quantization becomes a possible issue. 

Not many places I can think of in bay that would have constant current over a distance of >250 feet. Even in linear channels such as Estuary, you get edge effects.  

Look at the Oakland inner vs outer current https://tidesandcurrents.noaa.gov/ports/ports.html?id=s10010&mode=show_all vs depth. 

Share this post


Link to post
Share on other sites
1 hour ago, LionessRacing said:

Not sure I would expect 1/10 knot precision, much less accuracy. 10 Hz GPS probably good enough if you toss outliers points for SOG and COG  

If you have a typical 30,000 pulse per nm paddle, 1/10 kt at 5 or 2% error would be 600 pulses in 12 min. 

This is the genius of Permerlani's method. You don't need an odometer reference, and all the calibration problems it entails. All you need is absolute heading and GPS info. 

10Hz GPS is more than sufficient for hovering drones, which is one of the hardest flight modes. Since the boat is always moving, the GPS noise will blend into the background very quickly. 1/10th of a knot is roughly 0.5m/s, which is about five times larger than a GPS's doppler measurement (make sure the GPS gives speed as a result of doppler measurements, not differentiation of position measurements. uBlox is excellent for this).

@allene222I gave it some more thought and realized you can try this out really quickly if you'd like to go down this path It will cost about $15 for the hardware, an STM32F3 Discovery board, and then another $30-50 for a uBlox-based GPS. PM me if interested in the nitty gritty.

Share this post


Link to post
Share on other sites

A couple of comments.  I have trouble relating airplane measurements where speeds are in the hundreds of miles per hour and two GPS measurements one second apart are meaningful to what I am doing. Also, the airplane case is much more complicated in other ways as it is 3d and the boat problem is only 2d

Second comment is that I don't count pulses.  I measure the time between a number of pulses. Specifically, I count the pulses and when a second is over, I measure the time from the first pulse to the last one and divide by the number of pulse intervals.  This is much more accurate than counting pulses as @LionessRacing points out.

I use 1 Hz GPS as the basic GPS unit is much more accurate at 1Hz than at 10Hz, at least the ones I use are.  I am averaging a minute of data so the measurement noise is pretty much gone.

In my previous post I mentioned that I am now doing my tests at max or min current as the rate of change of the current is minimum then.  I found compass error as my limiting factor, made some corrections, and went out again. Unfortunately Christmas came and some car trouble so I am still looking forward to verifying my final tweaks.

@LionessRacing also points out that variations in current over the measurement space is an issue and while my N-S-N runs should take that out for that direction as the N and S measurements are going over the same ground, the E-W-E are only going over the same point at the intersection and may not give the same reading at all compared to my N-S-N run.  This is particurally troubling as my E-W-E runs are in a dredged channel where the N-S-N ones cross that channel.  That could be a significant source of error and deserves some thought on how to minimize it.  Perhaps making my runs at 45 degrees and just crossing my reference point would be better but the point that I cannot count on the current field being uniform is valid. Perhaps getting away from the channel and just using the tracks on the water as the reference. It is a valid criticism of what I have done and I need to address it somehow.

Maybe there is a better way to think of the problem.  What I am really trying to do is calibrate the knot meter readings and the compass readings.  I can make three runs aligned with the current and get a good calibration on the knot meter. I can do the same with the compass for a single point.  My marina has a breakwater that is exactly N-S so I am very confident in the N-S calibration as the current has to be parallel to the breakwater as water cannot go through the wall.  Now if I could figure out a way to get the E-W calibration point, maybe that would be a better way to calibrate the system. After all, if both the knot meter and compass are right on, the current will be correct.

The real issue here is that to calibrate something you need a reference.  You need something you can count on.  Having a uniform current field would be enough but that is perhaps an unrealistic hope.  It is a difficult but interesting problem.

Here is a thought.  I can get the knotmeter calibrated by making runs in line with the current, which is N-S.  Then I can make an E-W-E set of runs and compare the heading error for E vs W.  If my error really is correctable by some number times the sin of the heading, I could see that. If on the other hand, E was off but W was correct, I would be introducing error in W to make them agree.  Perhaps the error at that point would be sufficiently small that it would not matter.  A 1 degree error is probably 0.1 knot of current error so I might be able to get close to my goal that way.

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, kubark42 said:

This is the genius of Permerlani's method. You don't need an odometer reference, and all the calibration problems it entails. All you need is absolute heading and GPS info. 

10Hz GPS is more than sufficient for hovering drones, which is one of the hardest flight modes. Since the boat is always moving, the GPS noise will blend into the background very quickly. 1/10th of a knot is roughly 0.5m/s, which is about five times larger than a GPS's doppler measurement (make sure the GPS gives speed as a result of doppler measurements, not differentiation of position measurements. uBlox is excellent for this).

@allene222I gave it some more thought and realized you can try this out really quickly if you'd like to go down this path It will cost about $15 for the hardware, an STM32F3 Discovery board, and then another $30-50 for a uBlox-based GPS. PM me if interested in the nitty gritty.

I am using an Intel Edison based controller that I built.  It is a 500MHz dual core Linux box with WiFi and Bluetooth.  Intel obsoleted it but I have a shitbox full of them from another project that had to be redesigned because of the obsolescence.  The board has an Adafruit Ultimate GPS which is quite accurate.  It also has an accelerometer so I can do heel measurements. The GPS is 10Hz capable but I use it at 1Hz as boats are slow and the accuracy is better.  Basically, if you use 10Hz, you get 10x the noise so why bother, you just have to do more filtering when you start with 10Hz and you end up in the same place as you need more filtering than 1Hz to get good measurements.  Boats accelerate slowly so you never see the filter response.  I do the current calculation in my RaceBox.  It also does all the corrections on the compass and wind but that is a different story.

The knotmeter is also something I built and has an Arduino mini as its processor.  There are two speed senders and the Arduino linearizes them and then averages and sends all that data to the RaceBox.  The math to calculate current is straightforward.  The difficulty is calibrating the speed and heading readings and the difficulty there is finding something that is known.

You are certainly correct that the doppler measurements are more accurate and that is of course what I use.

Share this post


Link to post
Share on other sites
1 hour ago, allene222 said:

A couple of comments.  I have trouble relating airplane measurements where speeds are in the hundreds of miles per hour and two GPS measurements one second apart are meaningful to what I am doing. Also, the airplane case is much more complicated in other ways as it is 3d and the boat problem is only 2d

Second comment is that I don't count pulses.  I measure the time between a number of pulses. Specifically, I count the pulses and when a second is over, I measure the time from the first pulse to the last one and divide by the number of pulse intervals.  This is much more accurate than counting pulses as @LionessRacing points out.

I use 1 Hz GPS as the basic GPS unit is much more accurate at 1Hz than at 10Hz, at least the ones I use are.  I am averaging a minute of data so the measurement noise is pretty much gone.

In my previous post I mentioned that I am now doing my tests at max or min current as the rate of change of the current is minimum then.  I found compass error as my limiting factor, made some corrections, and went out again. Unfortunately Christmas came and some car trouble so I am still looking forward to verifying my final tweaks.

@LionessRacing also points out that variations in current over the measurement space is an issue and while my N-S-N runs should take that out for that direction as the N and S measurements are going over the same ground, the E-W-E are only going over the same point at the intersection and may not give the same reading at all compared to my N-S-N run.  This is particurally troubling as my E-W-E runs are in a dredged channel where the N-S-N ones cross that channel.  That could be a significant source of error and deserves some thought on how to minimize it.  Perhaps making my runs at 45 degrees and just crossing my reference point would be better but the point that I cannot count on the current field being uniform is valid. Perhaps getting away from the channel and just using the tracks on the water as the reference. It is a valid criticism of what I have done and I need to address it somehow.

Maybe there is a better way to think of the problem.  What I am really trying to do is calibrate the knot meter readings and the compass readings.  I can make three runs aligned with the current and get a good calibration on the knot meter. I can do the same with the compass for a single point.  My marina has a breakwater that is exactly N-S so I am very confident in the N-S calibration as the current has to be parallel to the breakwater as water cannot go through the wall.  Now if I could figure out a way to get the E-W calibration point, maybe that would be a better way to calibrate the system. After all, if both the knot meter and compass are right on, the current will be correct.

The real issue here is that to calibrate something you need a reference.  You need something you can count on.  Having a uniform current field would be enough but that is perhaps an unrealistic hope.  It is a difficult but interesting problem.

Here is a thought.  I can get the knotmeter calibrated by making runs in line with the current, which is N-S.  Then I can make an E-W-E set of runs and compare the heading error for E vs W.  If my error really is correctable by some number times the sin of the heading, I could see that. If on the other hand, E was off but W was correct, I would be introducing error in W to make them agree.  Perhaps the error at that point would be sufficiently small that it would not matter.  A 1 degree error is probably 0.1 knot of current error so I might be able to get close to my goal that way.

 

Consider taking the instantaneous BSP, HDG, SOG, COG, when they are somewhat stable after your turns . 45 degree to expected tide up and down might be good, but your slow continuous circle might work as well. Solve for the drift and set at each observation, and filter out the inflections in a short interval, on premise that in a 100 second window the mid tide current will not change much. 

 

Share this post


Link to post
Share on other sites
22 minutes ago, LionessRacing said:

Consider taking the instantaneous BSP, HDG, SOG, COG, when they are somewhat stable after your turns . 45 degree to expected tide up and down might be good, but your slow continuous circle might work as well. Solve for the drift and set at each observation, and filter out the inflections in a short interval, on premise that in a 100 second window the mid tide current will not change much. 

 

The circle ends up being very large.  Consider that turning 1 degree per second introduces a significant error due to measurement lag so basically even that slow, which takes 6 minutes, is not using settled readings.  And a circle that large is not seeing the same current in all parts of the circle and the current is probably changing in the time it took me to make that circle.  It is like you said, the current field is not constant.  It just didn't work.  That is why I went for a point with two crosses at 90 degrees.  All I need then is a uniform plane of changing current but I picked a dredged channel as one of the axis which I now think was a mistake.  I think I can get away from the channel and set a GPS virtual marker.  I will just have to program that somewhere.  Basically a MOB function would do it.

Share this post


Link to post
Share on other sites

My airplanes would fly at maximum 10m/s, and I usually liked to keep them at 3-4m/s when possible. They were slow-flight fixed-wing foamies. Great for my kind of research because they didn't need a big field and when one went splat into the side of a steel container nothing ever really broke. The wind speeds were typically higher than the water current, so I don't have experience in your use case, but my upwind ground speeds were def in the 5-7kts range.

The MediaTek GPS modules (which the Adafruit uses) are good values for the money, but the consumer/hobby drone industry uses almost exclusively uBlox receivers. They have much better performance across the board. For instance, noise does not increase with the uBlox M8 modules when sampling at higher rates. (Confirmed by measurement and then senior engineering at uBlox). You can choose between 10Hz GPS+GLONASS or 18Hz GPS, although in our tests we got better uptime (we need >99.999% availability for our month-long drone flights) with GPS+GLONASS.

I'm not sure what kind of filter you typically use, but a stochastic estimation filter (e.g. a Kalman filter) does not have lag problems. If you tie it into an IMU you will find that estimator performance gives >200Hz results to within 5cm of precision. If you haven't seen it already, you might enjoy reading about Strapdown Navigation state estimators. 

Another factor in GPS precision is the antenna type. The Adafruit comes with a ceramic patch antennas. These have a very high gain in the normal direction, but it drops off very quickly toward the horizon. The upshot is a 30deg heel will cause many satellites to become invisible to the receiver. For monohull operations a helix antenna is preferable.

Heh, hear you on the Edison. I've got several, and even a few Joules and Aeros sitting around. Glad you're putting them to good use, they were a really neat SBC, but Intel was selling each at a loss and couldn't get the price down. Even when we asked them for 10k volume pricing, they couldn't/wouldn't cut prices.

Anyway, sounds like you've got something which is already bearing fruit. Let us know how the verification test turn out!

Share this post


Link to post
Share on other sites

OK, not the kind of airplanes I was thinking about.  I use a Garmin GPS powered antenna.  I have a couple of otherers I keep wanting to mount but never get around to it.  In my other project, we are just using the patch but those boats don't heel and we saw no difference between the external antennas and the patch so we just simplified it.  My RaceBox design is probably 4 years old now so things change.  I just got a last time buy notice on the LCD driver for my large LCD displays.  I have like 10 PCBs made for them.  Somebody posted that they wanted to make a large LCD display and wondered how hard it was.  I told him I would give him a PCB free and all the software and help him through any issues.  He decided to buy something commercial instead.  Go figure.

As far as filtering, I use a long simple filter under the theory that current doesn't change fast.  My input quantities have different lags so that doesn't work as well as it would if I fix that so basically I have to wait after making a course change to read the current but I think in use that will be fine.

Regarding the uBlox not having more noise at higher sampling rates.  Doesn't that mean that they are not changing their filtering as they change the sampling rates?  Either they keep a long filter on at all rates, or are giving higher noise relative to the rate at slow sample rates.  I don't think there is a free lunch.  If you sample slower you can get less noise than if you sample faster. Unless you don't match your filter to your sampling rate.

Did a bit of a search on GPS accuracy comparisons and really hard to see anything that matters to what I am doing.  I need SOG and COG. I don't care about how a car comes out of a tunnel or how well it works inverted.  I use an external antenna so the patch is not in use.  A bit late to switch anyway but if I was starting from scratch, I will definitely check it out.

On my other project, we are getting .02 knot noise floor with the patch antenna. Seems pretty good.  Right now I am looking at a readout on my desk so the antenna is looking through my roof and I am seeing typically 0.01 knot readings.  15 second filter. My desk isn't moving and I have that function that detects no motion turned off.

Share this post


Link to post
Share on other sites

We use the NEO-M8Q, but if I were to do it again I'd choose the M8N because it has upgradable flash at the cost of maximum processor performance. 

You're right that there's no such thing as a free lunch on the analog side, (although there's a caveat below[*]), but a lot of the filter is done in discrete filtering steps which are bounded by processor speed. This processor bottleneck is why the uBlox M8 can only do 10Hz when listening to both GLONASS and GPS. It's just got too much rattling around its little brain to get it all done quickly. (Compare this to some of the L1/L2 GPSes we were messing around with, which could give cm precision on their own, without an IMU for help. They're also $$$...!)

Setting aside some pretty big edge cases, one thing that was demonstrated a decade ago was that with quantized systems you got better dynamic state estimation results when sampling 10x faster than sampling with 10x more precision. This is especially true with a moving boat where your filter can converge to >50cm of accuracy, but in a 1s window you might be moving 2-4m. (BTW, the computation delay on the uBlox is around 50ms in the x-y axes, and 70ms in the z-axis.)

+1 on using a slow filter for estimating current... it certainly won't change quickly! Saves a lot of work to generate the current measurement with a high speed rate estimator and then just pass that through a super slow first-order low-pass filter. My hunch is that 100 data points would probably make a very stable reading.

I follow your reasoning on the GPS accuracy. Once you're sampling at >5Hz, if you wanted to do a bunch better a $1 IMU and $1 magnetic compass is much better bang for the buck. If you're interested in the mechanics, this paper on EKF fusion was written by one of our cofounders. It's brilliant because it's completely model independent, it works as well on a boat as a plane.

[*] Allan variance says that you can average across such a big window that your overall result gets continually worse. This makes intuitive sense if we were measure the speed of a car. Most of the day it's parked, and so the average converges to 0 quite nicely. But then if you jump in it and drive away, the longer you keep the average going the worse the average gets. 

Share this post


Link to post
Share on other sites

The quantization noise is at .01 knot with 1Hz update rate.  Then I filter it so I think I am not worrying about sampling higher, which just basically allows the noise to do interpolation between the quantization points.  As long as there is more noise than the quantization, you do get extra resolution from averaging.  But I think even when I do speed, I use a 5 second average.

The other issue on averaging is that there are different types of noise.  We used to call some noise popcorn noise.  You basically cannot filter it.  In my other project, I found 15 second and 30 seconds of averaging produced the same noise.  No reason to go beyond 15 seconds.

Back to the uBlox filtering and rate.  The SOG and COG are derived from the ppl on the carrier.  I won't pretend to know the details but that is basically an analog process even if it is done digitally.  There will be noise and the amount of noise will be dependent on the loop bandwidth and that will in turn determine the response time or meaningful update rate. My guess is that if the uBlox does not degrade accuracy with sample rate then you would not see a change in response time with update rate either, other than the lag caused by slow sample rate.  That might be reason enough to use a higher sample rate on an airplane.  You have some (fixed) response time but if you only sample at 1Hz, you might introduce an extra delay term on top of the filter delay.  In that case, you would see very little difference in performance from 5Hz to 10Hz.  In my case where I am averaging multiple readings, a bit more delay isn't such an issue.  That said, I did go to quite some trouble to eliminate about 2 seconds of delay on my speed readings by eliminating the TackTick                                    delay and the Stowe display delay.  My large mast mounted LCD display ha virtually no delay and the Arduino knotmeter electronics have no transmission delay the way a wireless system would.  I also use the knotmeter reading as the timestamp in the processor so it is the fastest thing out. Wind readings and compass come when they come.

My eyes gloss over when I read papers like the ones you referenced.  Just makes me want to get another beer.

Share this post


Link to post
Share on other sites

Some Background

There are two timeless questions surrounding moving vehicle navigation in a fluid medium:

  1. Where am I and how fast am I moving and in what direction relative to the planet?
  2. In what direction and how fast is my fluid medium moving relative to the planet?

Sailing is curious because we deal with two fluid media, air and water, and want to obtain the answer to question 2 for each of them.

Literally trillions of dollars have been spent to answer these questions. No one gets answers to within 0.1 knots.

Regarding fusing data

The statement, above that "I am averaging a minute of data so the measurement noise is pretty much gone" is a classic example of why numeric analysis matters. All you're doing is exchanging one kind of error for another, what's the basis for stating that one is more accurate than the other? Show your work.

There are two approaches to understanding fused sensor data of which I'm aware, I do not believe you're doing either.

The first is to perform a detailed analysis of the error associated with each data stream and work through the math to determine the resulting error in the fused data. This is a brutal analysis when there's no unified time base. However, if it's not done, there's no possible way to understand whether fusing the data produces a result or a random number. In most cases, it's the latter.

To illustrate with a poor example, let's imagine for a moment that your heading has inherent error of 0.5%, your GPS speed 0.1% and your boat speed 1%. Assuming those combine linearly, the net error is 1.6%. With a boat speed of 6 knots, that's an error of 0.1 knots. And they don't combine linearly and I doubt your sensors are nearly that good especially considering the time base conundrum. Yes, this analysis doesn't apply to your situation, but one cannot simply ignore the bounding box of errors in which one lives. Do the math.

The second approach to fusing data is to use a Kalman Filter, which provides both an answer and a high quality estimation of that answer's accuracy.

Any reasonable implementor does both.

Is hovering really the hardest thing?

Regarding the claim that hovering a drone is the hardest case, I don't believe that's true. Hovering lends itself well to dampening of sensor input, which is easy. I believe it's much more difficult to fly a constant ground-relative course and speed in an air mass that has significant speed and direction oscillations.

You can't trust what you can't validate

Finally, the quality of result derived from this kind of algorithm development cannot be verified without massive investment in simulation. We find this again and again when doing tank testing and wind tunnel testing - calibration and correlation are 90% of the effort. Attempting to validate a sensor suite in vitro is a huge waste of time. More so when you have no analysis that bounds the inherent accuracy of your results.

 

  • Like 1

Share this post


Link to post
Share on other sites

@Moonduster Thank you for your detailed review.  I might clarify some things I may have said incorrectly.  Averaging over a minute removes the noise but I agree that it does not inherently make the measurement accurate.  Those are different things.  As @kubark42 pointed out, the accuracy of my calibration depends on the uniformity of the current field I am testing in.  That discussion, which was very helpful, let to the realization  that I have not selected the best location for my testing.  In fact, I have now looked at the data and find that the E-W runs were in 3.5 meters of depth and the N-S one in about 2.8 meters.  While that does not mean what I have done is in error, I certainly don't trust it.

I have looked at Kalman filters many times and never seen how they would help what I am doing.  I could see it if I used both SOG and change in position over time as two independent measures of speed, I might be able to use the long term difference in position to calibrate the SOG or looked at it the other way use the SOG to remove the noise in the difference in location over time. But my experience is that positional errors are just too high so I stick with SOG alone.

My basic approach is to measure the current four times.  I then adjust the gain on my knotmeter, and the calibration on the compass to align all these measurements on top of each other.  The accuracy depends on having a uniform current field in position in both location and time.  One breakthrough was the realization that measuring at maximum current was superior to measuring at slack current.  That addresses the uniformity in time.  The uniformity in location is the next challenge.

By the way, I have done things in my life that were said to be impossible so I am not discouraged.

Share this post


Link to post
Share on other sites
1 hour ago, allene222 said:

My basic approach is to measure the current four times.  I then adjust the gain on my knotmeter, and the calibration on the compass to align all these measurements on top of each other.  The accuracy depends on having a uniform current field in position in both location and time.  One breakthrough was the realization that measuring at maximum current was superior to measuring at slack current.  That addresses the uniformity in time.  The uniformity in location is the next challenge.

Other than academic pedantry, what is your goal with extremely accurate synthesized current values? 

Real currents are varying in 4 dimensions over ground and subject to wind shear as well in the realm you probably care about (the 1-2 meters you actually sail in) 

Knowing that you have gone from an adverse to favorable current makes perfect sense, and may often be accompanied by a temperature change as well

Knowing that your current direction has changed by > 15degrees makes perfect sense, as it may presage an eddy. 

Knowing that your current has changed magnitude by 20% or 1/2 kt also would make sense, as it would guide you in terms of favored course. 

Having said all of that; 

  • SOG/COG and bearing/Speed toward waypoint (VMC) are probably what you would navigate to in steady winds
  • BSP/TWA vs targets are what you would generally trim/steer to in variable winds
  • Knowledge that the current has changed as you near a layline, or selecting a side of a course in lighter winds based on current set/drift is qualitatively useful, but would you base a decision on a 0.2 kt difference alone? 

Share this post


Link to post
Share on other sites
3 minutes ago, LionessRacing said:

Other than academic pedantry, what is your goal with extremely accurate synthesized current values? 

Real currents are varying in 4 dimensions over ground and subject to wind shear as well in the realm you probably care about (the 1-2 meters you actually sail in) 

Knowing that you have gone from an adverse to favorable current makes perfect sense, and may often be accompanied by a temperature change as well

Knowing that your current direction has changed by > 15degrees makes perfect sense, as it may presage an eddy. 

Knowing that your current has changed magnitude by 20% or 1/2 kt also would make sense, as it would guide you in terms of favored course. 

Having said all of that; 

  • SOG/COG and bearing/Speed toward waypoint (VMC) are probably what you would navigate to in steady winds
  • BSP/TWA vs targets are what you would generally trim/steer to in variable winds
  • Knowledge that the current has changed as you near a layline, or selecting a side of a course in lighter winds based on current set/drift is qualitatively useful, but would you base a decision on a 0.2 kt difference alone? 

Really good questions.  There are two situations that I race in where this matters.  In the Master Mariners we need to decide if we should sail down the city front close to shore, or go out toward Alcatraz.  We sail through all the currents on the first and second legs and this is a decision that plays out on the third leg.  I won one year because I used just the difference in heading vs COG to estimate the current.  There were two tide lines and we went past the second one.  The the other is my beer can races where some of the courses are in the shipping channel, which is deep.  If we can measure the current approaching the channel, and again once we round the mark in the channel, we can see if we should stay in or take the longer course to get in a more favorable current.

The other reason is that I am a measurement guy.  I spent 20 years making the most accurate test equipment available. I lived measurement error analysis.  We made things that couldn't be done.  It is in my blood.  That is why I installed a second knot sender on the other side of the keel.  I can see that the heel angle changes the reading so I can average the two senders and hopefully eliminate the error.  I should say I don't know that this will eliminate that error, but I strongly suspect that to a first order it will and that is probable good enough as the error is significant but small.

So why do I strive for 0.1 knots?  Let me ask this.  If you are really interested in a 1/2 knot change in current, how accurate would you want the measurement to be?  Maybe a fifth of that perhaps?

The other thing is that I would like to know how quickly the current changes after we round "6" and head toward the airport.  If you follow me closely you may recall that we have a 2 mile last leg and that we do it with one tack.  Nobody does that.  Stay in the center of the course, etc, etc. But there is more chop in the center and less wind. Is there also more favorable current in the middle?  I have always ignored the current thinking the chop is the bigger issue.

So why do I do this?  I win most of the races I enter.  I won all three series last year and won the MM race by two minutes.  I don't need to do this to win.  It is just in my blood.

Share this post


Link to post
Share on other sites

I'm all for good data, starting at the raw sensor, positioning, etc, we run a silly amount of electronics & computation aboard for "beer cans", being an engineer who builds semiconductor devices to sub 100 nm horizontal and 10 nm vertical tolerances it's my reflexive choice to measure everything and analyze for improvement.  

But there's also the question of when is there enough anti reflective coating on the gilt on the lily... 

 

Share this post


Link to post
Share on other sites

It just seems to me that if you can't get the known errors down to about .1 knot, the measurement is just useless.  I mean, if I am successful, I will know that anything I read will likely be off by .1 knot and I only have .1 knot resolution/ noise so maybe I am off by .2 knots.  More error than that and you might as well use the tide table.  

Let me ask this.  If I am successful and can explain clearly what I have done so that others can repeat it, do you think anybody would be interested? @Moonduster says people have spend a trillion dollars trying to do this and nobody has been successful.  His implication was that I am wasting my time. I guess we will find out.

@LionessRacing I value your comments.  They have been most helpful.  I will let you know how it comes out one way or the other.

 

Share this post


Link to post
Share on other sites

I think your goal is worthy. 

I have  looked at a lot of 1Hz log file data, and most of what I found was pretty coarse issues when on the Estuary, have not done enough tuning in larger body at mid tide to evaluate. 

  • Wind shift: speed, direction, gradient
  • depth 10’ change in less than 50’ depth 
  • shoreline/depth contour angle change 
  • shoreline roughness/features 

i referred to chart features vs position,  depth measurements, TWD calculated, rudder angles etc. 

first order would be to have confidence in single measurement accuracy and precision,

does your Time series of heading reflect measurement or steering ? I tend to have 2 degree rudder angle sigma  

My compass is near center of mass/buoyancy and gps sits on stern rail, gives opposite direction of change in hard turn, can be simple data filter: if different signs ignore  

 

Share this post


Link to post
Share on other sites

Well, what can I say.  The compass is low and just a tad aft of the mast. About a foot off the cabin sole.  The GPS is not ideal, in the cabin port side window.  But I can see it works well there so have not spent the time to move it.  My RaceBox records everything once per second.  That is how I was able to go back and see what the depth was after our discussion.  I do not measure rudder angle and of course, all this current data is gathered under power.  My hope is that the propeller is not influencing the boat speed measurements and that my dual knot sender will remove heel issues.  Of course when I am done, who will be able to tell if I am wrong?

Sailflow says stay away from the harbor and away from the main channel and I should get a fairly uniform current field.  A bit further to go than what I have been doing but worth it if it gives the results I am looking for.  I think I will know if the depth is relatively constant across my measurements.  Go out on maximum current away from shore.  Hopefully that will give good results.

As far as making it so I can change course and not change the reading, that is another project.

Having all this data is very helpful.  When I was hit, it was asserted that I changed course in front of Seaward. My GPS told a story of my holding course until I was accelerated from 6 knots to 7 knots in a one second interval. I did a sudden 180 degree course change shortly after that. I shared that data with Latitude 38 and got a very fair write up in the next issue.

Allen

6 minutes ago, LionessRacing said:

I think your goal is worthy. 

I have  looked at a lot of 1Hz log file data, and most of what I found was pretty coarse issues when on the Estuary, have not done enough tuning in larger body at mid tide to evaluate. 

  • Wind shift: speed, direction, gradient
  • depth 10’ change in less than 50’ depth 
  • shoreline/depth contour angle change 
  • shoreline roughness/features 

i referred to chart features vs position,  depth measurements, TWD calculated, rudder angles etc. 

first order would be to have confidence in single measurement accuracy and precision,

does your Time series of heading reflect measurement or steering ? I tend to have 2 degree rudder angle sigma  

My compass is near center of mass/buoyancy and gps sits on stern rail, gives opposite direction of change in hard turn, can be simple data filter: if different signs ignore  

 

 

Share this post


Link to post
Share on other sites

You've missed the point entirely.

Let's say, for the sake of argument, that you decide you've accomplished your goal. How do you expect to validate your results? Show your work.

 

Share this post


Link to post
Share on other sites
8 hours ago, Moonduster said:

You've missed the point entirely.

Let's say, for the sake of argument, that you decide you've accomplished your goal. How do you expect to validate your results? Show your work.

 

I believe that if I measure the current at a point in a uniform field from several directions and get the same result that the only way that can happen is if that result is correct.  But ultimately I will probably drop a box in the water that measures the current and see if my measurements on the boat agree.

The trick is to find a uniform current field.  I already know from this work that you have to go out at max current, either flood or ebb, and not at slack.  Now I need to try and find an area away from shore that has either a constant depth or a gradual slope.

I think this would be a good spot.  37.672702, -122.345433

So what is the point I missed entirely?

 

Untitled-1.png

Share this post


Link to post
Share on other sites
2 hours ago, allene222 said:

I believe that if I measure the current at a point in a uniform field from several directions and get the same result that the only way that can happen is if that result is correct. 

One trick is that the "uniform field" will not be uniform in time, even if it was uniform in rate and direction (X,Y,Z) over the area you expect to measure. 

You may be able to get a result that shows the current set and drift changing in a sensible manner as you make repeated runs if your runs are short in time vs change in current, but you are looking at the derivative of a sinusoid, where the max rate of change is about the same time as the strongest current on average.

With the capacity of the bay and the resistance of the Gate as analogs to a circuit, neither of those is fixed, but a function of the local height of tide, literally position of the sun/moon for the driving force and the meso and local winds. 

For example at pier 1, with the static gauge: (those trillions of dollars) 

https://tidesandcurrents.noaa.gov/ports/index.html?port=sf 

gives this https://tidesandcurrents.noaa.gov/myports/data.shtml?plot=9414290_wl_72.png 

where you can see the differences in predicted vs observed water. 

fitting the observed vs rate of change and coloring for water temp you get this...  where it makes sense that the lower tide is warmer, and the incoming tide is is colder. the loop in the middle may be essentially the higher/lower tides of the day giving an apparent cardioid 

X axis is height of tide, Y axis is rate of change at 6 min intervals

Fit Y by X.png

Share this post


Link to post
Share on other sites

The maximum rate of change in current is at slack and the minimum rate of change is at max current. For example, the max current at 10AM is about 1 knot and at 9AM it is listed at .9 knots.  I need more resolution or some math but compare that to slack where an hour off the current is half a knot.  So the change is small but I make three runs and not two so N-S-N runs allow me to average the two north runs and compare that to the south run.  That may not be valid if I am really at peak current but at peak current the rate of change is zero.  

At first I measured at slack and the rate of change in current killed me.  That is when I realized I want low change and not low current.

I should add that if there is no wind, I can just drift and measure the current with the GPS on the boat.

The other thing I noticed is that the tide tables are off. 

Share this post


Link to post
Share on other sites
2 hours ago, Moonduster said:

You could get a 0.0 1000 times in a row with no effort expended. Would that be a valid result?

 

And your point is?  

Share this post


Link to post
Share on other sites
3 hours ago, LionessRacing said:

One trick is that the "uniform field" will not be uniform in time, even if it was uniform in rate and direction (X,Y,Z) over the area you expect to measure. 

You may be able to get a result that shows the current set and drift changing in a sensible manner as you make repeated runs if your runs are short in time vs change in current, but you are looking at the derivative of a sinusoid, where the max rate of change is about the same time as the strongest current on average.

With the capacity of the bay and the resistance of the Gate as analogs to a circuit, neither of those is fixed, but a function of the local height of tide, literally position of the sun/moon for the driving force and the meso and local winds. 

For example at pier 1, with the static gauge: (those trillions of dollars) 

https://tidesandcurrents.noaa.gov/ports/index.html?port=sf 

gives this https://tidesandcurrents.noaa.gov/myports/data.shtml?plot=9414290_wl_72.png 

where you can see the differences in predicted vs observed water. 

fitting the observed vs rate of change and coloring for water temp you get this...  where it makes sense that the lower tide is warmer, and the incoming tide is is colder. the loop in the middle may be essentially the higher/lower tides of the day giving an apparent cardioid 

X axis is height of tide, Y axis is rate of change at 6 min intervals

Fit Y by X.png

I found it useful to look at the current data on SF Ports.  There are only a few current stations and I looked at Southampton.  The current there is much stronger than where I am, which is good, but it is pretty chaotic over the timeframe I would need so that may be an issue as you point out.

What I am getting from this is I need to be more sensitive to the total time of the measurement and specifically that the N-S measurements are in the same timeframe as the E-W ones.  I think I will do something like N-S-E-W-N.  Maybe do a box rather than an X as it would be quicker. Maybe there is another pattern that would provide more measurements and some redundancy yet not take too much time.  Isn't this interesting?

Share this post


Link to post
Share on other sites

You said:

I believe that if I measure the current at a point in a uniform field from several directions and get the same result that the only way that can happen is if that result is correct.  But ultimately I will probably drop a box in the water that measures the current and see if my measurements on the boat agree.

I said:

If your result was always 0.0, it would meet the criteria above. Does that mean it's correct? My point is that there are an infinity of results that meet your criteria and are not valid measurements.

My point remains:

You don't understand the error bounds on your result and you have no way to validate your result. The combination means you cannot determine whether your results have any meaning.

Food for thought:

What is the contribution to your sensor inputs (GPS, paddle wheel) attributed to your boat's yaw, pitch and roll rates?

What is the effect of your boat's attitude (pitch and roll angles) on your paddle wheel?

Share this post


Link to post
Share on other sites

If I go at 6 knots into the current, then turn and go the same speed against the current, there are not an infinite number of results that meet the criteria.  I assume the GPS is correct.  If it is not, then current cannot be measured.  If they are correct., then I have two variables and two equations and there is only one solution.  Same goes for another direction but now I have only one variable (the compass) but still two equations so there is somewhat of a check on the result.

Error bounds are difficult to determine.  The GPS speed accuracy specification is .05 m/S which is about 0.1 knot by itself.  But I know that is not correct because if I take a GPS module and just sit it there it reads 0 knots to within about 0.02 knots, which is accurate enough.  So that is not really an offset.  And it is not expressed as a gain.  So I really have no way to know what the real accuracy of a GPS at 6 knots is when averaged enough to bring the noise down to 0.02 knots.  The paddle wheels have gain and offset adjustments to linearize them.  That allows me, if I can calibrate them accurately, to get two points and the rest will be off somewhat. But my boat generally goes more or less one speed so I will live with that as well.  Very difficult to measure the linearity but I have given it a shot and think it sufficiently close.

In terms of boat attitude, a lot of that comes out in filtering.  On thing that does not is boat heel.  The paddle wheel reading changes with boat heel for a given boat speed.  But I have two, one goes up in reading and the other goes down.  I am assuming that the average stays constant with heel.  I don't know that for sure but think it a good first order assumption.

Of course when the boat heels there is also leeway which is basically impossible to measure. So that might change the current readings. I will get this working under power and then perhaps I will be able to use that knowledge to estimate leeway.  Sail with an against the current and see what leeway coefficient makes the reading agree.

I think I have a better chance than most in getting good measurements because 1) I have good instrumentation, 2) I am putting a ton of time into calibrating them, and 3) I have complete control over the computations behind the instruments.  That said, I have great respect for the effort involved in calibrating yachting instruments.  It is exceedingly difficult.t

@Moonduster I still can't tell if you think you are being helpful or just shoveling shit. My hope is that you are trying to be helpful and it is in that spirit I am replying.  But I am not sure.

This post is titled "Anyone measuring tidal currents?"  So far the answer is no.

Share this post


Link to post
Share on other sites

Some rough numbers.  Looking at January 18 as a target date.  Thinking about a pattern out in the bay away from shore and doing a S-N-E-W-N-S pattern.  The end two runs should tell me what the current is as they are runs aligned with the prevailing current and should tell me if it changed during the test interval. If I can hit peak current, which is about .7 knots, the change is .02 knots across the measurement time according to XTide.  I am unlikely to hit peak as the tide tables are not that good and reality means the actuals don't look as good as the predictions but still should be pretty good.  Contrast that with going out in slack water where across a measurement time the current would change 1/4 knot.  The bay should be pretty constant depth out there, the current pretty much constant.  I can make these X patterns across the same spot once I get my artificial waypoint programmed.  I will have some heading errors due to the current as the test plane will move about 1/3 nautical mile during the test but I should be able to compensate for that.

I am probably missing something but that is what I have so far.  Should be an improvement.

I modified one of my tide pages to print out more values and more digits.

http://L-36.com/temp.php?location=Oyster+Point&depth=&zoom=10&target_month=1&target_day=18&target_year=2018

Share this post


Link to post
Share on other sites

Dude,

Your criteria was that if your result was the same irrespective of direction sailed, that it must be correct.

The problem with that (specious) claim is that ANY constant fulfills it. If your algorithm always displayed 1.0 knots from 000º, that would be "correct". If it always displayed 3.7 knots from 123º, that, too, would be "correct".

So, generally speaking, if we consider that speed must be in the range of 0…582700000 knots (that's the speed of light) and direction must be in the range 0…359º, then we get about 210 billion "correct" possible values with no decimal places in the possibilities. Add one decimal place for each of those factors and we quickly get to 21 trillion. Again, there are an infinity of solutions that fit your criteria and all but one are wrong. What are your odds?

Even if we constrain speed to 6 knots, and one decimal place for direction and speed, there are some 2 million possible answers and if you're willing to toss ±0.5 knots and ±0.5º out the window, then all but 100 of those answers are wrong.

I don't agree with your claim that determining error bounds is difficult. It's all but impossible, more so when you don't have detailed information about the implementation of complex sensors such as GPS receivers.

Your claim that a GPS sitting on a table yielding ±0.02 knots of speed is evidence that the GPS outperforms the manufacturers specifications of ±0.2m/s indicates you have absolutely no understanding of possible sources of error once that GPS receiver begins to move. Or when it's antenna is over water, which leads to orders of magnitude more multi-path error than terrestrial applications. Or when it's heeled 25º, which places 30% of the constellation below the antenna's horizon and undermines the statistical model used to derive the ±0.02 knots of speed quoted based upon idealized conditions.

You conclude by saying "I am probably missing something". Instead, it seems to me you're rather like the guy who built his own rocket for $20000 to launch himself to an altitude of 1 mile so that he could take a photograph to prove the earth was flat, but failed to obtain the necessary permits, which he now claims as proof of a government conspiracy while going on to say "there's no difference between science and science fiction". The funny part is that he could have purchased a coach plane ticket and gotten to 5 miles for $300 and looked out a window while sucking down a cocktail. And in either case, his camera lens' distortion would yield his results anecdotal at best.

You seem like a genuinely nice guy who's having fun dithering around with some odds and sods. However, when it comes to separating the wheat from the chafe in the realm of fusing datum from disparate sensors of accuracy that's indeterminate, I don't believe you're missing some thing. With all due respect, I'd suggest you're missing nearly everything.

 

Share this post


Link to post
Share on other sites

Allen, I race in the same waters as you, and several years ago I started making my own boat electronics for measuring current among other functions. I am certain accuracy is not 0.1 kts, but precision is probably in the ballpark. I think we're all on the same page that this will not be used in safety critical applications, so I'm ok with on the water validation-- driving in circles or crosses or whatever. I've got the current measurement refined enough that I no longer tinker with it, and now just use it. When the current drops below 0.5 knts, I put little faith the result, and I recognize that some component is due to my boat's leeway rather than current, but with that in mind, I find it valuable to racing on the SF bay. Here are some observations from my experience:

Spend time characterizing then compensating/calibrating your sensors. I've spent the most time on the magnetometer and it is still the weakest link. I've considered techniques that don't require a magnetometer, but they don't seem appropriate for a slow moving vehicle like a sailboat. One surprise from characterizing my sensors was the ~4 second lag from my Airmar DST800 speedo. Bench testing revealed this is an internal filter, not just paddlewheel inertia. To compensate, I run the other current measurement inputs through  matching delay filters. In short, rather than randomaly adjusting calibration on the water, instead perform targeted tests on each sensor, and then devise specific compensatons for each.

My algorithm is mostly just straightforward vector math, but I do filter the result with a 15s low-pass to remove wave induced noise. Those seconds feel like forever when I cross a current line and I'm waiting to see if I should tack back, so I may try reducing it. Filtering on magnitude/direction is theoretically better (when considering a step input to direction) than filtering on north/east components, but filtering direction has the added complexity of dealing with angle wrap.

An often overlooked consideration is making the results easily accessible while sailing. I keep current in my line-of-sight on a mast mounted display. I display the current vector with an arrow that is relative to my boat heading, so as I turn the boat, the arrow always points in the physical direction of water flow. Also, my display alternates every couple seconds between this current vector, and a number that is simply COG-Heading. This number just reminds me how many degrees off from my intended destination my bow should be pointed. Anybody can do the math in their head, and anyone with a chart-plotter will have an even better visualization, but I can't tell you how many times, in light air and strong current, I've seen racers not realize where their boat is actually going.  

Share this post


Link to post
Share on other sites

@Moonduster  Thanks for the input. I am still trying to figure out if you know what the hell you are talking about.  If I had to guess I would say no.  And, no offence, but I don't find you inputs helpful.  @LionessRacing on the other hand is also skeptical but has been very helpful. Perhaps you can read his posts and see the difference.  It might be a learning experience.

In case anyone is interested, I have the virtual marker working.  It is a box with a GPS in it with a reference of the GPS locations I posted.  It is a WiFi access point and has a web server in it.  Below is a screen shot of the display. I will use a tablet on my boat as the display.  It shows the speed and heading of the GPS as well as the distance and direction to the virtual marker.  Also shows time and battery voltage as it is Li Ion powered. If I decide another location would be better, the "Set" button will set a new marker location.

Let me say a bit about GPS accuracy.  I will model it as 5 terms.  Noise, offset, gain, linearity, and repeatability. I can filter noise, I don't observe any offset, the linearity is fine and I don't really care if my result of current is really off by a gain error in the GPS. I will just define my world as GPS knots.  So I am left with repeatability.  If I am going 6 knots on Tuesday and 6 knots on Wednesday will I get the same reading?  Probably more to the point is will the reading change when the constellation of satellites changes (or the boat heels). Case in point.  If the GPS is off by 5% always, then I am just calibrating my knotmeter to the GPS and if I read 1 knot of current, it is really just .95 knots.  Who cares.  But if it is off 5% one day and right on the next, then I could be in 0 knots of current and read .3 knots.  So I will agree with @Moonduster that error analysis is impossible with the degree of knowledge that I have.  But luck would have it that I don't need to prove my measurement is traceable to NBS.  I just have to find them useful. 

 

Image1.png

Share this post


Link to post
Share on other sites
20 minutes ago, wyatt said:

Allen, I race in the same waters as you, and several years ago I started making my own boat electronics for measuring current among other functions. I am certain accuracy is not 0.1 kts, but precision is probably in the ballpark. I think we're all on the same page that this will not be used in safety critical applications, so I'm ok with on the water validation-- driving in circles or crosses or whatever. I've got the current measurement refined enough that I no longer tinker with it, and now just use it. When the current drops below 0.5 knts, I put little faith the result, and I recognize that some component is due to my boat's leeway rather than current, but with that in mind, I find it valuable to racing on the SF bay. Here are some observations from my experience:

Spend time characterizing then compensating/calibrating your sensors. I've spent the most time on the magnetometer and it is still the weakest link. I've considered techniques that don't require a magnetometer, but they don't seem appropriate for a slow moving vehicle like a sailboat. One surprise from characterizing my sensors was the ~4 second lag from my Airmar DST800 speedo. Bench testing revealed this is an internal filter, not just paddlewheel inertia. To compensate, I run the other current measurement inputs through  matching delay filters. In short, rather than randomaly adjusting calibration on the water, instead perform targeted tests on each sensor, and then devise specific compensatons for each.

My algorithm is mostly just straightforward vector math, but I do filter the result with a 15s low-pass to remove wave induced noise. Those seconds feel like forever when I cross a current line and I'm waiting to see if I should tack back, so I may try reducing it. Filtering on magnitude/direction is theoretically better (when considering a step input to direction) than filtering on north/east components, but filtering direction has the added complexity of dealing with angle wrap.

An often overlooked consideration is making the results easily accessible while sailing. I keep current in my line-of-sight on a mast mounted display. I display the current vector with an arrow that is relative to my boat heading, so as I turn the boat, the arrow always points in the physical direction of water flow. Also, my display alternates every couple seconds between this current vector, and a number that is simply COG-Heading. This number just reminds me how many degrees off from my intended destination my bow should be pointed. Anybody can do the math in their head, and anyone with a chart-plotter will have an even better visualization, but I can't tell you how many times, in light air and strong current, I've seen racers not realize where their boat is actually going.  

Fantastic.  Great to hear someone else who has done this.  Your approach sounds similar to what I am doing except I have not gotten to the point of equalizing the delays like you have.  I always saw that as sort of a phase two as letting things settle always works instead.

My compass is a TackTick. I ran the recommended calibration but I don't know how good it is.  I think I have N and S pretty well dialed in but not sure about the linearity or its calibration.  My RaceBox has Sin and Cos compensation coefficients in it which are analogous to the screwdriver adjustments on a magnetic compass.  Perhaps you can tell me more about how you calibrated yours.

I made a mast mount two line display and have intended to show boat speed and TWA as I sail to those upwind.  When going to a mark, I sail to the mark using GPS heading. My sound system tells me what direction I need to go :-) I always envisioned using the current to tell me if it is worth going out of my way to get in a better current rather than a way to point the boat.  What are you using as your mast mount display?  My mast mount displays are large LCDs.  I also installed two Stowe Terminals, same device used by the AC crew in SF. I can write anything to them but just text and straight lines.  But I can put current on one of them.  

You say your speed sender has a delay.  I assume it has a nmea output, a "smart sensor".  If it is a hall effect device with a pulse output, I have a PCB and a receiver that would give you complete control over the delay.  That said, I am not saying there is anything wrong with what you have as I do a 1 second filter in the interface and then a 5 second average in the RaceBox so net is I probably have more delay than you do.  But if you are interested PM me and I will mail you a board free.  It has two inputs as I have two senders but it works just fine with just one.  By the way.  People question my motives when I say I will give things away.  There must be something wrong with them. What is the catch? There is an expression that fits and that is that I do it because I can.

Here is the knotmeter board. What I am offering is just the bare board and all the instructions, code, etc, that would go with it. But not the parts.

 

knotmeter.jpg

Share this post


Link to post
Share on other sites
Quote

  Thanks for the input. I am still trying to figure out if you know what the hell you are talking about.  If I had to guess I would say no.

Moonduster's responses might be a bit tough/corse sometimes but his knowledge base and real world application experience are worth vastly more than the zero dollars that was paid for them on these forums.

Share this post


Link to post
Share on other sites
1 hour ago, wyatt said:

One surprise from characterizing my sensors was the ~4 second lag from my Airmar DST800 speedo. Bench testing revealed this is an internal filter, not just paddlewheel inertia. To compensate, I run the other current measurement inputs through  matching delay filters. In short, rather than randomaly adjusting calibration on the water, instead perform targeted tests on each sensor, and then devise specific compensatons for each.

For what it’s worth, this is why I was advised to keep the simple paddle wheel and wire to H5000 (and the analog expansion for other side) vs using an NMEA output sensor. Not sure quite how many updates/sec or what counting/timing scheme B&G uses but looking at websocket, both update faster than 1 Hz. 

Bigger problem is non linearity at bottom end, gps is fine, paddles crap out below 1-2 Kts. Heading sensor (precision 9) shows ~1 degree sigma when rudder “quiet” and COG steady under sail 

 

Share this post


Link to post
Share on other sites

I may be in a fairly unique position to compare knot senders having two of them and two ways of reading one.  The Airmar came with the TackTick system and the newer sender is Signet.  TackTick deals with the non-linearity isse by just outputting 0 knots on anything below 1.2 knots.  It uses an Airmar sender. I linearize it to match the Signet by adding .7 knots to the reading.  It is a basic first order linearization of Y = mX + b and in this case m is .7.  That makes the two senders match and then I combine them by averaging except below 2 knots I just use the Signet thinking I won't be heeling at 2 knots.  (The Signet also has less noise.) Then I use a b or .3 knots.  This is difficult to calibrate as I need to do it against the GPS but there is current so a lot of guessing and these coefficients might be off.  But it is better than just turning the reading off at 1.2 knots.  I guess the one takeaway is that the Signet sender is a lot better than the Airmar. Unfortunately, the through hull is different so they are not interchangeable.

1 hour ago, LionessRacing said:

For what it’s worth, this is why I was advised to keep the simple paddle wheel and wire to H5000 (and the analog expansion for other side) vs using an NMEA output sensor. Not sure quite how many updates/sec or what counting/timing scheme B&G uses but looking at websocket, both update faster than 1 Hz. 

Bigger problem is non linearity at bottom end, gps is fine, paddles crap out below 1-2 Kts. Heading sensor (precision 9) shows ~1 degree sigma when rudder “quiet” and COG steady under sail 

 

 

Share this post


Link to post
Share on other sites
1 hour ago, solosailor said:

Moonduster's responses might be a bit tough/corse sometimes but his knowledge base and real world application experience are worth vastly more than the zero dollars that was paid for them on these forums.

Worth every penny I am sure.

Share this post


Link to post
Share on other sites
10 minutes ago, allene222 said:

.  I guess the one takeaway is that the Signet sender is a lot better than the Airmar. Unfortunately, the through hull is different so they are not interchangeable.

Next haul out the paddles get upgraded to Signets, and the ancient (2002) Interphase forward scan transducer swapped for more smaller modern Navico. All of which will add no speed, but keep me amused. 

The new Airmar leeway sensing device is cute, no real place to install on a full keel except centerline 

Have to check if it and forward scan are swappable. As center line is forefoot to 2’ lead, then board trunk after which you are 15’ back of waterline. 

Share this post


Link to post
Share on other sites
34 minutes ago, LionessRacing said:

Next haul out the paddles get upgraded to Signets, and the ancient (2002) Interphase forward scan transducer swapped for more smaller modern Navico. All of which will add no speed, but keep me amused. 

The new Airmar leeway sensing device is cute, no real place to install on a full keel except centerline 

Have to check if it and forward scan are swappable. As center line is forefoot to 2’ lead, then board trunk after which you are 15’ back of waterline. 

I am convinced that installing the full TackTick system, wind, depth, speed, slowed me down compared to the Moore speed sender I had.

That said, keeping the Airmar and adding the Signet turned out very favorable.  I have a large fin keel as you may know.  The rudder is hung on the keel and it starts about where the mast is.  If I was going to start from scratch, I would probably put the speed transducer forward of the keel but the old one was midship and that is where the Airmar went.  I put the Signet on the other side aligned with the Airmar.  That is when I saw that the readings were influenced by which tack I was on.  On port tack, one reading was higher and on starboard tack, the other one read higher.  I think averaging will take that out nicely.  At first I was concerned I was adding a noisy Airmar in with my quiet Signet but what I find is that while I am getting more noise, I am also getting twice the signal so the net has about the same signal to noise as the signet alone.  I know a guy who writes sailboatinstruments blog.  He says that measuring leeway is really an exercise in uncovering errors in the compass.

With these second order measurements like leeway or updraft, my thought is you don't really want to know leeway or updraft.  What you want is current or TWD.  Last season I ended up just picking an updraft coefficient to make the TWD numbers read the same on both tacks both perpendicular to the wind. In other words, calibrate that which you are really interested in.  I think I used terms derived from wind speed and boat speed.  My experience is using boat heel is counterproductive as it is so noisy. I think when I want to add leeway correction to my current measurement, I will use wind speed and angle rather than heel. I mean, if you know wind speed and twa, you should know everything there is to know about how the boat is performing, its speed, heel, leeway, everything. If you don't, you are doing something wrong.

Share this post


Link to post
Share on other sites
10 hours ago, allene222 said:

With these second order measurements like leeway or updraft, my thought is you don't really want to know leeway or updraft.  What you want is current or TWD.  Last season I ended up just picking an updraft coefficient to make the TWD numbers read the same on both tacks both perpendicular to the wind. In other words, calibrate that which you are really interested in.  I think I used terms derived from wind speed and boat speed.  My experience is using boat heel is counterproductive as it is so noisy. I think when I want to add leeway correction to my current measurement, I will use wind speed and angle rather than heel. I mean, if you know wind speed and twa, you should know everything there is to know about how the boat is performing, its speed, heel, leeway, everything. If you don't, you are doing something wrong 

That’s a novel approach.

Perhaps you can ignore leeway, for me, it’s very real, and factors independently of current. You could model its effect as a local adverse current vector, but thjen current becomes TWA dependent, and you lose predictive value, which is what I use it for  

Heel as a correction to both boat speed and TWS would also be appropriate, your sensor’s flow path changes with it. In the extreme case of 90 heel, your anomometer cup is getting no driving force as all, the flow Is perpendicular to its axis. Averaging the left & right sensors would reduce some errors, but introduces others, yaw shows up as a differential for example. 

I select the leeward paddle, based on AWA (heel is also a choice) and ignore the windward one, which is running with its axis more vertical, (yaw sensitive) and in less  water

Share this post


Link to post
Share on other sites

I think this is a straightforward state estimation problem. I'll explain it across several posts, as I get time.

First let's tackle heading. If you use a few GPS antennas located strategically around the boat (one at the bow and one at the stern, for instance), the distance between the two is so high that they will give very good heading indication. Assuming 10Hz measurements, and a separation of 36 feet (to fit the L-36), the result is quite good.

5a4f8b0a81995_ScreenShot2018-01-05at9_24_25AM.png.fee4bf9fd5651655f01539cdfff2078e.png5a4f8b1864bf0_ScreenShot2018-01-05at9_24_21AM.thumb.png.2ce420737dc83304c179313947d64927.png

The two graphs show the noised data and the 1s averaged data.

  • +-5degrees is already comparable to compass error
  • The noise model is conservative, as it was given as pure white noise. In reality, GPS noise between receivers tends to be coupled, i.e. if one is misreading to the north and east, so does the other one. The real world scenario is at least 2x better.
  • Instrumentation which integrates a gyroscope and accelerometer would drive that heading accuracy to at least 10x better, and possible 100x better.

Conclusion: there is no need to go to heroic lengths to calibrate the compass. Two cheap uBlox GNSS (aka GPS) modules will give comparable performance, and coupling into an IMU will give much better performance. There are several open-source projects which will do this with minimal-to-no effort.

Share this post


Link to post
Share on other sites
1 hour ago, kubark42 said:

I think this is a straightforward state estimation problem. I'll explain it across several posts, as I get time.

First let's tackle heading. If you use a few GPS antennas located strategically around the boat (one at the bow and one at the stern, for instance), the distance between the two is so high that they will give very good heading indication. Assuming 10Hz measurements, and a separation of 36 feet (to fit the L-36), the result is quite good.

5a4f8b0a81995_ScreenShot2018-01-05at9_24_25AM.png.fee4bf9fd5651655f01539cdfff2078e.png5a4f8b1864bf0_ScreenShot2018-01-05at9_24_21AM.thumb.png.2ce420737dc83304c179313947d64927.png

The two graphs show the noised data and the 1s averaged data.

  • +-5degrees is already comparable to compass error
  • The noise model is conservative, as it was given as pure white noise. In reality, GPS noise between receivers tends to be coupled, i.e. if one is misreading to the north and east, so does the other one. The real world scenario is at least 2x better.
  • Instrumentation which integrates a gyroscope and accelerometer would drive that heading accuracy to at least 10x better, and possible 100x better.

Conclusion: there is no need to go to heroic lengths to calibrate the compass. Two cheap uBlox GNSS (aka GPS) modules will give comparable performance, and coupling into an IMU will give much better performance. There are several open-source projects which will do this with minimal-to-no effort.

Most interesting.  I love thinking about novel approaches. I have no shortage of GPS modules or active antennas so implementing it would not be a problem.  However, I get about 1/4 of the noise out of my compass compared to the plot you show and that is with the boat moving.  There might be some filtering in the compass so perhaps not a fair comparison.  I did a quick and dirty simulation by using my GPS locations when I was going 4.5 knots compared to the location 5 readings later. With that I got similar noise to the compass. But if I could get the same noise and not have the linearity errors of the compass that would be great.

There are two problems with this. One is a practical problem of finding where to mount the forward antenna.  The GPS accuracy falls off when the antenna is under a sail.  I have observed that so that is not theoretical.  I don't know how much it affects locations as I was looking at speed.  It would be very difficult to place an antenna forward that was not under a sail. I would say that is a risk. So I would ask the question, have you done this or is it theoretical?

The other probably more significant problem is that this only works if the two receivers are locked to the same constellation of satellites.  Doing that moves you from cheap GPS units to thousand dollar ones.  I have GPS boxes that can measure the difference in location between them and that moves several meters over time.  That is not noise, but drift so it cannot be filtered out.

Where this approach might be useful is in calibrating the compass.  I could compare my average compass reading to two GPS locations separated by 75 meters and monitor the satellites to make sure I had the same constellation for both readings.

Interesting and thanks for posting.  I look forward to your other posts.

Share this post


Link to post
Share on other sites
2 hours ago, LionessRacing said:

That’s a novel approach.

Perhaps you can ignore leeway, for me, it’s very real, and factors independently of current. You could model its effect as a local adverse current vector, but thjen current becomes TWA dependent, and you lose predictive value, which is what I use it for  

Heel as a correction to both boat speed and TWS would also be appropriate, your sensor’s flow path changes with it. In the extreme case of 90 heel, your anomometer cup is getting no driving force as all, the flow Is perpendicular to its axis. Averaging the left & right sensors would reduce some errors, but introduces others, yaw shows up as a differential for example. 

I select the leeward paddle, based on AWA (heel is also a choice) and ignore the windward one, which is running with its axis more vertical, (yaw sensitive) and in less  water

How do you measure leeway? 

I went back in my log and see that I do have both leeway and updraft correction turned on.  However, I do not use leeway in calculating TWD.  TWD readings are influenced by leeway and updraft but in opposite ways.  So it seemed to me it was better to just put in an updraft term that was perhaps smaller than the actual updraft and not introduce the considerable noise of the leeway number.  That approach also reduces the noise of the updraft term so I think it is much better. I do use leeway numbers in the current calculations so I am concerned with the noise.  I have two algorithms for leeway. One uses the heel sensor.  The other estimates heel based on wind.  My research says the wind one is more accurate but that work was based on a very limited set of theoretical boat data so I don't have huge confidence in it. But the match between the data I had and the model was better with the wind model. So maybe I will switch models if the leeway noise is a problem in the current calculations.  Problem is that if you think current is hard to verify, think about leeway.

Share this post


Link to post
Share on other sites

There's an algorithm in both the H5000 and Expedition. From Expedition "help" 

Expedition uses the same equation as used by systems such as Ockam and B&G to estimate leeway.

The calibration values are leeway coefficient(s), k, such that

Leeway = k . heel / bsp2

The hard part is estimating the value of the coefficient, k. In practice we bias k to upwind sailing as the leeway is larger and more important upwind.

For many purposes a value of 10 to 12 will suffice.

Because the ideal value of k varies at different angles, Expedition also allows the use of a table of leeway calibration values. These are just the coefficients at different wind angles and speeds.

So, given a VPP from the yacht designer with bsp, heel and leeway, it is relatively easy to generate a corresponding mean value or table of leeway coefficients.

Note that heel and leeway should be +ve on port, see calculations.

 

Not too hard to verify, sail in reasonable wind and adjust  heading/ trim to produce variable heel/boat speed samples.

Look at your log file and fit "k"  from COG , HDG, Leeway while current is thought to be reasonably stable. 

Share this post


Link to post
Share on other sites
2 hours ago, allene222 said:

Most interesting.  I love thinking about novel approaches. I have no shortage of GPS modules or active antennas so implementing it would not be a problem.  However, I get about 1/4 of the noise out of my compass compared to the plot you show and that is with the boat moving.  There might be some filtering in the compass so perhaps not a fair comparison.  I did a quick and dirty simulation by using my GPS locations when I was going 4.5 knots compared to the location 5 readings later. With that I got similar noise to the compass. But if I could get the same noise and not have the linearity errors of the compass that would be great.

There are two problems with this. One is a practical problem of finding where to mount the forward antenna.  The GPS accuracy falls off when the antenna is under a sail.  I have observed that so that is not theoretical.  I don't know how much it affects locations as I was looking at speed.  It would be very difficult to place an antenna forward that was not under a sail. I would say that is a risk. So I would ask the question, have you done this or is it theoretical?

The other probably more significant problem is that this only works if the two receivers are locked to the same constellation of satellites.  Doing that moves you from cheap GPS units to thousand dollar ones.  I have GPS boxes that can measure the difference in location between them and that moves several meters over time.  That is not noise, but drift so it cannot be filtered out.

Regarding noise, I think you have such a huge baseline that you'll wind up with much better precision than the worst case scenario I predicted. And you could certainly average on a longer window which would give a better result. And don't neglect the huge impact which comes from tying in to an IMU. I know that's not something you can do without extra effort, but I think you'll be blown away at how much better the result becomes. 

We use GPSes like that on micro drones and full-scale airplanes (for the drones we use RTK receivers so we have >0.02m precision, which is important because the drones are 10x smaller than a 36 foot boat). I've never done it on a sailboat.

Interesting to know about the sail, I'm somewhat surprised it has a noticeable effect. Is it tack dependent, or is it enough that the antenna be near the sail? Have you thought about putting an antenna out on the bowsprit or above the pulpit? I have a trimaran, so not placing under the sail is a lot easier!

Thinking of pairing two GPSes together for RTK, there's a uBlox receiver which is RTK, but at much, much cheaper than standard modules. It's not as accurate, but for sailing purposes there's a drop-off once you're calculating heading better than 1deg.

Share this post


Link to post
Share on other sites
25 minutes ago, LionessRacing said:

There's an algorithm in both the H5000 and Expedition. From Expedition "help" 

Expedition uses the same equation as used by systems such as Ockam and B&G to estimate leeway.

The calibration values are leeway coefficient(s), k, such that

Leeway = k . heel / bsp2

The hard part is estimating the value of the coefficient, k. In practice we bias k to upwind sailing as the leeway is larger and more important upwind.

For many purposes a value of 10 to 12 will suffice.

Because the ideal value of k varies at different angles, Expedition also allows the use of a table of leeway calibration values. These are just the coefficients at different wind angles and speeds.

So, given a VPP from the yacht designer with bsp, heel and leeway, it is relatively easy to generate a corresponding mean value or table of leeway coefficients.

Note that heel and leeway should be +ve on port, see calculations.

 

Not too hard to verify, sail in reasonable wind and adjust  heading/ trim to produce variable heel/boat speed samples.

Look at your log file and fit "k"  from COG , HDG, Leeway while current is thought to be reasonably stable. 

That is also the algorithm I use.  I use k=6 and clip leeway at 15. I understand what you are saying about fitting k and will have to try that.  I don't actually recall how I got k = 6. It was probably a wag.

I have the option of using measured heel or a heel factor derived from wind. This was derived from VPP on a couple of boats and fit better than using heel.  I will offer it without comment:

        double wind_factor = max(min(1, rawNmea.tws / 14), 4/14);
        double heel_factor = wind_factor * cal_array[target_heel] *  pow((min( 1, ( 180 - abs_val(rawCalc.twa) )/85 )),2);


Target heel is 25.  You still need to determine "k".

Share this post


Link to post
Share on other sites
40 minutes ago, LionessRacing said:

There's an algorithm in both the H5000 and Expedition. From Expedition "help" 

Expedition uses the same equation as used by systems such as Ockam and B&G to estimate leeway.

The calibration values are leeway coefficient(s), k, such that

Leeway = k . heel / bsp2

The hard part is estimating the value of the coefficient, k. In practice we bias k to upwind sailing as the leeway is larger and more important upwind.

For many purposes a value of 10 to 12 will suffice.

Because the ideal value of k varies at different angles, Expedition also allows the use of a table of leeway calibration values. These are just the coefficients at different wind angles and speeds.

So, given a VPP from the yacht designer with bsp, heel and leeway, it is relatively easy to generate a corresponding mean value or table of leeway coefficients.

Note that heel and leeway should be +ve on port, see calculations.

 

Not too hard to verify, sail in reasonable wind and adjust  heading/ trim to produce variable heel/boat speed samples.

Look at your log file and fit "k"  from COG , HDG, Leeway while current is thought to be reasonably stable. 

That is also the algorithm I use.  I use k=6 and clip leeway at 15. I understand what you are saying about fitting k and will have to try that.  I don't actually recall how I got k = 6. It was probably a wag.

I have the option of using measured heel or a heel factor derived from wind. This was derived from VPP on a couple of boats and fit better than using heel. 

        double wind_factor = max(min(1, rawNmea.tws / 14), 4/14);
        double heel_factor = wind_factor * cal_array[target_heel] *  pow((min( 1, ( 180 - abs_val(rawCalc.twa) )/85 )),2);


Target heel is 25.  You still need to determine "k".

Share this post


Link to post
Share on other sites
18 minutes ago, kubark42 said:

Regarding noise, I think you have such a huge baseline that you'll wind up with much better precision than the worst case scenario I predicted. And you could certainly average on a longer window which would give a better result. And don't neglect the huge impact which comes from tying in to an IMU. I know that's not something you can do without extra effort, but I think you'll be blown away at how much better the result becomes. 

We use GPSes like that on micro drones and full-scale airplanes (for the drones we use RTK receivers so we have >0.02m precision, which is important because the drones are 10x smaller than a 36 foot boat). I've never done it on a sailboat.

Interesting to know about the sail, I'm somewhat surprised it has a noticeable effect. Is it tack dependent, or is it enough that the antenna be near the sail? Have you thought about putting an antenna out on the bowsprit or above the pulpit? I have a trimaran, so not placing under the sail is a lot easier!

Thinking of pairing two GPSes together for RTK, there's a uBlox receiver which is RTK, but at much, much cheaper than standard modules. It's not as accurate, but for sailing purposes there's a drop-off once you're calculating heading better than 1deg.

So basically you are using GPS receivers that lock to the same constellations.  This is what I was describing as receivers costing thousands of dollars but I may be seriously behind the times here. Maybe they are hundreds instead. I Googled and found a "fund me" project to build a low cost RTK receiver and see that they are using an Intel Edison.  They are so screwed as Intel obsoleted it with very short notice.  I know because I had a product that I had to redesign. I replaced an $80 Edison with a $10 ESP-8266*.  I have a ton of Intel Edisons and it is what is in my RaceBox (but I have lots of spares now).

As far as the sail goes.  This was two years ago so I don't recall the precise numbers.  We see 0.02 kt noise in the unit.  With the unit mounted on the cabin top we were getting terrible noise, probably at least 5x that, so made the decision to use a remote antenna, which turned out to be a pain. We have since combined the GPS and the processor in a stern mounted unit with and use a remote WiFi displays so no wires to deal with.   On the cabin top, the unit was under the boom and the mainsail.  On the bow the sail is off to one side so it may not be as big a problem as I was thinking.

What RTK receivers do you use? 

*The ESP-8266 is more like $3 but add charger and memory and it goes up a tad. Point is, Intel can't compete in this market. 

Share this post


Link to post
Share on other sites
6 hours ago, kubark42 said:

I think this is a straightforward state estimation problem. I'll explain it across several posts, as I get time.

First let's tackle heading. If you use a few GPS antennas located strategically around the boat (one at the bow and one at the stern, for instance), the distance between the two is so high that they will give very good heading indication. Assuming 10Hz measurements, and a separation of 36 feet (to fit the L-36), the result is quite good.

5a4f8b0a81995_ScreenShot2018-01-05at9_24_25AM.png.fee4bf9fd5651655f01539cdfff2078e.pngo go to heroic lengths to calibrate the compass. Two cheap uBlox GNSS (aka GPS) modules will give comparable performance, and coupling into an IMU will give much better performance. There are several open-source projects which will do this with minimal-to-no effort.

something like this ? https://www.sbg-systems.com/docs/Ekinox_Series_Leaflet.pdf with the twin GPS antenna fore and aft? 

 

Share this post


Link to post
Share on other sites
1 hour ago, allene222 said:

So basically you are using GPS receivers that lock to the same constellations.  This is what I was describing as receivers costing thousands of dollars but I may be seriously behind the times here. Maybe they are hundreds instead.

As far as the sail goes.  This was two years ago so I don't recall the precise numbers.  We see 0.02 kt noise in the unit.  With the unit mounted on the cabin top we were getting terrible noise, probably at least 5x that, so made the decision to use a remote antenna, which turned out to be a pain. We have since combined the GPS and the processor in a stern mounted unit with and use a remote WiFi displays so no wires to deal with.   On the cabin top, the unit was under the boom and the mainsail.  On the bow the sail is off to one side so it may not be as big a problem as I was thinking.

What RTK receivers do you use? 

You can (more or less) force the GPS receivers to lock to the same constellations by configuring the minimum elevation a satellite has to have before it is used. This isn't a sure-fire way, but it'll do you well enough in practice if you want to keep prices down.

Sounds like the mast and boom could also be the culprit, not necessarily the sail fabric. 

I don't think I can mention the specific RTK receivers. Just that they were above $10k/ea. The uBlox M8P, their RTK model, is ~$100/ea., or if you want cheap L1/L2 RTK, Swift Nav just released a $600 Piksi Multi (although their first Piksi was underwhelming in real-world conditions, so caveat emptor). I don't have any experience with the uBlox RTK modules, so I can't comment as to whether both modules can be on a roving platform or one must be immobile.

14 minutes ago, LionessRacing said:

something like this ? https://www.sbg-systems.com/docs/Ekinox_Series_Leaflet.pdf with the twin GPS antenna fore and aft? 

That's exactly it, but tactical grade, :o ! That's a way to spend more money on your instrumentation than your boat. ;)

I've had great results with an Invensense, they're about $2-3. They get used extensively in cell phones-- which is why they're cheap--, and in hobby/FPV drones-- which is why I know them quite well. The complete autopilots we designed for Tau Labs ranged from $12 to $100, depending on how much extra stuff there was on top. I think the latest $5 Invensense chips can even fly a drone with no other onboard processing.

Somethings you want to think about when you have this kind of precision is the GPS location relative to the center of rotation of the boat. You will absolutely see the pitching and rolling behavior as you sailed along. This has to be accounted for, but it's just an offset. And since it all averages out, the final result isn't that sensitive to the accuracy of the offset.

Share this post


Link to post
Share on other sites
3 hours ago, kubark42 said:

Thinking of pairing two GPSes together for RTK, there's a uBlox receiver which is RTK, but at much, much cheaper than standard modules. It's not as accurate, but for sailing purposes there's a drop-off once you're calculating heading better than 1deg.

I just did an experiment with two normal mode 2 GPS units.  Across 1/2 hour the reading of the distance between them, which is one of the readiouts, changed by more than a boat length (14 meters) so that is not going to work without the fancy linked together units.  I will check and see if I can program my units to min elevation and run an experiment to see how well that works.

$10K each.  That is more what I was think, which is of course out of the question.  The u-blox says they have different modes. Stationary, moving, and both moving. And of course, stand alone.  It is less clear what the accuracy is in the different modes. The u-blox neo-m8p is $160 for just the chip at Digi-key.  Not sure I want to be the pioneer on this.  I am going to try to calibrate what I have first.  I think it will work.

Share this post


Link to post
Share on other sites

14m, wow. That'll definitely cause issues! A couple questions so that if we repeat the experiment we know what's already been done:

  • Are these the Mediatek receivers?
  • Were the receivers at least 2m off the ground? During drone landing/takeoff, we've noticed that ground-plane reflections can cause the GPS to deviate 1-2m horizontally when the GPS antenna is less than 2m off the ground.
  • Were there any buildings nearby which could have caused multipath?

Really cool of you to do these tests in the middle of the winter. It's going to drop below 0 tonight in Boston. I'm kind of loathe to go see my boat, floating off the Mass coast and certainly under a foot of snow and ice. I had planned to keep sailing all winter, but the past two weeks have been so cold my crew has shown discretion to my valor!

Share this post


Link to post
Share on other sites

So perhaps a question for the less code savvy:

Are there any products/kits/projects that one could plug two NMEA 2000 GPS units that are already Marine grade in mount and wiring (thinking a second Navico ZG100 $199) via NMEA 20000 Canbus and have it spit out PGNs that would include each individual units data and the synthesized heading and other axes based on relative motion? 

With a bow/stern centerline install I would get:

  •  bow & stern position which should give 
    • heading & trim as the static solution between positions
    • drift/yaw, and heave/pitch as the common/differential derivatives. 

I've already got the nice Fluxgate with MEMS accelerometers (Precision 9) which is a ~1 degree product and subject to deviation. 

Based on a quick look at precision of 1E-7 degrees or ~ 11cm that's about 0.03 degrees on the 6 meter baseline (LOA/2)   

Share this post


Link to post
Share on other sites
1 hour ago, kubark42 said:

14m, wow. That'll definitely cause issues! A couple questions so that if we repeat the experiment we know what's already been done:

  • Are these the Mediatek receivers?
  • Were the receivers at least 2m off the ground? During drone landing/takeoff, we've noticed that ground-plane reflections can cause the GPS to deviate 1-2m horizontally when the GPS antenna is less than 2m off the ground.
  • Were there any buildings nearby which could have caused multipath?

Really cool of you to do these tests in the middle of the winter. It's going to drop below 0 tonight in Boston. I'm kind of loathe to go see my boat, floating off the Mass coast and certainly under a foot of snow and ice. I had planned to keep sailing all winter, but the past two weeks have been so cold my crew has shown discretion to my valor!

Just two units sitting on the window sill on the second story.  But they do show the .02 knots speed readings so they are getting some reasonable signal.  This kind of error shows up over hour timeframes so I would like to see something close to good enough before driving out to the baylands and spending that kind of time watching grass grow looking for the ultimate accuracy.  You are not going to get 2m off the water on a boat.  At least not on my boat.

These are the MTK3339 v3 chips.  Both the same.  I have 18 of them right here in my study right now.  I can't find specifically a min elevation function.  The only thing I can find that might be it as I don't it is Packet Type: 223 PMTK_SET_AL_DEE_CFG.

Best I can find for a development board would be this https://drotek.com/shop/en/rtk/794-tiny-rtk-gps-neo-m8p-2.html

I see they also list a SMARTNAV that is no longer in stock and looks like it is also based on an Intel Edison.  Another sucker who trusted Intel.  Sure glad I don't work there any longer :-)

Share this post


Link to post
Share on other sites

Gents

This is getting interesting.  I fear the danger of small yachts sinking overloaded with electronics, and I have a vision of boffins having a port and starboard incident, being focussed on current within 0.1 knots.

Keep it up.

  • Like 1

Share this post


Link to post
Share on other sites

I need to say something about the 0.1 knot goal.  I come from the instrumentation world.  In that world you want to have your instruments be at least 5 times as accurate as what you are interested in.  So if you are interested in 1/2 knot, you want to have 0.1 knot accuracy.  I mean, if the accuracy were 1/2 knot, I could just look at the wake on the channel marker and get that close.

Share this post


Link to post
Share on other sites

Allen, Sorry to have abandoned you after Post #5 but I thought the thread had died. Picking up on a recurring theme of turbulent/non-uniform/non-laminar flow in your test runs possibly limiting your results, please let me reiterate the advantages of a current-free, wind-free test area. I submit there is no really good place like this on the open SF Bay as I notice unexpected current variations traversing it, usually on the way back to Marina Bay.

That is why I use a deep, long, straight, uniform, dead-end channel for these measurements. Simplistically, at the dead end there is never any (horizontal) current at all. Around high tide I see little turbulence for a reasonable distance away from the end. The Santa Fe Channel in Richmond is the only place I know around here with these properties. This place also has little wind, especialy in winter since it is, after all, located in the "Richmond Riviera." It is amazing how the measured current settles down and makes sense as you round the first turn past Marina Bay entrance, and slowly goes to zero after rounding the second turn and passing KKMI/Richmond.

On a good day (no wind) you can drift (or motor into the current) between turns 1 and 2 and make an actual measurement of current with your GPS. One disadvantage is that there is substantial steel around in certain places to effect magnetic compasses although, based on using my autopilot, it so far doesn't seem to have effected me. Another is the guys at KKMI will yell at you if you go too often, too fast. But an advantage is that if you let me know ahead of time we can meet at the RYC for a beer.

 

Share this post


Link to post
Share on other sites
20 hours ago, DuncanR said:

Gents

This is getting interesting.  I fear the danger of small yachts sinking overloaded with electronics, and I have a vision of boffins having a port and starboard incident, being focussed on current within 0.1 knots.

Keep it up.

No doubt the gods are laughing somewhere... went out today, and had engine failure due to alternator belt loose not charging battery, and  when sailed back into slip, found the shore power had been disconnected at post and switched off...  

Share this post


Link to post
Share on other sites
1 hour ago, The Smokester said:

Allen, Sorry to have abandoned you after Post #5 but I thought the thread had died. Picking up on a recurring theme of turbulent/non-uniform/non-laminar flow in your test runs possibly limiting your results, please let me reiterate the advantages of a current-free, wind-free test area. I submit there is no really good place like this on the open SF Bay as I notice unexpected current variations traversing it, usually on the way back to Marina Bay.

That is why I use a deep, long, straight, uniform, dead-end channel for these measurements. Simplistically, at the dead end there is never any (horizontal) current at all. Around high tide I see little turbulence for a reasonable distance away from the end. The Santa Fe Channel in Richmond is the only place I know around here with these properties. This place also has little wind, especialy in winter since it is, after all, located in the "Richmond Riviera." It is amazing how the measured current settles down and makes sense as you round the first turn past Marina Bay entrance, and slowly goes to zero after rounding the second turn and passing KKMI/Richmond.

On a good day (no wind) you can drift (or motor into the current) between turns 1 and 2 and make an actual measurement of current with your GPS. One disadvantage is that there is substantial steel around in certain places to effect magnetic compasses although, based on using my autopilot, it so far doesn't seem to have effected me. Another is the guys at KKMI will yell at you if you go too often, too fast. But an advantage is that if you let me know ahead of time we can meet at the RYC for a beer.

 

I have seen really chaotic current in SF Bay many times. You can even see it in the bay model if you ever have a chance to hear Kame's talk.  I would hate to try and find a good test area in the north bay.  But I don't see that kind of chaos in the south bay especially around where I am planning on doing my next test.  Maybe the south bay is like one of those long channels you are talking about. You can see the target area in post 29.

Share this post


Link to post
Share on other sites
22 minutes ago, allene222 said:

I have seen really chaotic current in SF Bay many times. You can even see it in the bay model if you ever have a chance to hear Kame's talk.  I would hate to try and find a good test area in the north bay.  But I don't see that kind of chaos in the south bay especially around where I am planning on doing my next test.  Maybe the south bay is like one of those long channels you are talking about. You can see the target area in post 29.

Hard to know without doing measurements. I've only been to the South Bay a few times for spinnaker runs. Seems to be a shallow area with a large head of water behind it. 

Seen Kame's talk which is excellent. Sitting on top of Angel Island on a calm, clear day is also educational re currents. 

Where is your boat berthed? If you are going to spend all this effort I think you would be better off going to the Santa Fe Channel which is a deep (>40 ft), wide dredged channel with square sides and long, straight sections supporting laminar flow. On an ebb tide, the head, and hence the flow rate, can be selected by the distance from the dead end. Between turns 1 and 2 there is enough room for N-S and E-W transects. 

Share this post


Link to post
Share on other sites
12 minutes ago, The Smokester said:

Hard to know without doing measurements. I've only been to the South Bay a few times for spinnaker runs. Seems to be a shallow area with a large head of water behind it. 

Seen Kame's talk which is excellent. Sitting on top of Angel Island on a calm, clear day is also educational re currents. 

Where is your boat berthed? If you are going to spend all this effort I think you would be better off going to the Santa Fe Channel which is a deep (>40 ft), wide dredged channel with square sides and long, straight sections supporting laminar flow. On an ebb tide, the head, and hence the flow rate, can be selected by the distance from the dead end. Between turns 1 and 2 there is enough room for N-S and E-W transects. 

I am at Sierra Point, about 3 hours from Richmond.  One thing to remember is I need an area with a diameter of about .4 miles of constant current, or at least a gradual gradient.  I probably want to avoid dredged areas as they create sharp changes in current. We get about a knot peak current so not even close to what you have in the north bay.

Share this post


Link to post
Share on other sites

You wrote:

 In the extreme case of 90 heel, your anomometer [sic] cup is getting no driving force as all, the flow Is perpendicular to its axis.

Is that so? Do you think it turns backwards when inverted?

Sigh ...

 

Share this post


Link to post
Share on other sites
10 hours ago, allene222 said:

I am at Sierra Point, about 3 hours from Richmond.  One thing to remember is I need an area with a diameter of about .4 miles of constant current, or at least a gradual gradient.  I probably want to avoid dredged areas as they create sharp changes in current. We get about a knot peak current so not even close to what you have in the north bay.

Sierra Pt is a long way away.

The widest part of the Santa Fe Channel that is relevant is 0.2 nm but it is over 0.5 nm long. I'm not sure what the peak currents are but they are less than a knot. Don't forget, you can choose anything from the peak to zero if it's ebbing. I never see anything like turbulence or other instabilities. This is not like the Oakland Estuary which is open ended and which I have kayaked extensively. Very little traffic,  too.

What dictates the 0.4 nm? Time averaging?

Share this post


Link to post
Share on other sites
27 minutes ago, The Smokester said:

Sierra Pt is a long way away.

The widest part of the Santa Fe Channel that is relevant is 0.2 nm but it is over 0.5 nm long. I'm not sure what the peak currents are but they are less than a knot. Don't forget, you can choose anything from the peak to zero if it's ebbing. I never see anything like turbulence or other instabilities. This is not like the Oakland Estuary which is open ended and which I have kayaked extensively. Very little traffic,  too.

What dictates the 0.4 nm? Time averaging?

Roughly, it takes a minute to stabilize the readings after a turn and I like to get two minutes of data then another minute to get to the point to start the next run back.  That is four minutes per run and at 6 knots is .4 nautical miles.  I need to pick a peak current to minimize the change in change in current vs time.  My set of runs is about 1/2 hour and the current change across that time is small can I will be able to calibrate it out due to my multiple runs. The current changes fastest at slack so I want to avoid that although there is an argument that I am wrong about that and that what I really want is a linear change in current which would be at slack.  These criteria were all found out by having problems with previous runs.  If the weather is good, I might go out at 2PM today and give it another try.

I should know if I am in a steady current field just by observing my readout of current.  If it is steady, each run will show steady numbers, even if wrong.  If every run is steady, I have a steady current field.  If all the runs are the same, I am calibrated.  If all the runs are different, I can adjust my cal factors when I get home and based on the scatter of the data, have a pretty good idea if this is going to work.

Right now I think I have pretty good N-S data but my E-W data was in a channel and it is likely the current was different in the channel than it was outside it.  My best guess is that I have things off by .05 knots N-S and by some unknown amount E-W, perhaps by as much as 0.25 knots.

Share this post


Link to post
Share on other sites
6 hours ago, allene222 said:

...I should know if I am in a steady current field just by observing my readout of current.  If it is steady, each run will show steady numbers, even if wrong.  If every run is steady, I have a steady current field.  If all the runs are the same, I am calibrated.  If all the runs are different, I can adjust my cal factors when I get home and based on the scatter of the data, have a pretty good idea if this is going to work...

Roger all that. A steady readout is how discovered the Channel but I am not working to your level of understanding/accuracy quite yet.

Share this post


Link to post
Share on other sites

I took Papoose out into the cold hazy winter and made 7 runs out in a very consistent current field. The depth varied from 9.5 to 10 meters and the current was constant across the runs.  There are two ways to look at the results.  One is that it confirmed that I have 1/10 knot accuracy in that all the readings were between .7 and .9 knots and the best estimate of the current is 0.82 knots.  (The tide chart said 0.70 knots). The other way to think of the day is to use it as a new baseline with new coefficients which would give very little spread in the current (1/4 of a tenth).  That means I must go out again in an ebb tide (today was a flood) and use that run as a verification.  My concern is that I had to turn the gain of my knotmeter up about 1.6% to make the data fit the measurements and if I had to guess, I would have said I should turn it down.  I am concerned that the knotmeter may not repeat.  But the ratio of the two senders was very close to what it was on the last test day so likely that is not an issue.

My next run will be the end of the week, all going well.

Share this post


Link to post
Share on other sites

Today I did another cal run.  I picked a different location, one picked by looking for an area of constant current in SailFlow.  The main thing I learned was don't use SailFlow to find out where the current is constant.  Use depth off the chart and find an area of constant depth like I did last time. The previous area was much more constant in both depth and current.  That said, the current today was 1.4 knots so about twice what I had in the other area and in the opposite direction.  In terms of calibration, I decided to increase the E-W compass calibration by 1.5 degrees.  Speed was right on, which was encouraging.  I will probably go out again next week in the flood and see if this change holds up in the opposite current condition.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now