Sunday, December 4, 2011
Rudder Feedback Servo
Ardino Ammeter
Sunday, July 17, 2011
Instrument Data Receiver and Display
Sunday, July 10, 2011
NewSoftSerial, Attachinterupt() and Pins 2,3
Thursday, July 7, 2011
Photogate RPM Sensor Testing
I have to paddlewheel setup on the stern and plugged into the arduino UNO. I'm getting consistent analog readings of; 20-30 for OFF and 700-900 for ON. The digital cutoff point is around 400. If I take it outside ambient UV light will cause the OFF readings to jump up to 200-300 so I'll need to build a cowling to go over the whole apparatus to block out ambient light. I used the RPM photogate code available here to test the sensor's digital readings.
Wednesday, July 6, 2011
Paddle Wheel on the Stern
Monday, July 4, 2011
Soling 1M Sailboat - ShortCircuit
After 3 months of building I now have a sailboat. The mask is about 5ft high and the boat is 3ft long. It should be a great platform to test my electronics. It is radio controlled with 2 channels, for rudder and sail position. The sails can be pulled in or let out so that you can sail from close hauled to directly down wind just like a full sized sailboat.
Photogate with 5ft of Servo Wire
Wednesday, March 30, 2011
GPS Logger + uBlox5 GPS
My parts finally arrived. I ordered a GPS logger from Adafruit and a uBlox5 GPS from DIY drones. Ublox has a program uCenter used to configure the uBlox5 GPS. The uCenter user guide is here. The GPS comes with an adapter so that it is compatible with the EM-406 type cable. So it works with the data logger which was designed for the EM-406.
Saturday, March 26, 2011
I2C sensors - Compass
- LSM303, $30, I2C, no internal calculations, accuracy depends...
- HMC6343, $150, I2C, tilt compensation calculated internally, accuracy of 2 degrees
- OS5000-s, $260, RS232, tilt compensation calculated internally, accuracy of 0.5 degrees
- I2C uses pins A4 for SDA (data) and A5 for SCL (clock)
- I2C needs Arduino librarywire.h>
- The default (factory) HMC6343 7-bit slave address is 0x32 for write operations, or 0x33 for read operations.
- The compass requres pull-up resisters on SDA and SCL to 3.3v and supply voltage of 3.3v
- The Arduino has built in pull-up resisters on A4, A5, but it is to 5v...
Tuesday, March 22, 2011
Paddlewheel Speed Sensor + Wind Vane Question
Sunday, March 20, 2011
Anemometer Nearly Done
Saturday, March 19, 2011
Finally got the photo interrupter working!
- look at the datasheet and see which side is the emitter and which is the collector.
- start by setting up the phototransistor as an analog input analogread() will output values from 0-1023
- look at the datasheet to see how much voltage and current the LED can handle. Mine was 50mA
- Hook up the LED to that output. In my case digital I/O gives 5V and 40mA.
- watch the serial monitor I started off getting values that ranged from 0 to 3, then after fiddling with resistors (taking away the resistor to the emitter and adding a 10K to the transistor).
- Got to the point where I read 10-20 when the gate was blocked and 1010-1020 when the gate is open. (my Photo interrupter took a 10K resistor, my Photo Reflective Sensor will take a 100k or 1m resistor all I have is 10K resistors and 5 of them in series brought the reading up to 400)
- Now change the code from analogRead() to digitalRead() (and switch the input wire) see if you get 111100001110001111 when you move something between the gate.
- Helpful forum post on troubleshooting a photogate
- Code and schematic on testing a photogate
- basic setup and pictures of a photogate, and code using attachinterrupt()
int val;
void setup()
{
pinMode(13, OUTPUT);
pinMode(2, INPUT);
Serial.begin(9600); // sets the serial port to 9600
digitalWrite(13, HIGH);
}
void loop()
{
val = digitalRead(2); // read digital input pin 2
//val = analogRead(0); // read analog input pin 0
Serial.print(val); // prints the value read
Serial.print(" "); // prints a space between the numbers
delay(100); // wait 10ms for next reading
}
Friday, March 18, 2011
SiRFIII GPS Logger Shield
The output from the EM-406a is in NMEA sentences. Each sentence starts with a '$'. There are a bunch of sentences that it can spit out, but only a few that we are interested in. For example sentences look at the EM-406a Manual.
- RMC-Recommended Minimum Specific GNSS Data, message 103,04
- - this has all the basic data that you'd want for a boat; lat, long, speed (in knots)
- VTG-Course Over Ground and Ground Speed, message 103,05
- - this will give us the heading relative to magnetic north. That way we can directly compare the reading from the compass
Telemetry Using Xbee Modules
Compass With Tilt Compensation
// I2C related constants and variables
// Library includes
#include
#define HMC6343Address 0x32
// Shift the device's documented slave address (0x32) 1 bit right
// This compensates for how the TWI library only wants the
// 7 most significant bits (with the high bit padded with 0)
int slaveAddress = HMC6343Address >> 1; // This results in the 7 bit address to pass to TWI
// Compass measurement related constants and variables
byte headingData[6];
void init_compass(void)
{
Wire.begin(); // Open I2C to HMC6343
}
void getCompassData(void)
{
int i;
Wire.beginTransmission(slaveAddress);
Wire.send(0x50); // Send a "Get Data" (0x50) command to the HMC6343
Wire.endTransmission();
delay(2); // The HMC6343 needs at least a 1ms (microsecond) delay
// after this command. Using 2ms just makes it safe
// Read the 6 heading bytes, MSB first
// The resulting 3 16bit words are the compass heading, the tilt and roll in 10th's of a degree
// For example: a heading of 1345 would be 134.5 degrees
Wire.requestFrom(slaveAddress, 6); // Request the 6 bytes of data (MSB comes first)
i = 0;
while(Wire.available() && i < headingvalue =" headingData[0]*256" tiltvalue =" headingData[2]*256" rollvalue =" headingData[4]*256" vbthetac="headingValue/10;">
Saturday, March 12, 2011
Sailing the Soling with a GPS onboard
View Soling in a larger map
- Top Speed: 3.5 knots
- Average Speed: 1 knot (included pre and post race)
Photogate RPM sensor
My next problem to solve is the implementation of a photogate as a paddlewheel boat speed sensor and a second photogate to count RPM on the anemometer. I found this great little project in instructables.com that uses the attachInterrupt() arduino function. I'll use the same thing.
Sunday, March 6, 2011
Current Plan of Attack
Arduino + GPS Data Logger
V0.1 - (done)
- GPS -measures at 1Hz to within 5m
- Position
- Vg - ground velocity
- time stamp
V1.0
logs:
- Arduino
- Vs - boat speed
- Va - apparent wind velocity
- Ba - Apparent wind angle (without correction)
- time stamp
- GPS
- Position
- Vg - ground velocity
- time stamp
V2.0
Logs:
- Arduino
- Vs - boat speed
- Va - apparent wind velocity
- Ba - Apparent wind angle (without correction)
- Ta - Apparent wind angle wi
- Phi - Heel angle
- C - course of the boat
- GPS
- Position
- Vg - ground velocity
- time stamp
V3.0
sends data to a computer via xBees
- Arduino
- Vs - boat speed
- Va - apparent wind velocity
- Ba - Apparent wind angle (without correction)
- Ta - Apparent wind angle wi
- Phi - Heel angle
- C - course of the boat
- GPS
- Position
- Vg - ground velocity
- time stamp
Apparent Wind Parameters
Data Logging
- apparent wind angle
- apparent wind speed
- boat speed
- GPS coordinates
Friday, March 4, 2011
Velocity Made Good Calculation
- Yacht speed -- Vs
- Apparent wind direction -- (B - lambda)
- Apparent wind speed -- Va
- Leeway Angle -- lambda
"Vmg is given by Vs cos gamma. The angle between the yacht's track and her fore-and-aft axis is the leeway angle lambda"
I think that the tiny 1/2 looking like sym
bol exponent position under the devision sign is 1/lambda.
Electronic Instruments and Computers for Sailing Yachts
I've found that reading really old research is often more interesting than the cutting edge stuff. To see how ideas develop and in just a few minutes cover decades of development is really the essence of the information age. Here is just such a paper. Gatehouse suggest measuring true position by sighting known markers to triangulate your position which was considered unfeasible . Well a GPS is a whole lot easier, but wasn't around 1970.
Gleaned Points of Importance to ArduSkipper:
- where to put the speedometer - "the boundary layer beneath the hull of a typical racing yacht was nowhere more than 1 in. thick and was only about 1/2 in. thick at a position 5 ft. aft of the forefoot, the position finally chosen for the sensor [on a 24ft boat]."
- "The leeway angle, which is the angle between the yacht's fore-and-aft axis and the direction of motion through the water, reaches a maximum value when the yacht is close-hauled, this value varying between about 2° and about io°"
- Wind Vane Error - the error of measurement of wind direction due to sail deviation seldom exceeds 3 degrees and is independent of wind velocity.,, [other researchers], indicated that the error was about + 7 degrees.... [Moreover] The error is such as to make the apparent wind angle greater than it really is.
- Anemometer - The diameter of each cup is 1 in. and the length of its supporting arm is 1 1/2 in. Departures from linearity did not exceed 0.5 per cent within the speed range 2-60 knots.
Commenting Code
- The latest Aurdpilot Mega
- Harald Molle's Modified Ardupilot v1.o
- Glenn's Wind Vane
- Robbie Edwards' code for their autonomous sailboat based on Aurdpilot Mega
- Code for the Adafruit data logger
Wednesday, March 2, 2011
The Servos Arrived
------------------------------
1 (37950S10) HS-7950TH Servo $149.99 $149.99
* Quantity Modifier $-37.50 $-37.50
* Option: Rotation is 180° (5445) $10.00 $10.00
1 (31085S00) HS-85BB Servo $19.99 $19.99
* Quantity Modifier $-5.00 $-5.00
Tuesday, March 1, 2011
Spruce for the Mast
Monday, February 28, 2011
Wind Vane and Anemometer Sketch
Sensors ordered from Seeedstudio
- I'll use the UNO to test and work out the code.
- The Photo interrupter is a photogate that I hope to use to build a paddlewheel type speedometer.
- The Photo Reflective Sensor will be used for the Anemometer (hand drawn design to follow).
- I'm going to attach the piezo sensor (vibration sensor) to a tell tale and glue one to each side of the main sail. That will (hopefully) tell me if I have laminar flow across each side of my sail.
2 x Piezo Sensor - MiniSense 100 (SEN127A3M) = $5.70
Manual Data Sheet
Data Sheet
Simple Anemometer
I believe I've worked out how to build a small simple wind sensor. I'll base it on a Photo Reflective Sensor. The sensor can be completely housed out of the weather behind a little plastic window from an old TV remote. With a little IR reflective paint on the spinning parts I'll be able to measure the RPMs.
Saturday, February 26, 2011
Wind Vane
ArduPilot code for a Sailboat
Calculating True Wind - a sailboat's fuel tank
a = AW * ( cos Y )
bb = AW * ( sin Y )
b = bb - BS
True-Wind Speed = (( a * a ) + ( b * b )) 1/2
True-Wind Angle = 90-arctangent ( b / a )
http://www.sailingusa.info/true_wind_calculator.htm
This simple calculation doesn't take into account leeway. Leeway is the drift of the boat to the side due to the push of the wind against the sails.
Leeway depends on:
- Angle to the Wind - is greatest on a close reach and zero on a run.
- Velocity of the Wind
- It will be different for every boat.
This simple calculation doesn't take into account current. Current creates a 'water frame of reference' which is different from the 'earth frame of reference'
Earth Frame:
- GPS
- Paddle Wheel Speedometer
- Wind Vane
- Anemometer
sine C = c/ac = sine C * a
cosine C = b/a
b = cosine C * a
d = power - b
CD = arctangent ( c/d )
Friday, February 25, 2011
DIYdrones info Links
Lake Depth Survey Blog - http://diydrones.com/profiles/blogs/ardupilot-goes-into-the-water
Lots of interesting posts about the evolution of a boat used the survey the depth of lakes. He used the Ardupilot and V1.0 software, but modified it for a his boat.
Discussion regarding sailboat application - http://diydrones.com/forum/topics/imu-3000
Didn't entirely understand the conversation, but it regards drift compensation.
Required components for a Boat - http://diydrones.com/forum/topics/ardupilot-boat-requirements
User Jim Covert asks about the components need for a boat project. Chris Anderson points out the that he'll want to use Ardupilot 1.0 which lacks stabilization control. A boat doesn't really need that feature.
Another lake survey project - http://letsmakerobots.com/node/21098
Detailed description of boat building process and application of an Arudino Duomilanove for controlling the boat.
Boat navigation with ArduPilot - http://diydrones.com/forum/topics/boat-navigation-with-adrupilot
User Tony K. asks about the components needed to pilot a sailboat. Chris Anderson Give some direction on what is specifically needed and some specifics about GPS parameters.
Two-way Telemetry - http://diydrones.com/forum/topics/moving-waypoints-in-flight
User Peter Ho appears to be using ArduPilot on a boat and wants to change waypoints while en-route. Chris Anderson points out that two-way is available on the ArduPilot Mega.
Everything you need for ArduPilot Boat - http://diydrones.com/notes/ArduPilot
- ArduPilot board and a row of breakaway headers
- GPS module (MediaTek or uBlox 5+adapter and cable recommended)
- FTDI cable for programming
- Four female-to-female servo cables to connect ArduPilot to your RC system
- [not needed]Shield expansion kit with airspeed sensor (couldn't really use for wind speed / direction on a sailboat b/c wind doesn't always come from strait ahead)
- [Optional] Two Xbee modules for wireless telemetry. This one in the air and this one with this antenna on the ground/laptop side. You'll also need two Xbee adapter boards. You can connect the airborne Xbee adapter to Ardupilot Mega with jumper wires.
AP for Sailing Vessel - http://diydrones.com/forum/topics/ap-for-sailing-vessel
andrew was starting a project for a auto pilot for a sailboat. He focussed on the magnetic compass. He demonstrated a working tilt compensation compass details here.
AUOOSB Open Ocean Sailboat Project - http://diydrones.com/profiles/blog/show?id=705844%3ABlogPost%3A6278...
Michael King Put up a community page at auoosb.ning.com to work toward building an autonomous sailboat. The site appears to have put on hold by NING but I believe I contacted Michael about reactivating it.
PID Tuning - http://diydrones.ning.com/forum/topics/705844:Topic:46763?xg_source...
Michael King Post on how to tune your PID settings for each craft. Not specific to boats, but PID tuning did cause Harald Molle a lot of grief in his boat project.