Thursday, January 13, 2011

Designing a custom sailboat instrumentation system

This blog's purpose is to document the design and commissioning of a custom instrumentation system installed in a small sailboat. The objective was to achieve superior accuracy through rigorous calibration procedures, with a refresh rate of 10 Hz on the following data:
  • apparent wind angle (AWA)
  • apparent wind speed (AWS)
  • boat speed trough water (STW)
  • true wind speed (TWS)
  • true wind angle (TWA)
  • velocity made good (VMG)
  • heel angle
  • leeway angle
  • heading
  • wind direction
  • speed over ground (SOG)
  • course over ground (COG)
  • GPS position
  • speed of current
  • direction of current
All live data is saved on hard disk for further analysis and calibration purpose. Custom software is used to build a number of displays, refreshed at 10 Hz, with or without damping.
Here is a list of the different components of the system, with links to some manufacturers and distributors sites.
1- BDMICRO MAVRIC-IIB Controller (ATmega128)   (www.bdmicro.com)

2- Olimex AVR-MT-128 Development Board (ATmega128)   (www.olimex.com , www.sparkfun.com)

3- Raymarine E22078 ST60 Wind Vane Transducer (www.raymarine.com , www.westmarine.com)

4- Airmar ST650 Speed Transducer (www.airmar.com, www.ebay.com, www.ebay.ca)

5- Airmar ST650 Speed Transducer (www.airmar.com, www.ebay.com, www.ebay.ca)

6- LS20031 GPS 5Hz Receiver (www.sparkfun.com)

7- Logic Level Converter (www.sparkfun.com)

8- Airmar H2183 Gyro Compass (www.airmar.com , www.blueheronmarine.com)

9- SeaTalk interface  (www.thomasknauf.de/seatalk.htm)

10- Raymarine ST40 Bidata Repeater (www.raymarine.com)

11- Raymarine ST40 Wind Repeater (www.raymarine.com)

12- CP2102 USB to Serial Converter (www.sparkfun.com)

13- Asus 1005HA Notebook

14- NavPixel NPD0835  8.4” IP-68 Sunlight Readable Touch Monitor

The role of each of these components will be further described in future postings.

