Magnus's Posts (7)

Sort by

Autonomous sail boat part three. Simulation

3689555690?profile=original

This is the third update about my attempts to build an autonomous sailboat with the goal to have it sail by itself next spring.

My first plan for simulation and hardware in the loop simulation was to use the Sail simulator game.You can read more about that in my last blog post. This solution works but the setup with two computers and a number of small programs working together was not a solution to use when you do most of your test on the subway to and from work (Yes with small children you need to use all free time). 

The solution was to write a simple sailboat simulator myself. I am using processing for the task. One reason is it's portability between operation systems and another is the similarities to Arduino. 

The simulator also act as a network server sending NMEA data and receiving boat control commands from my autopilot application also written in processing. When my algorithms are robust enough i will implement them in the APM and use the simulator for HIL simulations. the screen shot shows the boat beating to reach the waypoint. distance between waypoints is about 70 meters.

The simulator

The simulator implements a really simple model for simulating a sailboat. The target speed for the boat is generated from a simple polar chart. the boat will accelerate to the giver target speed and if the wind disagrees or the boat points into the wind it will slow down until it stops. The simulator uses google maps for backdrop.

The wind is always blowing at the same speed but varies a little in direction over time. 

It is really simple but it works for my purposes. 

The autopilot

The boat is controlled by an autopilot program that actually manages to sail the boat between waypoints even if it requires beating against the wind. there is much work to be done in optimizing the navigation and sometimes it shows almost scary behaviors  i really can't explain. Not AI, but more likely bugs in the navigation algorithms...

The autopilot receives SOG, COG, position, boat heading, apparent wind speed (AWS) and apparent wind angle (AWA) from the simulator. this is the same sensor data i get from my RC-boat. 

This is still early stages but it is quite amazing to see the boat tack to get to the next mark... 

/Magnus

Read more…

Autonomous sail boat part two

Things are slowly moving forward.

3689551481?profile=original

The status right now is:

  • Boat has done some sea trials. It sails, and it sails better than expected.
  • Windvane is integrated with APM using a separate Arduino nano and I2C to the APM
  • APM installed in boat with GPS, compass and telemetry. Next step is to start logging data for use in for example simuliations the coming winter months
  • Sail Simulator installed on my home PC. 
  • Created a small processing program to read NMEA from the simulator and to emulate keyborad commands to it to control rudder and sheet.

Next step:

  • start writing a simple autopilot for sail simulator so i can develop steering and navigation algorithms this winter
  • Continue sea trials to gather as much data as possible before it gets to cold.

That is where i am!

/Magnus

Continued here

Read more…

Autonomous sail boat and electronic wind vane

I have started to build an APM controlled sail boat. 

3689544336?profile=original

The hull

The hull is based on a IOM boat called Goth (Free plans here). It is built with balsa strips and then glassed on both the inside and outside. Keel blade and rudder are made with balsa cores and a carbon fiber shell. The bulb is 3.5 kg lead. It is designed to weight 4.2 kg when finished. 

The wind vane

The wind vane is built around the magnetic rotation sensor chip as5045. With a magnet placed just above the sensor it can detect the absolute angle of the magnet. The magnet can be seen below the ball bearing in the image below. The sensor chip measures just 5x5 mm and is embedded in epoxy. The wind vane and the sensor is placed in the tube and voila. A wind direction sensor with almost no friction and a total weight of less than 10 g. Total length is 10 cm.

I still need to figure  out where to put the wind sensor. Since i have a rotating mast it is not a good idea to put it there unless i fit another rotation sensor on the mast. 

The wind vane is quite sensitive. It works at walking pace so hopefully it will work on the boat.

3689544248?profile=original

Mast

The mast and boom is made of a fiber glass fishing pole. the sail is made drawing film. It is made as an IOM sail and the sail area is similar to an IOM size two sail (main plus jib).

3689544361?profile=original

I have not decided how to control the sail. I can use a traditional sail servo or rotate the mast with an arrangement under deck. 

Control

The boat will be controlled using the APM hardware and sensor libraries. 

The plan is to take it step by step:

  1. Manual RC-control
  2. Manual RC-steering with automatic sail control
  3. Heading and/or Wind angle hold. 
  4. ...

All comments and ideas are welcome!

/Magnus

Read more…

One of those bad days...

For the last week i have successfully flown my Twinstar with the APM. Everything was tuned and i had developed a good routine for setting things up in the field before flying. Yesterday the plan was to test a long endurance flight (25 min) that also used the relay to reset the XBee to keep the telemetry link for the entire flight. 

 

But this is what happened...

 

The Twinstar comes with a small PCB that houses connectors for the motors and ESCs. The motor connectors are constructed in a way that they can't be connected the wrong way, but you can accidentally connect plus to minus and vice versa anyway which i found out... the connectors touched for just a split second, but that seemed to be enough to brick my APM. Mission Planner will not talk to it any more. The Arduino IDE doesn't like it either... I don't think the Mega 1280 is that sencitive, and i will investigate that further.

 

Fortunately i had a spare APM lying around... Some rewiring and a firmware upgrade and I was good to go. Almost...

 

I needed to recalibrate my radio for the new APM and ran in to all sorts of trouble. When i finally got everything in order i just wanted to do a last test of everything before flying.

 

