Upload
sajid-mahmood
View
147
Download
1
Embed Size (px)
Citation preview
i
FINAL YEAR PROJECT REPORT
AUTO-HELM CONTROL OF
SAILING BOAT USING FUZZY
LOGIC B.S Electronic Engineering, Batch 2006
Internal Advisor External Advisor
Mr. Chandan Lal Mr. Danish Karim Iqbal
Assistant Professor Design Engineer
Electronic Engineering Deptt. R&D
SSUET, KARACHI Saltec Powerlink
Submitted by:
Sajid Mahmood 2006-EE-075
Ahsan Qamar Hashmi 2006-EE-086
Daniyal Siddiqui 2006-EE-098
Abid Muhammad Jawaid 2006-EE-105
Zohaib Jamil 2006-EE-115
Syed Muneeb Raza Bukhari 2006-EE-609
DEPARTMENT OF ELECTRONIC ENGINEERING
Sir Syed University of Engineering and Technology
University Road, Karachi75300
January, 2010
ii
SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY
University Road, Karachi -75300, Pakistan. Tel: - 4988000-2, 4982393, 474583, Fax: (92-21) 4982393
http://www.ssuet.edu.pk
The Faculty of Electronic Engineering
Project Approval
Project Title AUTO-HELM CONTROL OF SAILING BOAT USING FUZZY LOGIC
Internal Advisor Mr. Chandan Lal (Assistant Professor )
External Advisor Engr. Mr. Danish Karim
Academic Year 2006
Group Members:
Sajid Mahmood 2006-EE-075
Ahsan Qamar Hashmi 2006-EE-086
Daniyal Siddiqui 2006-EE-098
Abid Muhammad Jawaid 2006-EE-105
Zohaib Jamil 2006-EE-115
Syed Muneeb Raza Bukhari 2006-EE-609
____
The Department of Electronics Engineering Sir Syed University of Engineering &
Technology has approved this Final Year Project. The Project is submitted in partial
fulfillment of the requirements for the degree of Bachelor of Science in Electronic
Engineering.
Approval Committee:
(Asst. Prof. Mr. Chandan Lal ) (Engr. Mr. Danish Karim Iqbal)
Internal Advisor External Advisor
(Muhammad Sharif ) (Dr. Bi lal Ahmed Alvi )
FYP Committee Incharge Chairman EE Department
January/ 2010
http://www.ssuet.edu.pk/
iii
ACKNOWLWDGEMENT
We are thankful to Almighty Allah, most beneficial and most merciful, for giving us
the courage and devotion to work on the assigned project successfully within due
course of time in the field of Electronic Engineering.
To acknowledge the efforts and devotion of those people, who have helped us during
our project, is perhaps, the most important part of this report. Although we cant pay
proper homage to their devotion and dedication to ourselves and to our project, but we
consider their right that their names and efforts should go in history with our project.
First we would like to sincerely mention all the efforts of Assistant professor Mr.
Chandan Lal has made on us for us to accomplish this major task which probably the
biggest project of our lives yet. He has helped us during the entire course of this
project. It would not be improper to say that the project could not see its final shape
without his help and assistance. We have found him humble and cooperative in every
aspect. He has not only helped us in our project but also acted as a source for
character building.
We also wish to express our gratitude to all the staff in the University and our
development and trial areas, Baharia Foundation, National Sailing Centre and PAF
Yacht Club for facilitating us in all possible manners. And last but not the least we
acknowledge the efforts of our external advisor Engr. Mr. Danish Karim Iqbal, our
batch mates Mr. Syed Kamran Ahmed and Mr. Muhammad Fahad Wallam who have
helped us throughout the project and have shared their knowledge and skills with us.
iv
SYNOPSIS
This project demonstrates an Automated Sailboat Control based on Fuzzy Controls.
While it also provides the Manual Controlling feature that may increase the
Scalability of the System. Implementations of various Controls are done using Fuzzy
controls. Other parameters should be controlled using ordinary control techniques.
Advanced sensing techniques must be practiced in order to automate the Sail boat.
Navigation and Path Determination of the boat should be done using Global
Positioning System (GPS). Use of Servo Motors to perform functions like Sail and
Rudder Trim should be done. Radio Frequency transmission using RF Transceivers
should be done in order to Monitor the Boat Parameters and also provide Path
feedback Experiments with a scale prototype show the ability of a fuzzy controller to
govern the rudder and trim the sails on a sailboat. Helm is the term used to describe
the Steering Mechanism of the boat.
A significant advantage of this project is the use of Wind Energy for the propulsion of
the boat. This might be the initial step for the awareness of sailing at the grass route
level in Pakistan and as well as in the other neighboring countries. Participation in
International Events held across the Globe could be made possible. Heuristics
involved in this Sport can easily be understood using the prototype. Participation of
Under-Developed Countries in this expensive Sport can be made possible.
v
TABLE OF CONTENTS
ACKNOWLWDGEMENT iii
SYNOPSIS iv
TABLE OF CONTENTS v
LIST OF FIGURES ix
Chapter 1 INTRODUCTION 1
1.1 GOALS AND OBJECTIVE 2
1.2 SYSTEM STATEMENT OF SCOPE 2
1.3 LIST OF COMPONENTS 3
Chapter 2 INTRODUCTION TO SAILING 5
2.1 INTRODUCTION 6
2.2 THEORITICAL BACKGROUND 6
2.3 SAILING BOAT 6
2.4 HOW TO SAIL A BOAT? 7
2.5 RULES FOR SAILING 10
2.6 CARE FOR SAILING EQUIPMENT 14
2.7 SAILING TERMS AND ITS MEANING 16
Chapter 3 AUTOMATION OF SAILING BOAT 18
3.1 INTRODUCTION 19
3.2 HISTORY 19
3.3 OVERVIEW 19
3.4 OBJECTIVE 19
3.5 BACKGROUNDS OF PROJECT 19
3.6 ALGORITHM BEHIND AUTOMATION 20
3.7 DEFINITION OF NO-GO AREA 21
3.8 FUZZY LOGIC WITH RESPECT TO OUR PROJECT 21
3.8.1 FUZZY SETS 21
vi
3.8.2 FUZZIFICATION 21
3.8.3 RULE EVALUATION 22
3.8.4 DEFUZZIFICATION 22
3.9 KEY FEATURES 22
Chapter 4 SYSTEM DESCRIPTION 23
4.1 INTRODUCTION 24
4.2 SYSTEM ARCHITECTURE 24
4.3 SYSTEM ARCHITECTURE FOR END USER 25
4.4 SYSTEM ARCHITECTURE OFF SHORE 29
4.5 SUBSYSTEM OVERVIEW 30
4.5.1 OFF SHORE STATION 30
4.5.1.1) MAIN CIRCUIT DIAGRAM 30
4.5.1.2) GPS INTERFACING 31
4.5.1.3) DC MOTOR INTERFACING 32
4.5.1.4) ANEMOMETER INTERFACING 32
Chapter 5 FUZZY CONTROLLING LOGIC 34
5.1 INTRODUCTION 35
5.2 FUZZY CONTROLLING LOGIC 35
5.3 DEGREES OF TRUTH 35
5.4) OVERALL STRUCTURE 35
5.5) FUZZIFICATION 36
5.6) RULE EVALUATION 37
5.7) DEFUZZIFICATION 38
Chapter 6 DESCRIPTION OF ELECTRONIC COMPONENTS 39
6.1 INTRODUCTION 40
6.2 ATMEGA-16 8-bit MICROCONTROLLER 40
6.2.1) OVERVIEW 40
6.2.2) FEATURES 40
6.2.3) PIN CONFIGURATION 42
6.2.4) BLOCK DIAGRAM 43
vii
6.2.5) PIN DESCRIPTION 43
6.3) DC GEAR MOTOR 45
6.4) SERVO MOTOR 45
6.5) MAX-232 DUAL RECIEVER 47
6.5.1) INTRODUCTON 47
6.5.2) PIN CONFIGURATION 48
6.5.3) FUNCTION TABLES 48
6.5.4) LOGIC DIAGRAMS (POSITIVE LOGIC) 49
6.5.5) APPLICATION INFORMATION 49
Chapter 7 NAVIGATIONAL MODULE 50
7.1 INTRODUCTION 51
7.2 HOLUX M-89 GPS MODULE 51
7.2.1) HISTORY 51
7.2.2) KEY FEATURES 51
7.2.3) APPLICATIONS 52
7.2.4) BLOCK DIAGRAM 52
7.2.5) PIN DEFINATION 53
7.3 NMEA Data Protocol 54
7.3.1) THE PROTOCOL 54
7.3.2) HARDWARE CONNECTION 55
7.3.3) NMEA SENTENCES 56
7.3.4) NMEA INPUT 59
7.3.5) DECODE OF SELECTED POSITION SENTENCES 60
7.3.6) DECODE OF SOME NAVIGATION SENTENCES 63
7.3.7) OTHER SENTENCES THAT MAY BE USEFUL 66
Chapter 8 TRANSMISSION MODULE 68
8.1 INTRODUCTION 69
8.2 WIRELESS RF TRANCIEVER 69
8.2.1 HISTORY 69
8.2.2 PIN DEFINATION 69
viii
8.2.3 INTERFACING DIAGRAM 70
8.2.4 DATA RECPETION 71
8.2.5 DATA TRANSMISSION 71
8.2.6 FREQUENCY SETTING 71
Chapter 9 SOFTWARE TOOLS 73
9.1 HOW TO COMPILE SOURCE CODE 74
9.2 BURNING .HEX FILE INTO THE MICROCONTROLLER
USING PONYPROG 82
APPENDICES
Appendix A: TIME AND COST ANALYSIS
Appendix B: DATASHEETS
Appendix C: REFERENCES
ix
LIST OF FIGURES
Figure 2-1 Sailing Boat 6
Figure 2-2 Sailing Restriction Map 7
Figure 2-3 Stern 10
Figure 2-4 Tacks 11
Figure 2-5 Rule No.1 11
Figure 2-6 Rule No.2 12
Figure 2-7 Rule No.3 13
Figure 2-8 Rule No.4 13
Figure 2-9 Rule No.5 14
Figure 3-1 Automation Algorithm 20
Figure 4-1 System Architecture 24
Figure 4-2 System Architecture for End User 25
Figure 4-3 Graphical user Interface 27
Figure 4-4 Microsoft Access Data Base 28
Figure 4-5 System Architecture Off Shore 29
Figure 4-6 Main Circuit Diagram 30
Figure 4-7 GPS Interfacing 31
Figure 4-8 DC Motor Interfacing 32
Figure 4-9 BMS 33
Figure 5-1 Software Fuzzy Interface Unit 36
Figure 5-2 Two Input Member Function 37
Figure 6-1 Microcontroller 40
Figure 6-2 Pin Configuration 42
Figure 6-3 Block Diagram 43
Figure 6-4 DC Gear Motor 45
Figure 6-5 Servo Motor 46
Figure 6-6 Servo motor 46
x
Figure 6-7 Function of Servo motor 47
Figure 6-8 MAX-232 48
Figure 6-9 Logic Diagrams 49
Figure 6-10 Application Information 49
Figure 7-1 HOLUX M-89 GPS Module 51
Figure 7-2 Block Diagram 52
Figure 7-3 Pin Definition 53
Figure 8-1 Wireless RF Transceiver 69
Figure 8-2 Interfacing Diagrams 70
Figure 9-1 AVR Studio 4 (Step 1) 74
Figure 9-2 AVR Studio 4 (Step 2) 75
Figure 9-3 AVR Studio 4 (Step 3) 76
Figure 9-4 AVR Studio 4 (Step 4) 77
Figure 9-5 AVR Studio 4 (Step 4) 78
Figure 9-6 AVR Studio 4 (Step 4) 79
Figure 9-7 AVR Studio 4 (Step 5) 80
Figure 9-8 AVR Studio 4 (Step 5) 81
Figure 9-9 Parallel Port Interfacing 82
Figure 9-10 PonyProg (Step 1) 83
Figure 9-11 PonyProg (Step 2) 84
Figure 9-12 PonyProg (Step 3) 85
Figure 9-13 PonyProg (Step 4) 86
Figure 9-14 PonyProg (Step 5) 87
Chapter 1
INTRODUCTION
2
1.1) GOALS AND OBJECTIVE:
Significant goals and objective of this project is the use of Wind Energy for the
propulsion of the boat. This might be the initial step for the awareness of sailing at the
grass route level in Pakistan and as well as in the other neighboring countries.
Participation in International Events held across the Globe could be made possible.
Heuristics involved in this Sport can easily be understood using the prototype.
Participation of Under-Developed Countries in this expensive Sport can be made
possible.
1.2) SYSTEM STATEMENT OF SCOPE:
Control the dissolution apparatus using microcontroller. The apparatus technician
controls the apparatus using microcontroller. Manual Input from the user is
transmitted through RF transmitter, where it is received at RF receiver, identified and
relayed to the controller then controlling done. While automation inputs are from
rudder and sail trim then controlling is done as describe above
The input to the system is from the user and input automation parameter of
boat (i.e. Rudder, GPS and Anemometer).
The output of the system is the processed signal to the controller.
This module can be motors for sail and rudder.
Major Inputs and Outputs:
Rudder
In basic form, a rudder is a flat plane or sheet of material attached
with hinges to the craft's stern, tail or after end. Often rudders are shaped so as
to minimize hydrodynamic or aerodynamic drag. Here rudder is a both input
and output part.
GPS
Global Positioning System is used to navigate the boat along the
ocean; GPS provide accurate longitude and latitude information using NMEA
Protocol Format.
http://en.wikipedia.org/wiki/Hinge
3
Anemometer
It is a custom made anemometer based on Potentiometer that provide
voltages from 0-5v that can be decoded using Analog to digital Converter and
can be used to detect the direction of the air as the air strikes it and make it
rotate.
Sail Trim
Sail trim is term used to describe the control of sail; while in case of
sail we are using a geared dc motor that can produce high torque when there is
enormous applied of air pressure on the sail.
BMS
Battery Management System also provides Indication for low battery
and would also help us for the efficient use of Battery Power.
1.3) List of Components
SAILING BOAT ASSEMBLY
HULL (FIBER GLASS)
RUDDER
CENTER BOARD
MAST
SAIL
MECHANICAL COIL
Electronic Components
AVR MICROCONTROLLER (ATMEGA-16)
TTL-RS 232 Level Converter (MAX 232)
ROTARY ENCODER (Slotted Disc and Opto-coupler, U-type)
GPS (M-89)
4
RF TRANSCIEVER (CY2196R)
DC GEAR MOTOR
RC SERVO MOTOR (FUTABA S3003)
RELAYS (12V DC)
ANEMOMETER(Free-End Potentiometer)
OPTOISOLATER (2N35)
5
Chapter 2
INTRODUCTION TO
SAILING
6
2.1) INTRODUCTION:
In this chapter we discuss about sailing boat. What is Sailing Boat, How to sail a boat,
What are the rules that are to be followed during sailing of a boat, care methods
during sailing boat, different terms of sailing and terms of sailing boat.
2.2) THEORITICAL BACKGROUND:
Sailing has been for long times the only means of ship propulsion at sea. Although
the performance of a sailing vessel is well below the present power driven ships,
either in terms of navigation speed and predictability, wind energy is absolutely
reusable, clean and free. Sailing boats may exhibit a virtually unlimited autonomy
and be able to perform unassisted missions at sea for long periods of time. Promising
applications include oceanographic and weather data collecting, surveillance and even
military applications.
2.3) SAILING BOAT:
Figure 2.1
7
A sailboat or sailing boat is a boat propelled partly or entirely by sails. The term
covers a variety of boats, larger than small vessels such as sailboards and smaller
than sailing ships, but distinctions in size are not strictly defined and what constitutes
a sailing ship, sailboat, or a smaller vessel (such as a sailboard) varies by region and
culture.
2.4) How to Sail a Boat
Figure 2-2
The wind has four different effects on a sailboat, which must be understood by the
amateur sailor before he can begin to see why his boat performs differently under
different conditions of wind and sailing course.
http://en.wikipedia.org/wiki/Boathttp://en.wikipedia.org/wiki/Sailhttp://en.wikipedia.org/wiki/Sailboardhttp://en.wikipedia.org/wiki/Sailing_shiphttp://en.wikipedia.org/wiki/Sailinghttp://en.wikipedia.org/wiki/Sailboard
8
The wind drives the boat ahead-most important of all; it also drives it laterally or, to
speak in a nautical term, causes it to "make leeway"; it heels the boat over, and lastly,
turns it around, according to the balance of her sails, distribution of weight, and what
is known as the "center of lateral resistance." The proper handling of sails and rudder
is what enables the sailor to so utilize these effects of the wind that he may sail his
boat in any direction.
The propelling effect is the one most utilized, and it is for this reason that every boat
is constructed to offer the least resistance to its forward movement with as little
friction as possible.
Leeway is one effect to be avoided, and for this purpose boats are given either deep,
stationary keels or centerboards, or some other device for providing an extensive
lateral surface below the water.
Heeling and the stability of a boat go hand in hand. The boat must be prevented from
capsizing, and this is done either by putting lead or iron on the keel, or carrying
ballast in the hull in order to lower the center of gravity, or by building a broad and
shallow boat such as the cat boat, which is very stiff in a breeze and does not heel
readily, but when a certain point has been reached, is apt to capsize quickly in the
hands of an unskillful sailor.
The fourth effect is that of turning the boat around. This is done when the center of
effort on the sails does not come on a line with the center of lateral resistance. This is
always the case in a poorly balanced boat. A well-balanced boat requires very little
movement of the rudder to hold to a course.
Any novice can understand how a sailing boat can travel with the wind, but why it
should go forward when the sails are close hauled is a question of dynamics which we
will not try to explain in this short article. An easily understood explanation of why
boats go ahead instead of sideways can be made by taking a V-shaped block of wood
and pressing it between the thumb and forefinger. If sufficient force is used it shoots
forward quickly. The thumb may be likened to the wind and the forefinger to the
water on the opposite side of the boat. The pressure caused by the wind pushing the
boat against the water on the opposite side causes the boat to go forward.
The center of effort and center of lateral resistance must be understood in the handling
of a sailboat. The center of effort is the center of the total sail area. If, for example,
this comes forward of the center of lateral resistance when the boat is sailing with the
wind abeam, then the side pressure on the sails will turn the boat's bow in the
direction toward which the wind is blowing, or away from the wind, and a boat doing
this is said to carry a "lee helm."
On the other hand, if the center of lateral resistance is farther forward than the center
of effort, the wind will swing the boat in the direction in which it is blowing, thus
throwing the bow up into the wind. A boat doing this is said to carry a weather helm.
Every sailing boat should be so rigged as to carry a little weather helm, as, if struck by
a squall under those conditions, it will luff quickly up into the wind and so be in
safety, while if the lee helm is carried, the boat will fall off before the wind,
presenting a broadside to wind and wave which is very apt to cause it to capsize.
9
Too much weather helm is also to be avoided, as it makes it necessary to keep the
rudder over at a sharp angle and retards the progress of the boat.
To reduce weather helm, move the ballast aft or shorten the after canvas, or increase
the forward canvas by setting a larger jib. If a boat carries a lee helm, shift the ballast
forward or reduce the area of the head canvas.
In considering the action of the rudder, the amateur sailor should bear in mind that as
the boat is turned by the rudder, it swings as on a pivot. The water, pressing against
one side of the rudder, pushes the stern of the boat away from that side.
The pivot or turning point is always well forward of the center. This is a fact that
should be remembered when steering close to a boat or other object. Don't delay
turning out of the way too long, or the very act of turning your boat will throw the
stern over sufficiently to cause the collision you are trying to avoid.
Running before the wind may look like the ideal course to the amateur sailor, but a
little experience cures him of that belief. Steering is difficult when running with the
wind aft, especially in rough water, and there is danger of the sail gybing over when
least expected. Except on smooth water it is better to haul the boat up so as to have
the wind on the quarter, and after following that course for some distance, to "take the
other track", gybe over so as to bring the wind on the other quarter. The proper
location or direction of the boom, or, in a nautical term, how the sail should be
trimmed is of supreme importance. The wind on the quarter, the wind abaft the beam,
the wind abeam or directly at right angles with the boat, and the wind forward of the
beam. are what are known as favorable winds, the sheet being hauled in such
proportion as to give the best results. These positions all refer to a boat when it is
what is termed "sailing free."
To sail "close hauled" means to bring the boat up as close into the wind as possible
and still keep it on its course, with the wind filling the sail so as to drive it forward. A
properly built boat will lie within four or four and a half points of the wind, while
some, especially those built on racing models, will do even better than this. Figure 6
shows about the proper location of the boom when sailing close hauled. The wind
striking the sail at this angle will drive the boat forward and maintain a reasonable
degree of speed, while to haul it closer would increase the leeway until, if the sail
were hauled parallel with the keel, the only progress made would be to leeward. Most
boats will sail closer to the wind in smooth water than in a rough sea.
When sailing close hauled, it is necessary to hold the boat on a course that will just
nicely keep the sail filled with wind. This point can be ascertained by putting the helm
slowly to the leeward. As soon as the sail begins to shake near the head, you have
reached a point where it is not drawing as much as it should, and, if the helm is kept
down, the sail will begin to flap in the wind and the boat will lose headway. A little
practice will enable an amateur skipper to see the beginning of this "tremble" in the
sail, and at the first symptoms he must reverse the helm until the wind fills the sails
fairl
10
2.5) RULES FOR SAILING
There are five basic rules of the road for small sailing boats to decide who has the
"Right-of-Way" so that each boat's skipper (driver) will know what to do to avoid a
collision. When sailing the words "left" and "right" in reference are replaced with
"port" and "starboard". It is important to remember which is which since the rules of
the road for sailings rely on using these words to assign right-of-way.
You might be able to remember this by noticing that the letter "R" appears twice in
the word "starboard", and only once in "port". Then since "right" begins with "R", you
will know that the right hand side of the boat when facing forward is the starboard
side.
Figure 2.3
The next item to remember is the word "tack" and how it is used to describe which
side of the boat the wind is blowing from. As seen in the illustration below, if the
wind is coming from the right hand side of the boat, and the sail is on the left side, the
boat is on a starboard tack. When the wind and sail are reversed, the boat is on a port
tack.
11
Figure 2.4
Rule Number 1:
When two sailboats are approaching each other and are on different tacks, the boat on
the starboard tack has the right-of-way over the boat which is in the port tack. In the
illustration below, boat A on the port tack, must turn to avoid boat B on the
starboard tack.
Figure 2.5
Rule Number 2:
When two sailboats are approaching each other and are on the same tack, the leeward
boat has the right-of-way over the windward boat. Another way to say this is to say
that the boat closer to the wind source must keep clear. The boat further from the
12
wind source has the right-of-way. In the illustration below, boat B is the windward
boat and must turn to avoid boat A which is leeward.
Figure 2.6
Rule Number 3:
A sailboat that is staying on a tack has the right-of-way over a sailboat that is tacking
or jibing. A simpler way to say this is to say "make sure you have room to complete a
tack or a jibe without interfering with any other boats before doing so". Make sure
that you can see clearly in all directions to ensure you have room.
In the illustration below, boat "A" must ensure that it leaves plenty of room to avoid
boat "B", who has the right-of-way, since boat "B" is continuing on its tack. However,
in the event that boat "A" was unable to tack due to the proximity of "B", remember
that "A" is the leeward boat so therefore could tell boat "B" to give room to tack, but
would lose this right of way as soon as they actually began to tack.
13
Figure 2.7
Rule Number 4:
Any sailboat that is overtaking a slower boat from behind must steer clear of the
slower boat and give right-of-way. The slower boat should hold its course and allow
the faster boat to pass. In the illustration below, boat "A" is a faster boat, and must
steer around the slower boat "B", who should remain on the same course.
Figure 2.8
14
Rule Number 5:
Most of the time sailboats have the right-of-way over power boats. Since most
powerboats are more easily maneuverable than sailboats, they must steer clear. This is
not always the case however. Larger power boats are sometimes steering in the deep
channel of the area, and cannot leave the channel. In this case the sailboat does not
have right-of-way, and must avoid impeding the progress of the larger vessel. Many
larger power boats cannot simply stop quickly or easily turn to avoid a small sailboat,
so it is in the sailor's best interest to steer well clear of these larger boats. In the
illustration below, the powerboat "A" must turn to avoid the sailboat "B", who has the
right-of-way.
Figure 2.9
2.6) Care For Sailing equipment:
Drain and dry the boat:
The first thing you should do when your boat is back on shore is to open the portholes
and drain bungs. Always leave the boat with the drain bungs open and the portholes
open, so the flotation tanks can dry out completely. Prop the boat up if needed to
ensure the drain holes are the lowest point. You can place a piece of carpet on the
ground under the transom, and raise the bow of the boat onto a sawhorse or support.
Remember to close all drain holes before putting the boat back in the water.
Organize your gear:
Keep the hatches, drain bungs and other loose gear in one place, so you know they
will always be there. After sailing, and after rinsing out or washing, and drying your
sailing gear, put it back in a gear bag. It is frustrating to show up at the lake on a
gorgeous day, only to discover that you left your sailing boots or some other piece of
important gear, at home.
15
Sail care:
You can leave the mainsail on the boom, if you will be sailing the boat again soon.
Roll up the main from the head, perpendicular to the luff, so that it ends up in a roll
parallel to the boom. Also roll the jib up, put it inside the jib bag, and leave that in the
boat. All sails should be removed from the boat if it is to be trailed or stored out of the
water for any length of time. All sails should be dried and folded or rolled and placed
in sail bags ready for the next launch.
Centerboard care:
Leaving the board resting on the trolley or trailer may damage the leading edge, and
you want your slot gaskets left flat (in the normal closed position), so they do not take
on a permanent bend. If the centerboard up control does not have a shock cord take
up, you can put the line into a cleat, so the board is held all the way up, in the
centerboard trunk. Remove the dagger board completely from it's slot.
Rudder care:
Lay the rudder in the boat, or buy or make a rudder bag and put the rudder blade in
the bag as one of the first steps in derigging the boat. Also check your rudder fittings.
There should be no play in them.
Rig:
If leaving the boat with the mast rigged leave the boat with a little rig tension to
support the mast, but not so much as to load up the boat.
Cover:
The boat should be covered with a good top cover that shields the boat from UV
radiation. If the cover has holes in it, fix it or replace it. Figure out how to support the
cover so that water does not collect in it.
Salt:
Rinse salt water off the boat, rinsing out blocks, lines and once in awhile, inside the
tanks. If the tanks ever leak, you get salt in the tanks, and you will want to rinse that
out from time to time.
Turnbuckle grease:
If you have adjustable angle spreaders, lubricate the adjusters. Use turnbuckle grease.
If you don't lubricate these the stainless steel threaded part will permanently bond to
the aluminum, and you will not be able to adjust them ever again.
Inspections:
From time to time complete a visual inspection of your boat. There are lots of highly
loaded areas on a small sailboat. The chain plates are among them. Check where your
shrouds and forestay or jib halyard attach to the hull. Watch for cracks that could let
water into wooden reinforcements. Heavily loaded fasteners should be epoxied into
the boat. From time to time take your centerboard out of the boat and check both
centerboard and rudder for dings, cracks etc. Pay particular attention to the
centerboard bolt hole. If the bolt hole has been damaged such that water can get in,
16
wooden cored boards will soak up water, start to rot and will be weakened. Seal all
bare wood with epoxy. Anytime you run aground you should check the centerboard.
Inspect all lines from time to time, replace worn lines.
2.7) SAILING TERMS AND ITS MEANING:
Abeam
90 (perpendicular) to the side of the boat.
Aft
Towards the Stern or rear of the boat.
Ahead
Towards the front of the boat.
Aloft
Towards the top of the mast.
Astern
Actually behind the boat. (Aft can mean on the boat but at the rear)
Bailer
A bucket or scoop used to remove water from the cockpit.
Block
Nautical word for pulley.
Centerline
An imaginary line from the bow of the boat, to the center of the stern.
Draft
The depth of water required to float your boat. On a small sailboat, draft can
vary from the length of the centre board (or daggerboard) to a few inches if the boat
outfitted with a movable centre board (or removable daggerboard) and a kick-up
rudder.
Ease
To let out the sails.
Give-Way Vessel
The boat which changes course because it does not have the right of way.
Heel
The degree of sideways tilt caused by wind on the sails or balance of weight in
the boat.
17
Leeward
Away from the wind (downwind).
Luffing
The flapping of the sail when not properly trimmed or when the boat is in
irons.
Stand-On-Vessel
The boat which does not change course because it has the right of way.
Trim
To pull the sails in towards the wind.
Windward
Towards the wind (upwind).
18
Chapter 3
AUTOMATION OF SAILING
BOAT
19
3.1) INTRODUCTION: In this chapter we will discuss about the basic concept of our Project then we will
discuss about automation of Sailing Boat and projects key features.
3.2) HISTORY: Sailing has been for long times the only means of ship propulsion at sea. Although
the performance of a sailing vessel is well below the present power driven ships,
either in terms of navigation speed and predictability, wind energy is absolutely
reusable, clean and free. Sailing boats may exhibit a virtually unlimited autonomy
and be able to perform unassisted missions at sea for long periods of time. Promising
applications include oceanographic and weather data collecting, surveillance and even
military applications.
3.3) OVERVIEW:
Automation of sailboat is a very nonlinear and time-variant problem, and modeling
ship dynamics considering all real phenomena is a very complex task. Besides, it has
to compensate for stochastic disturbances acting upon it, such as wind, waves and
currents. Heuristics in sailing plays an important role: sailing rules obtained from
skippers can be included in a knowledge base to govern the boat correctly in different
conditions. Besides that Sailing is an Olympic class Sport played around the world.
Automation of such a kind would develop interest in the people of our Country to
actively participate in this Sport.
3.4) OBJECTIVE:
A significant advantage and objective of this project is the use of Wind Energy for the
propulsion of the boat. This might be the initial step for the awareness of sailing at the
grass route level in Pakistan and as well as in the other neighboring countries.
Participation in International Events held across the Globe could be made possible.
Heuristics involved in this Sport can easily be understood using the prototype.
Participation of Under-Developed Countries in this expensive Sport can be made
possible.
3.5) BACKGROUNDS OF PROJECT:
Sailing is the art of controlling a boat with large pieces of canvas cloth called sails. By
changing the rigging, rudder, and dagger or centre board, a sailor manages the force
of the wind on the sails in order to change the direction and speed of a boat. Mastery
of the skill requires experience in varying wind and sea conditions, as well as
knowledge concerning sailboats. The subjection of Automation of Sailing boats will
provide an innovative solution to this Sport. The popularity of Sailing will certainly
be increased with the help of these types of Projects. Involvement of Control
Electronics will certainly produce amazing results and highly sophisticated Control
Systems.
20
3.6) ALGORITHM BEHIND AUTOMATION
Since Global Positioning System is used for navigation. It provides information like
Longitude, Latitude, heading and speed etc. These values are the main inputs to the
navigational system of our project.
The basic algorithm behind the automation is the use of these longitude and latitudes
to produce a straight between destination and current location. Then from this
equation of line we can determine the coordinates of the actual path and then compare
it to the values from GPS. By differentiating both the vales we can determine the
bearing in which the boat has to move in order to follow the given path.
Figure 3-1
21
3.7) Definition of No-Go Area
In automation of a sailing boat the first thing that is supposed to make the boat
understand is the wind direction. A sailing boat cannot work into the wind. There are
certain limitations for a sailing boat to properly steer along the water. These
limitations can be manipulated using values from the Anemometer (in our case).
No-Go Area Zone (Refer to figure 2.2)
3.8) FUZZY LOGIC WITH RESPECT TO OUR PROJECT
Fuzzy logic is a form of multi-valued logic to deal with reasoning that is approximate
rather than precise. Similarly our system works in the same procedure that it does not
have precise conditions to operate the system. Therefore we require approximate
functions to deal with our system. These functions requires fuzzification and
Defuzzification as we have gone through system and have produced following
functions on the basis of rules, determined from the system behavior. Thus creating a
knowledge base.
3.8.1) FUZZY SETS
Our system has three crucial inputs and two crucial outputs.
Input Membership Function
Anemometer= MFA
MFA = {MFA1, MFA2, MFA3, .., MFA26}
Rudder = MFIR
MFIR = {MFIR1, MFIR2, MFIR3, MFIR4, MFIR5}
Sail = MFIS
MFIS = {MFIS1, MFIS2, MFIS3, MFIS4, MFIS5}
Output Membership Functions
Rudder = MFOR
MFOR = {MFOR1, MFOR2, MFOR3, MFOR4, MFOR5}
Sail = MFOS
MFOS = {MFOS1, MFOS2, MFOS3, MFOS4, MFOS5}
3.8.2) FUZZIFICATION
The fuzzification comprises the process of transforming crisp values into grades of
membership for linguistic terms of fuzzy sets. The membership function is used to
associate a grade to each linguistic term.
http://en.wikipedia.org/wiki/Multi-valued_logichttp://en.wikipedia.org/wiki/Reasoning
22
3.8.3) RULE EVALUATION
The rule evaluation process uses a list of linguistic rules from the knowledge base to
perform inference in the fuzzy domain. The inputs to this process are the fuzzy inputs
from the fuzzification process.
3.8.4) DEFUZZIFICATION
Defuzzification is the process of producing a quantifiable result in fuzzy logic.
Typically, a fuzzy system will have a number of rules that transform a number of
variables into a "fuzzy" result, that is, the result is described in terms of membership
in fuzzy sets.
3.9) KEY FEATURES:
This project provides robust features from the Automation till its Monitoring. State of
the Art Control Techniques, Complex manipulation of Time variant Analog Values
and Optimized Sensing are included in the basic features of this boat.
Implementation of Fuzzy Logic on the control system
Auto Piloting and Manual Navigation
Real Time Tracking and Monitoring
Path Logging which will provide a record of past surveyed Longitudes and Latitudes
Battery Management System
Efficient use of Wind Energy
Replacement of Human Sailor
http://en.wikipedia.org/wiki/Fuzzy_logichttp://en.wikipedia.org/wiki/Fuzzy_sets
23
Chapter 4
SYSTEM DESCRIPTION
24
4.1) INTRODUCTION:
This section will provide an overview of the system model, its constituents parts and
major data objects and their relationship that flows in the system. Data object is any
data that is being transformed by our system.
4.2) SYSTEM ARCHITECTURE:
Figure 4-1
25
4.3) SYSTEM ARCHITECTURE FOR END USER:
Figure 4-2
26
End User is subjected to the following components that are provided either to monitor
or to control the sailing boat.
These components include:
Base Station circuitry
RF-Module
MAX-232
Power Supply
Personal Computer
Visual Basic
o Monitoring
Rudder Position
Sail Position
Wind Direction
Battery Level
Longitude
Latitude
Speed
Heading
o Controlling
Rudder
Sail
27
GRAPHICAL USER INTERFACE
The following is the Human Machine Interface which is being used in our system
which provides visual display from all the sensors and feedback values and it all
enables us to manually control the Boat. The Data Base is also connected with this
GUI/HMI.
Figure 4-3
28
MICROSOFT ACCESS DATA BASE
A constant stream of data from microcontroller in the form of command byte is sent
to the base station in the following format:
$ Rudde
r
Anemomete
r
Sail
Positio
n
Tim
e
Latitud
e
Longitud
e
Headin
g
Speed *
The above defined format is received and saved in the data base in the Microsoft
Access Data Base in their respective fields.
Figure 4-4
29
4.4) SYSTEM ARCHITECTURE OFF SHORE:
Figure 4-5
For further details review the base station and off shore station section
30
4.5) SUBSYSTEM OVERVIEW:
4.5.1) OFF SHORE STATION
4.5.1.1) MAIN CIRCUIT DIAGRAM
Figure 4-6
31
4.5.1.2) GPS INTERFACING:
Figure 4-7
32
4.5.1.3) DC MOTOR INTERFACING:
Figure 4-8
4.5.1.4) ANEMOMETER INTERFACING:
A free end potentiometer is used with a wooden assembly. The output of the
potentiometer is connected to the ADC of the microcontroller. It gives a particular
value at different angles which is used to calculate the wind direction.
33
RUDDER FEEDBACK:
The position of rudder is decoded from the potentiometer installed in a servo package
i.e. built in. The analog voltage across this potentiometer is then feedback to the 8-bit
ADC of the microcontroller.
SAIL TRIM FEEDBACK:
Feedback of sail is coming from the opto-coupler which is connected with the DC
motor. It is counting the count that how much the sail is loosed or tight. The
programming is interrupt based.
BMS FEEDBACK:
An Operational Amplifier is used to measure the voltage level of the system battery.
The configuration used in Op-Amp is Differential Amplifier with a gain of Unity.
Figure 4-9
34
Chapter 5
FUZZY CONTROLLING
LOGIC
35
5.1) INTRODUCTION:
In this chapter we will discuss about fuzzy controlling logic. It contains what is
fuzzy what are its degree of operation, structure, fuzzification rule to
evaluation fuzzification and defuzzification with rules to evaluate.
5.2) FUZZY CONTROLLING LOGIC:
Because of its association with neural networks and artificial intelligence, many
people expect fuzzy logic to require complex algorithms and lots of processing
horsepower. Surprisingly, even a small 8-bit microcontroller can be programmed to
perform fuzzy logic inference. This can perform tasks in milliseconds. This speed is
appropriate for many common control applications, and the small program size can
easily fit within the budget of a small MCU system. This paper discusses the
requirements of fuzzy logic and describes the structure of a general purpose fuzzy
inference program that is suitable for use in small 8-bit microcontroller systems.
5.3) DEGREES OF TRUTH:
Fuzzy logic derives its power from the concept of partial degrees of truth. Unlike
Boolean logic where a given input level either is or is not a member of a selected set,
fuzzy logic allows an input value to be a partial member of a set. In fact the same
input value can be a partial member of an overlapping set at the same time. For
example, the temperature 50F can be both COLD and COOL at the same time. In
Boolean logic, truth can be represented by a single bit with one representing true and
zero representing false. In fuzzy logic, truth can be represented by an 8-bit value in
the range $00 (0 or completely false) to $FF (0.996 or completely true).
The second powerful concept in fuzzy logic is that of linguistic variables. Linguistic
variables allow rules to be stated in a language that closely resembles natural
language. This allows an application expert to describe a system in familiar terms
without requiring knowledge of computer programming. These two important
concepts are tied together by membership functions. An input membership function
describes the meaning of a linguistic label by providing a mapping of truth values
for all possible values of the input. Typically trapezoids are used for input
membership functions because they satisfy the need for a gradual change from
false to true without requiring much memory space. A trapezoid can be defined by
two 8-bit points and two 8-bit slopes. Output membership functions typically use
simpler singletons to relate a linguistic label to a specific output value. The
corresponding fuzzy output determines the height (weight) of the singleton.
5.4) OVERALL STRUCTURE:
As shown in Figure #, a software fuzzy inference unit (nu) consists of three main
parts. Each of these subprograms has an associated data structure in a
36
knowledge base. All application specific information is contained in the knowledge
base which is developed independently from the fuzzy inference program.
Figure 5-1
(Software Fuzzy Interface Unit)
The fuzzification process uses membership functions from the knowledge base to
transform system input values, such as a binary value from a temperature sensor, into
fuzzy input values. The fuzzy input values are stored in RAM for use in the following
rule evaluation subprogram. The rule evaluation process uses linguistic rules from the
knowledge base to produce fuzzy outputs based on the current values of fuzzy inputs.
The fuzzy outputs are stored in RAM for use by the last process in the fuzzy inference
program. The final defuzzification process uses output membership functions from
the knowledge base to resolve the fuzzy outputs into a single system output. The
system output is a weighted average of the fuzzy outputs.
5.5) FUZZIFICATION:
The first process in a fuzzy inference unit takes us out of the domain of crisp
input values like 50F and into the fuzzy domain where fuzzy inputs (RAM
variables) describe the degree to which linguistic expressions are true. The key to
this translation is the input membership function which provides a numerical meaning
to a linguistic label such as COOL. A trapezoid is used because it provides a
37
reasonable compromise between shape flexibility and memory space required to
define the membership function. Four bytes can describe any trapezoidal membership
function. Figure # shows two membership functions (labeled COLD and COOL) for
the system input named TEMPERATURE. The vertical dashed line shows that
when temperature is 50F, the label COLD has a degree of membership of
about $40 or about 25% true. At 50F, the label COOL has a degree of membership
of $BF or about 75% true.
Two Input Member Function
Figure 5-2
Notice that as the system input value changes from $40 to $70, the label COLD
changes gradually from completely true to completely false. At the same time,
COOL changes from completely false to completely true. In a medium sized system
like an inverted pendulum, there may be two system inputs with seven linguistic
labels per input, or fourteen membership functions. Using trapezoids, this system
would need only 56 bytes to define the input membership functions. The freeware
program mentioned earlier uses a 43 byte routine to calculate a fuzzy input value for a
given system input value. This routine is placed in a simple loop, and is executed once
for each label of each system input. The inputs to the fuzzification process are the
current values of system inputs such as temperature and pressure. The outputs are 8-
bit fuzzy input values stored in RAM variable locations. One byte of RAM is required
for each label of each system input.
5.6) RULE EVALUATION:
The rule evaluation process uses a list of linguistic rules from the knowledge base
to perform inference in the fuzzy domain. The inputs to this process are the fuzzy
inputs from the fuzzification process. The outputs of this process are fuzzy outputs (8-
bit values in RAM variable locations). The rule "If temperature is warm and pressure
is medium then fan is medium-high has two antecedents (inputs) and one consequent
(output). Each antecedent is of the form "input-name is label", where input-name is
the name assigned to a system input and label is the name of a label of that input.
Each consequent is of the form "output-name is label", where output-name is the
name of a system output and label is the name of a label of that output. To evaluate a
38
rule you would replace each antecedent phrase with the associated fuzzy input
value, determine the overall truth value of the rule, and update the fuzzy output
corresponding to the rule consequent. This is done by storing the rules as a list of
addresses or pointers to fuzzy inputs and fuzzy outputs.
In microcontroller based fuzzy inference units, only two operators are needed. The
AND operator connects rule antecedents and an implied OR operator connects
separate rules. The AND operator corresponds to the mathematical minimum
operation and OR corresponds to the maximum operation. The overall truth of a
rule is found by taking the minimum of all fuzzy inputs to the rule. Before any
rules are processed, all fuzzy outputs are cleared to zero. As rules are evaluated, the
truth value for the rule is stored to the fuzzy output corresponding to the rule
consequent unless the fuzzy output is already larger. In this way the fuzzy output ends
up with the maximum truth value of any rule related to that fuzzy output. This is
called min-max rule evaluation.
5.7) DEFUZZIFICATION:
The fuzzy outputs generated by the rule evaluation process collectively define the
desired system output. The defuzzification process takes a weighted average to
translate the fuzzy outputs into a single crisp system output value.
Singleton type output membership functions are used for a microcontroller based FIU.
A singleton is defined by an 8-bit value that represents the output value
corresponding to a linguistic label of a system output. The corresponding fuzzy
output value in RAM provides the height (weight) of the singleton. The following
formula is used to calculate the weighted average which is used as the system output
value.
The operations required to implement fuzzy logic inference are simple enough for a
small 8-bit MCU. Memory requirements are small and execution time for a software
fuzzy inference unit is fast enough for typical real-time control applications.As fuzzy
logic becomes familiar to more engineers, applications once thought too difficult for
small microcontrollers will routinely be solved using fuzzy logic techniques.
Good general purpose fuzzy inference programs will allow non-programmers to
access the power of microcontrollers to solve a wide range of design problems.
39
Chapter 6
DESCRIPTION OF
ELECTRONIC
COMPONENTS
40
6.1) INTRODUCTION
In this chapter we will discuss controller that used in our project the features,
significant and other parameter of the controller its block diagram pin configuration
and description of pins.
6.2) ATMEGA-16 8-bit Microcontroller with 16K Bytes In-
System Programmable Flash
Figure 6-1
6.2.1) OVERVIEW:
The ATmega16 is a low-power CMOS 8-bit microcontroller based on the AVR
enhanced RISC architecture. By executing powerful instructions in a single clock
cycle, the ATmega16 achieves throughputs approaching 1 MIPS per MHz allowing
the system designed to optimize power consumption versus processing speed.
6.2.2) FEATURES:
High-performance, Low-power AVR 8-bit Microcontroller
Advanced RISC Architecture
131 Powerful Instructions Most Single-clock Cycle Execution
32 x 8 General Purpose Working Registers
Fully Static Operation
Up to 16 MIPS Throughput at 16 MHz
On-chip 2-cycle Multiplier
High Endurance Non-volatile Memory segments
16K Bytes of In-System Self-programmable Flash program memory
512 Bytes EEPROM
1K Byte Internal SRAM
Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
Data retention: 20 years at 85C/100 years at 25C(1)
Optional Boot Code Section with Independent Lock Bits
41
In-System Programming by On-chip Boot Program
True Read-While-Write Operation
Programming Lock for Software Security
JTAG (IEEE std. 1149.1 Compliant) Interface
Boundary-scan Capabilities According to the JTAG Standard
Extensive On-chip Debug Support
Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface
Peripheral Features
Two 8-bit Timer/Counters with Separate Pre scalars and Compare Modes
One 16-bit Timer/Counter with Separate Pre scalar, Compare Mode, and Capture
Mode
Real Time Counter with Separate Oscillator
Four PWM Channels
8-channel, 10-bit ADC
8 Single-ended Channels
7 Differential Channels in TQFP Package Only
2 Differential Channels with Programmable Gain at 1x, 10x, or 200x
Byte-oriented Two-wire Serial Interface
Programmable Serial USART
Master/Slave SPI Serial Interface
Programmable Watchdog Timer with Separate On-chip Oscillator
On-chip Analog Comparator
Special Microcontroller Features
Power-on Reset and Programmable Brown-out Detection
Internal Calibrated RC Oscillator
External and Internal Interrupt Sources
Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended Standby
I/O and Packages
32 Programmable I/O Lines
40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
Operating Voltages
4.5 - 5.5V for ATmega16
Speed Grades
0 - 16 MHz for ATmega16
Power Consumption @ 1 MHz, 3V, and 25C for ATmega16L
Active: 1.1 mA
Idle Mode: 0.35 mA
Power-down Mode: < 1 A
42
6.2.3) PIN CONFIGURATION:
Figure 6-2
43
6.2.4) BLOCK DIAGRAM:
Figure 6-3
6.2.5) PIN DESCRIPTION:
VCC
Digital supply voltage.
GND
Ground.
Port A (PA0-PA7)
Port A serves as the analog inputs to the A/D Converter. Port A also serves as
an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide
internal pull-up resistors (selected for each bit). The Port A output buffers have sym-
metrical drive characteristics with both high sink and source capability. When pins
PA0 to PA7 are used as inputs and are externally pulled low, they will source current
if the internal pull-up resistors are activated. The Port A pins are tri-stated when a
reset condition becomes active, even if the clock is not running.
44
Port B (PB0-PB7)
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port B output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port B pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port B pins are tri-stated when a reset condition becomes active, even if the clock is
not running. Port B also serves the functions of various special features of the
ATmega16 as listed on page 58.
Port C (PC0-PC7)
Port C is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port C output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port C pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port C pins are tri-stated when a reset condition becomes active, even if the clock is
not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5 (TDI),
PC3 (TMS) and PC2 (TCK) will be activated even if a reset occurs. Port C also serves
the functions of the JTAG interface and other special features of the ATmega16 as
listed on page 61.
Port D (PD0-PD7)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port D output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port D pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port D pins are tri-stated when a reset condition becomes active, even if the clock is
not running. Port D also serves the functions of various special features of the
ATmega16 as listed on page 63.
RESET
Reset Input. A low level on this pin for longer than the minimum pulse length
will generate a reset, even if the clock is not running. The minimum pulse length is
given in Table 15 on page 38. Shorter pulses are not guaranteed to generate a reset.
XTAL1
Input to the inverting Oscillator amplifier and input to the internal clock
operating circuit.
XTAL2
Output from the inverting Oscillator amplifier.
AVCC
AVCC is the supply voltage pin for Port A and the A/D Converter. It should
be externally connected to VCC, even if the ADC is not used. If the ADC is used, it
should be connected to VCC through a low-pass filter.
AREF
AREF is the analog reference pin for the A/D Converter.
45
6.3) DC GEAR MOTOR:
We are using 3 DC Motors to rotate the shafts in the vessels these all 3 motors are 24v
dc Many projects require the use of a cheap dc motor to create rotational movement.
There are a number of ways motors can be interfaced to the microcontroller. This
circuit uses a darling ton transistor to switch the motor on and off. This circuit will
work with solar motors, but may not function correctly with cheap dc motors. This
is because this type of motor introduces a lot of electrical noise on to the power
rails. This noise can affect the microcontroller, and in some cases can completely stop
the control program functioning. These comparators are designed for use in level
detection, low-level sensing and memory applications in consumer, automotive, and
industrial electronic applications.
Figure 6-4
6.4) SERVO MOTOR:
Servo is an automatic device that uses error-sensing feedback to correct the
performance of a mechanism. The term correctly applies only to systems where the
feedback or error-correction signals help control mechanical position or other
parameters. For example, an automotive power window control is not a
servomechanism, as there is no automatic feedback that controls position the operator
does this by observation. By contrast the car's cruise control uses closed loop
feedback, which classifies it as a servomechanism.
http://en.wikipedia.org/wiki/Feedbackhttp://en.wikipedia.org/wiki/Cruise_controlhttp://en.wikipedia.org/wiki/Control_theoryhttp://en.wikipedia.org/wiki/Control_theoryhttp://en.wikipedia.org/wiki/Control_theory
46
A servomechanism is unique among control systems in that it controls a parameter by
commanding the time-based derivative of that parameter. For example, a
servomechanism controlling position must be capable of changing the velocity of the
system because the time-based derivative (rate change) of position is velocity. A
hydraulic actuator controlled by a spool valve and a position sensor is a good example
because the velocity of the actuator is proportional to the error signal of the position
sensor.
Figure 6-5
Servo motors are devices which provide precise position through feedback. RC
Servos can rotate only 180 degree and have wide applications in robotics. These
servos are used for application like robotic arms and humanoid.
RC servos consist of a DC motor, gearbox, control circuit and feedback devices. The
feedback device (mostly potentiometer) is mechanically coupled to the output shaft.
The control signal (PWM signal) proportional to the required shaft position is given to
the servo.
Figure 6-6
47
The PWM signal is converted into a voltage corresponding to the desired position.
The output voltage also changes in proportion to the actual shaft position. These two
will have same value if the position of the shaft is at the desired position. If the
position of the shaft is not the same as desired position then an error voltage is
generated which will move the motor until the desired position is obtained.
Figure 6-7
The RC Servo motors require a PWM having time period of around 20ms is required
and the pulse width of 1-2ms. 1ms pulse width corresponds to 0 degree and 2ms pulse
width corresponds to 180 degree. For any other angle between 0 degree and 180
degree corresponding pulse width is required. The RC servo has three wires, one for
control signal and others for power supply (Vcc and Gnd). Operating voltage or
supply voltage is in the range of 4.8v to 6v. Refer to the programming section for the
program of RC Servo motor.
6.5) MAX-232 DUAL RECIEVER
6.5.1) INTRODUCTON:
The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to
supply TIA/EIA-232-F voltage levels from a single 5-V supply. Each receiver
converts TIA/EIA-232-F inputs to 5-V TTL/CMOS levels. These receivers have a
typical threshold of 1.3 V, a typical hysteresis of 0.5 V, and can accept 30-V inputs.
Each driver converts TTL/CMOS input levels into TIA/EIA-232-F levels. It has two
drivers and two receivers.
48
6.5.2) PIN CONFIGURATION:
Figure 6-8
6.5.3) FUNCTION TABLES:
EACH DRIVER
INPUT
TIN
OUTPUT
TOUT
H L
L H
EACH RECIEVER
INPUT
RIN
OUTPUT
ROUT
L H
H L
49
6.5.4) LOGIC DIAGRAMS (POSITIVE LOGIC):
Figure 6-9
6.5.5) APPLICATION INFORMATION:
Figure 6-10
50
Chapter 7
NAVIGATIONAL MODULE
51
7.1) INTRODUCTION:
In this chapter we discuss about the navigational component used. There is interfacing
and description of GPS navigation module. There is also description of NMEA
protocol to extract and differ in data get from GPS
7.2) HOLUX M-89 GPS MODULE
Figure 7-1
7.2.1) HISTORY:
M-89 is an ultra miniature 25.4 * 25.4 * 3 mm GPS engine board designed by low
Power consumption MTK GPS solution. It provides superior sensitivity up to -
159dBm and fast Time-To-First-Fix in navigation application. The stable performance
of M-89 is your best choice to be embedded in your portable device design, like PDA,
PND, mobile phone, Digital Camera for GPS service.
7.2.2) KEY FEATURES:
Small form factor: 25.4 * 25.4 * 3 mm
RoHS/WEEE compliant
High sensitivity -159dBm
Searching up to 32 Channel of satellites
Fast Position Fix
Low power consumption
RTCM-in ready.
52
Built-in WAAS/EGNOS/MSAS Demodulator.
Support NMEA0183 V 3.01 data protocol.
Real time navigation for location based services.
For Car Navigation, Marine Navigation, Fleet Management, AVL and Location-Based Services, Auto Pilot, Personal Navigation or touring devices,
Tracking devices/systems and Mapping devices application
7.2.3) APPLICATIONS:
Automotive and Marine Navigation
Automotive Navigator Tracking
Emergency Locator
Geographic Surveying
Personal Positioning
Sporting and Recreation
Embedded applications:
Smart phone, UMPC, PND, MP4
7.2.4) BLOCK DIAGRAM:
Figure 7-2
53
7.2.5) PIN DEFINATION:
Figure 7-3
Pin No. Pin Name Type Function Description
1 VCC_IN I/p 3.3 - 5 V Supply Input
2 GND Gnd Ground
3 NC I/p NC
4 RXDA I/p Serial Data Input A
5 TXDA O/p Serial Data Output A
6 TXDB O/p Serial Data Output
7 RXDB I/p Serial Data Input B
8 GPIO0 I/O General purpose I/O. Flash at 1Hz when position is fixed
9 INT1 I/O General purpose I/O
10 GND Gnd Ground
11 GND Gnd Ground
12 GND Gnd Ground
13 GND Gnd Ground
14 GND Gnd Ground
15 GND Gnd Ground
16 GND Gnd Ground
17 RF_IN I/p GPA Signal Input
18 GND I/p Ground
19 V_ANT_IN I/p Antenna Power Supply Input, 3V
20 VCC_RF_O O/p Antenna Power Supply, 2.8V
21 V_BAT I/p RTC and backup SRAM power, 2.6 - 3.6 VDC
22 HRST I/p Reset, Active low
54
7.3) NMEA Data Protocol:
7.3.1) THE PROTOCOL:
The National Marine Electronics Association (NMEA) has developed a specification
that defines the interface between various pieces of marine electronic equipment. The
standard permits marine electronics to send information to computers and to other
marine equipment. A full copy of this standard is available for purchase at their web
site. None of the information on this site comes from this standard and I do not have a
copy. Anyone attempting to design anything to this standard should obtain an official
copy.
GPS receiver communication is defined within this specification. Most computer
programs that provide real time position information understand and expect data to be
in NMEA format. This data includes the complete PVT (position, velocity, time)
solution computed by the GPS receiver. The idea of NMEA is to send a line of data
called a sentence that is totally self contained and independent from other sentences.
There are standard sentences for each device category and there is also the ability to
define proprietary sentences for use by the individual company. All of the standard
sentences have a two letter prefix that defines the device that uses that sentence type.
(For gps receivers the prefix is GP.) which is followed by a three letter sequence that
defines the sentence contents. In addition NMEA permits hardware manufactures to
define their own proprietary sentences for whatever purpose they see fit. All
proprietary sentences begin with the letter P and are followed with 3 letters that
identifies the manufacturer controlling that sentence. For example a Garmin sentence
would start with PGRM and Magellan would begin with PMGN.
Each sentence begins with a '$' and ends with a carriage return/line feed sequence and
can be no longer than 80 characters of visible text (plus the line terminators). The data
is contained within this single line with data items separated by commas. The data
itself is just ascii text and may extend over multiple sentences in certain specialized
instances but is normally fully contained in one variable length sentence. The data
may vary in the amount of precision contained in the message. For example time
might be indicated to decimal parts of a second or location may be show with 3 or
even 4 digits after the decimal point. Programs that read the data should only use the
commas to determine the field boundaries and not depend on column positions. There
is a provision for a checksum at the end of each sentence which may or may not be
checked by the unit that reads the data. The checksum field consists of a '*' and two
23 GPIO1 I/O General purpose I/O
24 GPIO2 I/O General purpose I/O
25 GPIO3 I/O General purpose I/O
26 GPIO4 I/O General purpose I/O
27 GPIO5 I/O General purpose I/O
28 GPIO6 I/O General purpose I/O
29 PPS O/p 1 PPS output, synchronized with GPS time. TIME_MARK
1PPS output, 1us/s
30 GND Gnd Ground
http://www.nmea.org/
55
hex digits representing an 8 bit exclusive OR of all characters between, but not
including, the '$' and '*'. A checksum is required on some sentences.
There have been several changes to the standard but for gps use the only ones that are
likely to be encountered are 1.5 and 2.0 through 2.3. These just specify some different
sentence configurations which may be peculiar to the needs of a particular device thus
the gps may need to be changed to match the devices being interfaced to. Some gps's
provide the ability configure a custom set the sentences while other may offer a set of
fixed choices. Many gps receivers simply output a fixed set of sentences that cannot
be changed by the user. The current version of the standard is 3.01. I have no specific
information on this version, but I am not aware of any GPS products that require
conformance to this version.
7.3.2) HARDWARE CONNECTION:
The hardware interface for GPS units is designed to meet the NMEA requirements.
They are also compatible with most computer serial ports using RS232 protocols,
however strictly speaking the NMEA standard is not RS232. They recommend
conformance to EIA-422. The interface speed can be adjusted on some models but the
NMEA standard is 4800 b/s (bit per second rate) with 8 bits of data, no parity, and
one stop bit. All units that support NMEA should support this speed. Note that, at a
b/s rate of 4800, you can easily send enough data to more than fill a full second of
time. For this reason some units only send updates every two seconds or may send
some data every second while reserving other data to be sent less often. In addition
some units may send data a couple of seconds old while other units may send data that
is collected within the second it is sent. Generally time is sent in some field within
each second so it is pretty easy to figure out what a particular gps is doing. Some
sentences may be sent only during a particular action of the receiver such as while
following a route while other receivers may always send the sentence and just null out
the values. Other difference will be noted in the specific data descriptions defined
later in the text.
At 4800 b/s you can only send 480 characters in one second. Since an NMEA
sentence can be as long as 82 characters you can be limited to less than 6 different
sentences. The actual limit is determined by the specific sentences used, but this
shows that it is easy to overrun the capabilities if you want rapid sentence response.
NMEA is designed to run as a process in the background spitting out sentences which
are then captured as needed by the using program. Some programs cannot do this and
these programs will sample the data stream, then use the data for screen display, and
then sample the data again. Depending on the time needed to use the data there can
easily be a lag of 4 seconds in the responsiveness to changed data. This may be fine in
some applications but totally unacceptable in others. For example a car traveling at 60
mph will travel 88 feet in one second. Several second delays could make the entire
system seem unresponsive and could cause you to miss your turn.
The NMEA standard has been around for many years (1983) and has undergone
several revisions. The protocol has changed and the number and types of sentences
may be different depending on the revision. Most GPS receivers understand the
standard which is called: 0183 version 2. This standard dictates a transfer rate of 4800
b/s. Some receivers also understand older standards. The oldest standard was 0180
followed by 0182 which transferred data at 1200 b/s. An earlier version of 0183 called
56
version 1.5 is also understood by some receivers. Some Garmin units and other brands
can be set to 9600 for NMEA output or even higher but this is only recommended if
you have determined that 4800 works ok and then you can try to set it faster. Setting it
to run as fast as you can may improve the responsiveness of the program.
In order to use the hardware interface you will need a cable. Generally the cable is
unique to the hardware model so you will need an cable made specifically for the
brand and model of the unit you own. Some of the latest computers no longer include
a serial port but only a USB port. Most gps receivers will work with Serial to USB
adapters and serial ports attached via the pcmcia (pc card) adapter. For general
NMEA use with a gps receiver you will only need two wires in the cable, data out
from the gps and ground. A third wire, Data in, will be needed if you expect the
receiver to accept data on this cable such as to upload waypoints or send DGPS data
to the receiver.
GPS receivers may be used to interface with other NMEA devices such as autopilots,
fish finders, or even another gps receivers. They can also listen to Differential Beacon
Receivers that can send data using the RTCM SC-104 standard. This data is consistent
with the hardware requirements for NMEA input data. There are no handshake lines
defined for NMEA.
7.3.3) NMEA SENTENCES:
NMEA consists of sentences, the first word of which, called a data type, defines the
interpretation of the rest of the sentence. Each Data type would have its own unique
interpretation and is defined in the NMEA standard. The GGA sentence (shown
below) shows an example that provides essential fix data. Other sentences may repeat
some of the same information but will also supply new data. Whatever device or
program that reads the data can watch for the data sentence that it is interested in and
simply ignore other sentences that is doesn't care about. In the NMEA standard there
are no commands to indicate that the gps should do something different. Instead each
receiver just sends all of the data and expects much of it to be ignored. Some receivers
have commands inside the unit that can select a subset of all the sentences or, in some
cases, even the individual sentences to send. There is no way to indicate anything
back to the unit as to whether the sentence is being read correctly or to request a re-
send of some data you didn't get. Instead the receiving unit just checks the checksum
and ignores the data if the checksum is bad figuring the data will be sent again
sometime later.
There are many sentences in the NMEA standard for all kinds of devices that may be
used in a Marine environment. Some of the ones that have applicability to gps
receivers are listed below: (all message start with GP.)
AAM - Waypoint Arrival Alarm
ALM - Almanac data
APA - Auto Pilot A sentence
APB - Auto Pilot B sentence
BOD - Bearing Origin to Destination
BWC - Bearing using Great Circle route
DTM - Datum being used.
http://www.gpsinformation.org/dale/nmea.htm#GGA#GGAhttp://www.gpsinformation.org/dale/nmea.htm#GGA#GGAhttp://www.gpsinformation.org/dale/nmea.htm#GGA#GGAhttp://www.gpsinformation.org/dale/nmea.htm#AAM#AAMhttp://www.gpsinformation.org/dale/nmea.htm#ALM#ALMhttp://www.gpsinformation.org/dale/nmea.htm#APB#APBhttp://www.gpsinformation.org/dale/nmea.htm#BOD#BODhttp://www.gpsinformation.org/dale/nmea.htm#BWC#BWC
57
GGA - Fix information
GLL - Lat/Lon data
GRS - GPS Range Residuals
GSA - Overall Satellite data
GST - GPS Pseudorange Noise Statistics
GSV - Detailed Satellite data
MSK - send control for a beacon receiver
MSS - Beacon receiver status information.
RMA - recommended Loran data
RMB - recommended navigation data for gps
RMC - recommended minimum data for gps
RTE - route message
TRF - Transit Fix Data
STN - Multiple Data ID
VBW - dual Ground / Water Spped
VTG - Vector track an Speed over the Ground
WCV - Waypoint closure velocity (Velocity Made Good)
WPL - Waypoint Location information
XTC - cross track error
XTE - measured cross track error
ZTG - Zulu (UTC) time and time to go (to destination)
ZDA - Date and Time
Some gps receivers with special capabilities output these special messages.
HCHDG - Compass output
PSLIB - Remote Control for a DGPS receiver
In addition some GPS receivers can mimic Loran-C receivers by outputing the LC
prefix in some of their messages so that they can be used to interface to equipment
that is expecting this prefix instead of the GP one.
The last version 2 iteration of the NMEA standard was 2.3. It added a mode indicator
to several sentences which is used to indicate the kind of fix the receiver currently
has. This indication is part of the signal integrity information needed by the FAA. The
value can be A=autonomous, D=differential, E=Estimated, N=not valid, S=Simulator.
Sometimes there can be a null value as well. Only the A and D values will correspond
to an Active and reliable Sentence. This mode character has been added to the RMC,
RMB, VTG, and GLL, sentences and optionally some others including the BWC and
XTE sentences.
If you are interfacing a GPS unit to another device, including a computer program,
you need to ensure that the receiving unit is given all of the sentences that it needs. If
it needs a sentence that your GPS does not send then the interface to that unit is likely
to fail. Here is a Link for the needs of some typical programs. The sentences sent by
some typical receivers include:
http://www.gpsinformation.org/dale/nmea.htm#GGA#GGAhttp://www.gpsinformation.org/dale/nmea.htm#GLL#GLLhttp://www.gpsinformation.org/dale/nmea.htm#GSA#GSAhttp://www.gpsinformation.org/dale/nmea.htm#GSV#GSVhttp://www.gpsinformation.org/dale/nmea.htm#MSK#MSKhttp://www.gpsinformation.org/dale/nmea.htm#MSS#MSShttp://www.gpsinformation.org/dale/nmea.htm#RMB#RMBhttp://www.gpsinformation.org/dale/nmea.htm#RMC#RMChttp://www.gpsinformation.org/dale/nmea.htm#RTE#RTEhttp://www.gpsinformation.org/dale/nmea.htm#VTG#VTGhttp://www.gpsinformation.org/dale/nmea.htm#WPL#WPLhttp://www.gpsinformation.org/dale/nmea.htm#XTE#XTEhttp://www.gpsinformation.org/dale/nmea.htm#ZDA#ZDAhttp://www.gpsinformation.org/dale/nmea.htm#HCHDG#HCHDGhttp://www.gpsinformation.org/dale/nmea.htm#PSLIB#PSLIBhttp://gpsinformation.net/main/nmea3.txt
58
NMEA 2.0
Name Garmin Magellan Lowrance SiRF Notes:
GPAPB N Y Y N Auto Pilot B
GPBOD Y N N N bearing, origin to destination - earlier G-
12's do not transmit this
GPGGA Y Y Y Y fix data
GPGLL Y Y Y Y Lat/Lon data - earlier G-12's do not
transmit this
GPGSA Y Y Y Y overall satellite reception data, missing
on some Garmin models
GPGSV Y Y Y Y detailed satellite data, missing on some
Garmin models
GPRMB Y Y Y N minimum recommended data when
following a route
GPRMC Y Y Y Y minimum recommended data
GPRTE Y U U N route data, only when there is an active
route. (this is sometimes bidirectional)
GPWPL Y Y U N
waypoint data, only when there is an
active route (this is sometimes
bidirectional)
NMEA 1.5 - some units do not support version 1.5. Lowrance units provide the ability
to customize the NMEA output by sentences so that you can develop your own
custom sentence structure.
Name Garmin Magellan Notes:
GPAPA N Y Automatic Pilot A
GPBOD Y N bearing origin to destination - earlier G-12's do not send
this
GPBWC Y Y bearing to waypoint using great circle route.
GPGLL Y Y lat/lon - earlier G-12's do not send this
GPRMC Y N minimum recommend data
GPRMB Y N minimum recommended data when following a route
GPVTG Y Y vector track and speed over ground
GPWPL Y N waypoint data (only when active goto)
GPXTE Y Y cross track error
The NMEA 2.3 output from the Garmin Legend, Vista, and perhaps some others
include the BWC, VTG, and XTE sentences.
59
The Trimble Scoutmaster outputs: APA, APB, BWC, GGA, GLL, GSA, GSV, RMB,
RMC, VTG, WCV, XTE, ZTG.
The Motorola Encore outputs: GGA, GLL, GSV, RMC, VTG, ZDA and a proprietary
sentence PMOTG.
Units based on the SiRF chipset can output: GGA, GLL, GSA, GSV, RMC, and VTG.
What is actually output is based on which sentences are selected by the user or
application program. See below for more details. Some implementations have
enhanced the SiRF capabilities with other sentences as well by changing the
firmware. For example, the u-blox receivers add ZDA and some proprietary sentences
to the above list of sentences. Check your documentation for more details.
Garmin receivers send the following Proprietary Sentences:
PGRME (estimated error) - not sent if set to 0183 1.5
PGRMM (map datum)
PGRMZ (altitude)
PSLIB (beacon receiver control)
Note that Garmin converts lat/lon coordinates to the datum chosen by the user when
sending this data. This is indicated in the proprietary sentence PGRMM. This can help
programs that use maps with other datums but is not an NMEA standard. Be sure and
set your datum to WGS84 on Garmin units when communicating to other NMEA
devices.
Magellan also converts lat/lon coordinates to the datum chosen on the receiver but do
not indicate this in a message. Magellan units use proprietary sentences for waypoint
maintenance and other tasks. They use a prefix of PMGN for this data.
Most other units always output NMEA messages in the WGS84 datum. Be sure and
check the user documentation to be sure.
It is possible to just view the information presented on the NMEA interface using a
simple terminal program. If the terminal program can log the session then you can
build a history of the entire session into a file. More sophisticated logging programs
can filter the messages to only certain sentences or only collect sentences at
prescribed intervals. Some computer programs that provide real time display and
logging actually save the log in an ascii format that can be viewed with a text editor or
used independently from the program that generated it.
7.3.4) NMEA INPUT:
Some units also support an NMEA input mode. While not too many programs support
this mode it does provide a standardized way to update or add waypoint and route
data. Note that there is no handshaking or commands in NMEA mode so you just send
the data in the correct sentence and the unit will accept the data and add or overwrite
the information in memory. If the data is not in the correct format it will simply be
ignored. A carriage return/line feed sequence is required. If the waypoint name is the
same you will overwrite existing data but no warning will be issued. The sentence
http://www.gpsinformation.org/dale/nmea.htm#PMOTG#PMOTGhttp://www.gpsinformation.org/dale/nmea.htm#sirf#sirfhttp://www.gpsinformation.org/dale/nmea.htm#PGRME#PGRMEhttp://www.gpsinformation.org/dale/nmea.htm#PGRMM#PGRMMhttp://www.gpsinformation.org/dale/nmea.htm#PGRMM#PGRMMhttp://www.gpsinformation.org/dale/nmea.htm#PSLIB#PSLIB
60
construction is identical to what the unit downloads so you can, for example, capture a
WPL sentence from one unit and then send that same sentence to another unit but be
careful if the two units support waypoint names of different lengths since the
receiving unit might truncate the name and overwrite a waypoint accidently. If you
create a sentence from scratch you should create a correct checksum. Be sure you
know and have set you unit to the correct datum. Many units support the input of
WPL sentences and a few support RTE as well.
On NMEA input the receiver stores information based on interpreting the sentence
itself. While some receivers accept standard NMEA input this can only be used to
update a waypoint or similar task and not to send a command to the unit. Proprietary
input sentences could be used to send commands. Since the Magellan upload and
download maintenance protocol is based on NMEA sentences they support a modified
WPL message that adds comments, altitude, and icon data.
Some marine units may accept input for alarms such as deep or s