Tilt compensation
A sailboat heels. Tip a flat compass and the vertical field leaks into its reading. Heel 20 degrees and watch north read 329, then see how the accelerometer puts it back.
Open it in the simulatorA tiller pilot for the simulator: a tilt-compensated compass with declination, a limited rudder, a PID heading loop that knows 359 from 1 and ignores waves, and great-circle navigation to GPS waypoints. Never for real navigation.
0 of 6 done
6 lessons in 3 chapters, about 7 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.
A sailboat heels. Tip a flat compass and the vertical field leaks into its reading. Heel 20 degrees and watch north read 329, then see how the accelerometer puts it back.
Open it in the simulatorClose the loop: AUTO holds a course with a PID on the heading error. Turn to a new course, fall into the 359 to 1 trap and out of it, ride out a knock, and stop the rudder hunting in waves.
Open it in the simulatorSail the whole route, add a leg of your own, steer it from the knob, and write up the pilot with its limits.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
Heading from a three-axis compass, declination, and tilt compensation for a heeling boat.
An LSM303AGR measures the Earth’s field in three axes. Turn two of them into a heading with atan2, keep it in 0 to 360, and correct magnetic north to true north with the declination.
0 of 5 steps
A sailboat heels. Tip a flat compass and the vertical field leaks into its reading. Heel 20 degrees and watch north read 329, then see how the accelerometer puts it back.
0 of 4 steps
A rudder with limits, and a PID heading loop that wraps, recovers and does not hunt.
The rudder is a servo with limits: 30 degrees each way and 40 degrees a second. Steer by hand in standby, hit the stop, watch the modeled boat turn, and slow the rudder to a real ram’s speed.
0 of 4 steps
Close the loop: AUTO holds a course with a PID on the heading error. Turn to a new course, fall into the 359 to 1 trap and out of it, ride out a knock, and stop the rudder hunting in waves.
0 of 6 steps
Great-circle distance and bearing to waypoints, then the whole route.
From holding a heading to going somewhere. Get a fix, work out great-circle distance and bearing to a waypoint, steer to it, and switch to the next one inside an arrival radius.
0 of 4 steps
Sail the whole route, add a leg of your own, steer it from the knob, and write up the pilot with its limits.
0 of 4 steps
All 6 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Build a boat autopilot is part of the maker track, a ladder of courses from zero to expert.
Big digits, team buttons, real cancellation scoring to 21, a radio remote on a second Uno and a fanfare for the winners.
Open the next courseFollow the starter kit you already own, then build a claw machine, a balance bot, a handheld console or an LED cube, each a short course checked by the simulator.
See every course on the trackEvery lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 6 lessons of Build a boat autopilot are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 7 hours: 6 lessons in 3 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: Tilt compensation, A PID heading loop and Project: hold a course.
With "Heading from a compass", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.