It turns out that my ESCs needs a lower PWM than what my radio could give them (Without trimmint the throttle down...  ) to keep the motors still. When i connected the ESC the motors spun up, one propeller hit the canopy and sent my xBee for a flight on it's own. Fortunately the xBee survied and i only need to replace one propeller.

 

Lessons to learned:

* Replace stock power connector on the Twinstar!

* Save your APM settings regularly. If you need to replace or reflash it you will need this file. Otherwise you need to start all over with the tuning process.

* Recalibrate radio after firmware uipgrade. Don't rely on the settings in your stored settings file.

 

Well i guess it's part of the hobby. New props are on their way and this gives me a reason to order a APM with the Mega 256 Kb chip.

 

Over and out.

 

Magnus

 

 

 

 

Read more…

3689369539?profile=original



/Magnus

Ardupilot Mega test flight report.
Today i did my first test flights with the APM installed in my Multiplex Twinstar II.

I tested the Stabilization mode and the Auto mode with six waypoints in a 1,4 km
long track.

Equipment
* Multiplex Twinstar with brushless motors.
* 35 MHz RC
* APM with shield
* Airspeed sensor
*U-blox GPS
* Aerocomm 868 MHz radio modem (Not used)

AP config
*Running software built 2010-09-07
* Custom config file exceptincreasing cruise speed and cruise throttle.
* Altitude mixing set to50%
* Air speed sensor enabled

Weather
* Wind about 10knots with gusts up to 16 knots. Moderate turbulence.

Result
Stabilizationworked great with standard settings. Maybe it responded to stick
movement a bit to abruptly, but it was really steady in the quite
turbulent air.

Auto mode worked fine. The plane flew the coursewithout any real problems and then started to loiter above the home
position. One strange thing i noticed was that the plane changed
direction during loiter after a few turns. Could it be that at first it
tried to reach home position but never came close enough and then when
it reached home it started circling in the other direction?

Altitudeholding worked fine and it was fascinating to see the AP cut the
throttle to zero when the plane reached some thermals when fighting
against the wind to reach a waypoint. You could really hear the throttle
going up and down during the flight.

The only thing that didn'twork was downloading the log files after flying. I could only read a
few lines before i got an error. I will file this as an issue at Google
Code.

Over all this was a real success. I now feel that i have aplatform that is easy to setup, maintain and fly.

Next time iwill add telemetry so i can log things as well so i can show off nice
maps.



Read more…



Presenting MissionPlanner Alpha 0.2.

This is a very early alpha of MissionPlanner, a mission planning tool for ArduPilot Mega. This
version is primarily built to test the mapping features, but it can produce an include file to use with ArduPilot Mega Waypointwriter. The software is published as freeware.



All comments are appreciated.

Working but not tested:
* Updated to the latest WaypointWriter file format (22010-08-23)
* Loading maps from Open Street Map.
* Resizing program window.
* Cashing maps on disk so the program can be used off line with downloaded maps.
* Building a Mission of standard waypoints. Click Add WP button to start adding WPs.
* Delete a waypoint by right clicking it in the list (not in the map)
* Creating an include file compatible with APM WaypointWriter.
* Loading and saving missions
* Editing waypoints: Move, insert, delete, edit properties (altidude)

Not working yet
* Creating commands other that waypoints
* Other map features as displaying "no fly areas" and other custom map-objects.
* Serial protocol to upload waypoints over the serial port.
* Mission height profile.

At this stage MissionPlanner can create a include file to be used with APM waypoint writer utility, but please be aware that the file generated can contain bugs.

Installation
This program runs on Windows (should run on xp and later) and consists of a singla.exe file. This file can be placed in any directory.

When the programs starts for the first time it creates a directory (c:/osm_cashe) on the c: drive for cashing map-tiles.

Zip file containing exe and this text can be downloaded here:

http://www.droid.se/downloads/MissionplannerAlpha_0_3.zip

Enter a longitude and a latitude and press Goto LaLo to load the map.
If the map doesn't show. Drag it a little bit after the tiles have been downloaded.

Please test it if you have a couple of minutes to spare.

Instructions

* Click "Add Wpts" button to add waypoints.
* Click and drag an existing waypoint to move it
* Rightclick a waypoint in the map or in the list ro insert, delete or edit waypoints.
* to quit adding waypoints click the "done" button.
* Click "create .h" button to create the include file for Ardupilot Mega Waypoint writer.
* Pan map by click and drag, This can not be done when adding waypoints.

Regards

Magnus
Read more…

Results of first IMU flight tests

Today i made my first tests with a Gyro/accelerometer stabilized airframe. The system is based on an Ardupilot board and the Ardupilot expansion board with an additional gyro. The software is my own, but the Kalman filter is based on code published at the Sparkfun forum.The airframe is this 150 cm span flying wing:

In stabilization mode the ardupilot reads elevator and aileron input from the transmitter and uses this input as target roll and pitch angles. If the stick is centered the plane is supposed to fly straight ahead.The first flight tests were not a complete success. The Kalman filter seems to do a good job on the ground, but when flying i seem to get unreliable readings when turning. If i enable the stabilization et level flight it continues to fly level, but when i enable it during a turn it continues to turn rather than leveling out.My guess is that this is because the accelerators have to much weight in the kalman filter so when i make my perfect coordinated turns :) the filter is unable to keep its angles.I will keep you updated in this blog, but if anyone can give me some advice on how to tune the Kalman filter it would be appreciated./Magnus
Read more…