15 comments:

  1. Very interesting!!! You have done some wonderful work. I have been thinking of using the Arduino board and a 3.5" touch screen to display engine information and was thinking of adding knotmeter and depth as well.

    Keep posting your progress and I would like to see pics as well.

    ReplyDelete
  2. Did you consider the parallax propeller processor also? It seems nice with 8 cores running at 20mhz each and 32 IO pins with some ADC and DAC in there also:

    http://www.parallax.com/ProductInfo/Microcontrollers/PropellerGeneralInformation/tabid/407/Default.aspx

    ReplyDelete
  3. I just looked at the datasheet. I would not see it as a practical alternative here, mostly because of the lack of hardware support for I2C, SPI, USART and ADC. All these functions would have to be emulated in software. The AVR hardware support for these functions is really equivalent to have parallel dedicated cores already programmed for these tasks. The Parallax does not support ADC, the datasheet only states that its internal counters could be used to help implement it, but it would necessitate supplementary external circuitry. There are also other points that would need to be checked, like floating-point math support, 3.3 V operation vs 5 V, and external instead of internal EEPROM.

    Porting my project to this microcontroller would be a huge task, but I would take pleasure to do it, learning a new language and environment (particularly replacing the interrupts by parallel processes running in their own cores).

    ReplyDelete
  4. This is a tilt compensated compass for a nice price, 75 Hz update rate with 45 sample buffer being used
    http://www.robot-electronics.co.uk/htm/cmps10doc.htm

    ReplyDelete
  5. Last year, I started a similar project using a small Linux computer call a TS7500 from Technologic Systems. This is a 250mHz ARM processor with E-net, CAN (NMEA 2000), USB, low power <2 watts and few serial ports. My test show that it can easily operate at a 10 to 20hz update rate.

    I build a daughter board to provide 6-32v operation, CAN, fastnet and Serial transceivers.

    Communication was to B&G displays via their Fastnet interface (a serial interface at 28.8kb binary) and support for few of B&G analog gages via CAN (I like analog gagues)and various mast head and sensors for input.

    Status: project has been on hold for over 6 mo, due to my time constraint.

    Interface to sensors is via NMEA2000 in a PIC24 custom development board. Wind, boat speed and compass have been prototype and tested. Some testing has been done to the B&G gages. (They use a Sin-Cos voltage output)

    What I realized is that in most boats (ships) their are a number of sensors that are redundant and one need to build a system to assign a priority to each, time stamp the data and if its too old, to get the data from the next source. When the primary return, to move back to it.... This is the key to building a robust system that works when systems fail.

    Not sure when I will get back on track with this... but its been fun...

    http://www.embeddedarm.com/products/board-detail.php?product=TS-7500


    tom

    lafleur@lafleur.us

    ReplyDelete
  6. For heading sensor, why not build a dual, or tri-antenna GPS heading sensor? Something like this but http://www.mackaycomm.com/specs/SC110/SC110%20Brochure.pdf or http://www.mackaycomm.com/specs/SC110/SC110%20Brochure.pdf but self made and affordable?

    ReplyDelete
  7. Just curious, have you thought of moving to a Raspberry Pi? I'm currently about to undertake a similar project and love how capable the PI seemed while removing a decent amount of hardware.

    ReplyDelete
    Replies
    1. The Raspberry Pi could never replace the 2 AVR microprocessors in this system, because it lacks a real-time operating system, which is critical here. It could maybe replace the laptop by reading the serial output from the main controller, but you will still have to provide a suitable display, and the fast storing device provided by the laptop.

      Delete
    2. The Pi is fast enough to keep up with most task that are needed on a boat... YES, the basic system has to hard real time support, but that just not needed for most things... It can read sensor, deal with multiply NMEA data stream in and out, support NMEA2000 "CAN" and still have time for Ethernet communication... And if you need some real time capability, their are a number of Low Latency extensions that can be added to the Pi Linux... It can be done, just try it... tom @ lafleur . us

      Delete
  8. Yes, a Pi would be a great device to replace the TS series of processors, but its the software and the development tool, not the hardware that limits what you can do....

    Moving to a Pi would be easy... just not enough time... keep me posted on your project...

    tom @ lafleur . us

    ReplyDelete
  9. Very interesting project, one thing you should look at doing is replacing the Raymarine Mast Head Unit with a B&G 213 (The H3000 varient) as this will give you a much more accurate measured wind speed and wind angle than any of the other sensor on the market.

    ReplyDelete
    Replies
    1. The ST60+ wind vane is based on the Senson 2SA-10 Integrated 2-Axis Hall Sensor chip. The datasheet claims a max. angle error of less than 1 degree. Do you know what technology is used in the B&G vane? I would like to compare the accuracy of the 2 units.

      Delete
  10. Is this project because of basic raymarine instruments?

    I have old NKE topline system with wind, speed and depth sensors and it provides most of the data you listed. I am building a separate digital compass based on LSM303DM module and Seedstudio Arch board. For a chart plotter I use Navionics Europe on my Tianhe i9377 Android 4.1 GPS smartphone.

    ReplyDelete
    Replies
    1. No, the Raymarine masthead unit was chosen specifically for this project because it could be interfaced easily with a custom system with a 10 Hz update rate. And the Raymarine ST40 displays are only repeaters that show custom data from the system.

      Delete
    2. Why do you not have a depth sounder in your system if you want integrate all data?

      For a display it would be easier and a lot of cheaper to build own displays if you laready have a microcontroller, for exmple my compass use this one:

      http://www.ebay.com/itm/2-2-Serial-SPI-TFT-Color-LCD-Module-Display-240X320-w-PCB-Adpater-SD-Socket-/200935977876?pt=LH_DefaultDomain_0&hash=item2ec8b7b394

      Delete