Sailing boat - algorithm beating or not
hello everyone
i have problems designing algorithm rc sailing boat decides if course given possible sail or if necessary go beating.
i have given direction of wind, can calculated direction relative boat , compass, , direction boat should go transferred arduino rc.
my trouble define sector of circle (0-359degrees), in boat has beat , cannot sail directly.
my idea define : direction ok if smaller wind direction - 35 degrees, or bigger wind direction + 35 degrees.
this unfortunately works if north (0 degrees) between these 2 boundaries. don't know how define case e.g. sector 280 - 350 degrees.
i hope understandable mean, thank
ps: please link me topic problem discussed, didn't find :/
i have problems designing algorithm rc sailing boat decides if course given possible sail or if necessary go beating.
i have given direction of wind, can calculated direction relative boat , compass, , direction boat should go transferred arduino rc.
my trouble define sector of circle (0-359degrees), in boat has beat , cannot sail directly.
my idea define : direction ok if smaller wind direction - 35 degrees, or bigger wind direction + 35 degrees.
this unfortunately works if north (0 degrees) between these 2 boundaries. don't know how define case e.g. sector 280 - 350 degrees.
i hope understandable mean, thank

ps: please link me topic problem discussed, didn't find :/
you can add current heading (compass input) relative wind direction (direction indicator input) absolute wind direction. can compare absolute wind direction desired heading see desired heading close wind.
for example:
current heading: 45°
relative wind: coming 210°
absolute wind: 255° (210+45+360 modulo 360)
available headings: below 220° (255-35+360 modulo 360) , above 290° (255+35+360 modulo 360)
if math crosses 0° boundary:
current heading: 55°
relative wind: coming 310°
absolute wind: 5° (310°+55°+360 modulo 360)
available headings: below 330° (5-35+360 modulo 360) , above 40° (5+35+360 modulo 360)
note: integer modulo operator %
for example:
current heading: 45°
relative wind: coming 210°
absolute wind: 255° (210+45+360 modulo 360)
available headings: below 220° (255-35+360 modulo 360) , above 290° (255+35+360 modulo 360)
if math crosses 0° boundary:
current heading: 55°
relative wind: coming 310°
absolute wind: 5° (310°+55°+360 modulo 360)
available headings: below 330° (5-35+360 modulo 360) , above 40° (5+35+360 modulo 360)
note: integer modulo operator %
code: [select]
absolutewind = (currentheading + relatvewind + 360) % 360;
Arduino Forum > Topics > Robotics (Moderator: fabioc84) > Sailing boat - algorithm beating or not
arduino
Comments
Post a Comment