BS2 Autopilot
Microyacht
Posts: 10
I want to build an Autopilot for a small boat based on the BS2 module.
The basic components:
Basic Stamp BS2 (Because I already have one)
Hitec HS-805BB Giant Servo
Parallax HMC-6352 Fluxgate compass
Analogue 2-D Joystick
Some sort of keyboard for direction entry 0º to 360º
Requirements: I'm heading 270º. I want to get some sleep and stay somewhere near to on course. I enter heading on keypad. If wind or wave pushes me of course, BS2 outputs PWM to servo to move mini-rudder. Boat now back on 270º. If I touch the joystick, any heading entered is cancelled and I can steer manually by joystick or main rudder by tiller!
The servo is connected to a secondary mini-rudder, not the main rudder.
I do have a gps but it's normally attached to my Asus Eee PC. I can't actually see the need for one connected to the Autopilot but I guess if it could be useful then an I/P could be provided or something like the Parallax PMB-248 be included.
I have no difficulty assembling the unit but the software will be another matter!
Steve Carey
The basic components:
Basic Stamp BS2 (Because I already have one)
Hitec HS-805BB Giant Servo
Parallax HMC-6352 Fluxgate compass
Analogue 2-D Joystick
Some sort of keyboard for direction entry 0º to 360º
Requirements: I'm heading 270º. I want to get some sleep and stay somewhere near to on course. I enter heading on keypad. If wind or wave pushes me of course, BS2 outputs PWM to servo to move mini-rudder. Boat now back on 270º. If I touch the joystick, any heading entered is cancelled and I can steer manually by joystick or main rudder by tiller!
The servo is connected to a secondary mini-rudder, not the main rudder.
I do have a gps but it's normally attached to my Asus Eee PC. I can't actually see the need for one connected to the Autopilot but I guess if it could be useful then an I/P could be provided or something like the Parallax PMB-248 be included.
I have no difficulty assembling the unit but the software will be another matter!
Steve Carey
Comments
good luck
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The smarter I get, the more I understand I don't know!
I will also build-in a series of alarms so when the Autopilot is unable to stay on course, significant change in wind direction, significant drop in boat speed etc . . . . . . . but with a big O F F switch, sometimes you just need to sleep and sort out the route tomorrow!
If I were to add GPS, apparent wind direction and wind speed, boat speed (obtainable from the GPS) and then add an output to a motorized sail-winch, just like on Radio Controlled Sailboats but bigger, then the boat would sail herself but that's beyond the scope of this project. The total current for BS2 + fluxgate + Keyboard etc should be no more than about 10mA or so from a 6V NiMH pack. The servo draws up to 800mA when it's running and only 8mA at idle. Have no idea what the average current will be at this stage but the only source for re-charging the batteries will be a small solar panel!
Most commercially made tiller pilots use a fluxgate compass but no GPS. Larger units for larger boats (40ft+) have an input (NMEA) for connecting a GPS.
Steve
Simrad-Navico TP10 Tiller-Pilot:
Post Edited (Microyacht) : 2/8/2010 4:51:32 PM GMT
What size boat? I've done some mucking about in small boats, I used to solo sail my 23' boat Chula down to Santa Cruz and So. Cal from the SF Bay Area. She was a gaff rigged, lapstraked with Port Orford cedar, double ended sloop. Lovely little boat, and tough as a brick s**thouse.
Anyway, what you outlined seems reasonable. One thing I wonder is will the mini rudder have enough strength to bring her into the wind if need be? 800mA doesn't seem like much power to wrestle with a rudder.·What about a gyro to sense heel to feather up into the wind with gusts and wind veers? I only ever used a weather-vane type of autopilot, not the·Iron Mike variety, and they automatically head into the wind.
Keep us informed on the project, it sounds like a very cool one!
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Oh dear, the boat is very small, so small I hate to tell you! Well, I've built/sailed larger radio controlled boats. It's only 8ft LOA!
The servo has torque of 350oz.in at 6V (approx 24kg/cm).
The boat won't sail any closer than 45º into the wind. If things change that much in the night (as they do!), then I'd have to completely re-set the sails on a different tack. So no need to take the power of the servo to sail through the wind.
While out cycling in the snow, I had a brainwave. No need for a keypad . . .
A: So I'm sailing on a heading and want to lock the autopilot on that course.
B: The Fluxgate compass knows the heading and is inputting it to the BS2.
C: Press a "Lock" or "Set" button which stores the heading IE 340º
Boat goes off course and i/p from Fluxgate is no longer 340º
E: BS2 turns Servo to correct course until Fluxgate and stored figure agree!
I see that our Parallax agent in the UK, Millford Electronics only keep the HM55B Fluxgate Compass PCB and not the HMC6352. I see that the $ price is the same for both units. I wonder if one is more accurate than the other and what major differences there are if any?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bye for now
Steve/G4MJW
www.microyacht.com
www.aroundinten.com
www.withamweather.co.uk
Post Edited (Microyacht) : 2/8/2010 5:37:28 PM GMT
This circuit may be a bit of over-kill for your application but I thought I would pass it along.
In my application I push down on the joystick's·momentary contact·switch.·(Gravitech "Joythumb") The output·is sent to·a Sharp voltage regulator (with a pin for on-off)·to turn power on. If you press it again you toggle the flip-flop and turn the power off.
If, after you turn the power on, you program the Basic Stamp to take the "Disable Power Toggle" high, then the pushbutton on the joystick can be used for "enter" without turning the power back off. This also has the nice feature of latching the button push until your program·gets back to check for it. -Scott
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bye for now
Steve/G4MJW
www.microyacht.com
www.aroundinten.com
www.withamweather.co.uk
Hey, im working on a similar project, not a sailboat, but a RC helicopter...
I don't have the fluxgate compass, im am using outputs from a futaba gyro, however our concept is the same. Perhaps I can help with the software for you app. As far as wind and water currents are concerned, it is true that a gps would solve this issue but I agree that it may be overkill for your project. The condidtion you refer to is called cross track, and if you are a sailor you know that this is real common in basic auto-pilots, and cross track error, however it can be somewhat over come. I suggest keeping it simple for now, get a working model going and then you can add to it later [noparse]:)[/noparse]
I don't have the spec sheet for the fluxgate, so I may need that so I can help with inputs. The inputs from the fluxg are important as you need to calculate and adjust for a dead zone, else the logic will constantly hunt, and wear down your battery, and wear out the servo. I have quite a few servo's and each has its own range so we will need to work on the outputs as well. As far as input are concerned, a keyboard might be quite a bit for your app, there may be an simpler way to input course changes, such as a switch array, or other type, more on that later.
Please let me know how far along you are? and if you still need some help..
Cheers...
Cool project, hope you get it working fine so you can get some sleep out there! If you find that your servo is underpowered, you might sleep easier if you·upgrade to one of these monsters: http://www.servocity.com/html/spg785_pan.html
best,
erco
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bye for now
Steve/G4MJW
www.microyacht.com
www.aroundinten.com
www.withamweather.co.uk
A couple things to consider, I realized now that you may not want to input actual headings, which will make for simplified programming, and therefore what you are seeking is basically the same as my heading lock gyro. I looked for the data sheet on your fuxg and I have the one on the HMC6352. You need to make sure there is some way to physically disconnect the servo from the rudder when it does not have control. Servo's can drive just fine, but if the rudder tries to drive the servo, the fragile gears may strip. A simple on/off (Heading lock / Un-lock) switch is what I see for control (for now). The fluxg will be sending data to the Bs2 and we need to find out how much of a range is being introduced due to sea state. If you are familiar with auto-pilots you know there is an adjustment for this, when its calm you can make the auto-pilot more sensative to fluxg changes and the boat will track closer to the target heading, the oposite is true for rough condidtions to prevent excessive hunting. You could solve this with a simple pot to adjust "Sea-State" or sensitivity. As far as the calibration of the fluxg and acutal headings are concerned, we can actually eliminate that if all you seek is a heading lock. Basically we don't care what heading the fluxg actually see's, all we care is that it tracks the reading registered when we turn on heading lock. So as far as connections go, you have the fluxg, the servo, an overall on/off power switch, a pot (10k will work) for sensitivity, and a toggle switch for heading lock on/off. The only other thing you may consider is a pizeo buzzer or alarm we can set to altert you of a cross track error condition, such as the boat going way off course, or if the servo/rudder is unable to track withing a desired amount..
Just some thoughts.. Cheers.
Just need an update on what you have started already for hardware, such as a breadboard, the carrier, a stamps-in-class board, components, etc.
Next step is to set it up on benchtop, get everything jumpered in, then we start doing some programming.
Question, the code can be short (complex) or a bit longer for ease of understanding, ie adding comments, using longhand vs. short. I think this depends on your interest in how the code will actually work so you learn as we go and tweak it to work to your perfection [noparse]:)[/noparse]
Cheers..
Software wise should be broken down into the following sections:
Setup/Enable/Reset section:
Actual Runtime:
1) Input - Toggle switch (True - False) VAR lable as hlstat (Heading Lock Status)
2) Input - Fluxgate Compass (Heading Variable) lable as head (Comapss Heading) lable as hstat (Compass Status) ? I show 3 pins in the 55 (Clock/Enable/Compass)
3) Input - Potentiometer (Position Variable) lable as seapot (Used to condition/buffer the servo output and set dead band) Will need to decide resolution
3) Output - Servo (Pulses to position) lable as servo (Servo Output Value) command PULSOUT
4) Output - Pizeo (Alarm sound) label as freq (Frequency Output for Speaker) command FREQOUT
Just some thoughts. I have to get my breadboard setup to this config. [noparse]:)[/noparse]
http://forums.parallax.com/showthread.php?p=880514
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Since you are building the boat yourself, (I think) I would urge you to choose/design a rig that does not require an auto pilot.
My last sailboat was a gaff rigged yawl, I was able to trim on any point of sail, including straight downwind, and sleep well through the night while underway.
If a boat needs an assistive device, it must be handicapped!
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
If a guy wants to make a flusher for his porta-potty with a basic stamp to learn how it works, More power to him!... What we need is constructive criticism, please refrain from anything else, or create your own negative thread.
Cheers.
Still, I agree about making the vessel self steer as well as possible. If nothing else it will make autopilot work less hard.
On the gaff rigged sloop mentioned above simply lashing the tiller with a bungie provided reasonable self steering. The bungie was adjusted with a jam cleat. It wasn't great, but you could catch enough sleep that way to get by, unless conditions were variable, then it required much more work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Post Edited (Jonathan) : 2/11/2010 9:23:05 PM GMT
Well, I sure did not intend to offend anyone. Sorry that you feel that way. There are not that many things in life where I can claim experience so when one does come up, I say what I think. It is my impression that this forum generally welcomes (or at least tolerates) differing opinions, even when that opinion is not in favor of the ideas presented in the topic. And it's not like I am against using a BS2 for an autopilot, I have built one myself for an aircraft and it worked very well.
The OP is in search of a way to steer his vessel - I recommend using the sails, not a BS2. Choose a rig that lends itself well to self trimming rather than solving the problem with electronics. Doesn't that pass for constructive criticism?
@ Jonathan, that's why I chose the yawl. Many times I crossed the San Francisco bay under jib and mizzen sipping hot cocoa with the tiller pointing skyward (it was hinged so that it could be moved out of the way) while watching the crews of the plastic boats scurrying about and getting drenched with spray. Yeah, they got there a little faster but I was warm and dry, and quite content. Occasionally I would use a bungee but generally I didn't want to have anything to do with the tiller.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Sorry, You are correct this is an open forum.
As far as a better way, yes I can name several better ways to steer this or any vessle, be it Aircraft, Boat, Car, or anything. My point was, the OP asked for help for constructing a BS2 application of HIS choice. Its not·my place to suggest to·him there are 1001 better ways to do this, which·we all know. Rather than·deter him from constructing a device, I offerd help with his request, and I think thats what we were looking for. Had he said "I am trying to steer my sailboat with a BS2, is there a better solution?" Well that would be a totally differnt issue, and I·would then understand all the·ssuggestions to not use the BS2.
Cheers·
The boat design, features and equipment has been the subject to discussion on a few forums over the past 3 years or so. It is a tiny microyacht designed for the Around in Ten (10ft) race around the world. There is NO mizzen in fact like most similar small designs, has only a single sail. Although she is short and fat, her dimensional stability is good. With a balance lug sail, she will steer straight . . . . in calm water. I have used Navico and Autohelm Tiller-pilots (Autopilots) on other craft and know from past experiences they should work well on Microyacht. However, I want to make as much as possible myself. The boat, the mast, the sail - stitched on my own sewing machine. It certainly helps to know how it is made when something goes wrong and more chance of repairing it.
That said, I already have a BS-2 left over from my days as a lighting designer and making automated searchlights for use at outside events. I also have the large servo which for now I will take as being suitable. I need to get the Fluxgate Compass be need guidance here as there seems to be a choice of two. I plan on making a self contained unit together with five 1.2V NiMH 2,500mA/H cells and a small solar panel for charging. The solar panel would be exposed to daylight (and hopefully the SUN) from sunrise to sunset. The unit is only drawing any sort of current when the servo motor is actually running. What sort of duty cycle that will represent has yet to be discovered. An alternative 6V i/p derived from the "ship's" 12V supply is a possibility as is a second set of internal batteries.
My revised layout is attached.
If I'd not done enough house building work, I'm having to re-paint my own bathroom (Wife's orders) but once done can spend some time working on the actual construction of the unit.
Help with code, very much appreciated.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bye for now
Steve/G4MJW
www.microyacht.com
www.aroundinten.com
www.withamweather.co.uk