Cruisers Forum
 


Join CruisersForum Today

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 15-06-2017, 16:24   #1
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: charleston
Boat: bristol 27
Posts: 3,513
free autopilot

I am looking for suggestions for my free autopilot see:

http://pypilot.org/img/demo0.avi
http://pypilot.org/img/autopilot2.avi

The autopilot is using average 3 watts of power to steer straighter than monitor wind vane in 15 knots of wind. The autopilot automatically calibrates the compass and runs stable. I am now at 19 days without crash yet. I have two working units.

The source code is available:

github.com/pypilot/pypilot

Also I have developed weather sensors for wind speed and direction, as well as barometric pressure and temp, and waterspeed and water temp.

The cost is as low as possible, fully modular, and can support any kind of drive 20- 120 amps, brushed or brushless motors. The autopilot is also controled via an app or web browser for touch screen. Also has a desktop client and integrates fully with opencpn.
__________________

boat_alexandra is offline   Reply With Quote
Old 17-06-2017, 05:41   #2
Registered User
 
CaptTom's Avatar

Join Date: Apr 2004
Location: Southern Maine
Boat: Prairie 36 Coastal Cruiser
Posts: 1,646
Re: free autopilot

Only one suggestion so far: Don't make me sit through a video to learn more about your project.

Post some specs, descriptions, narrative, diagrams, a few photos, SOMEthing.
__________________

CaptTom is offline   Reply With Quote
Old 17-06-2017, 08:35   #3
Registered User
 
Bill O's Avatar

Join Date: Jul 2015
Boat: Bruce Bingham Christina 49
Posts: 802
Re: free autopilot

Sean,
Welcome back to the States.

Thank you for updating your github source code for the AP. The webapp is interesting and will need to look at that closer.

Since you started this AP project a few years back, you were using Arduino.
Can the coding be updated to use the newer RPi Zero W (replacing the Arduino) to utilize wireless LAN? This would allow the digital compass/gyro to be mounted amidship which typically could be difficult due to the hardwiring interface needed w/the Arduino.

Bill O.
__________________
Bill O.
KB3YMH
http://phoenixketch.blogspot.com/
Bill O is offline   Reply With Quote
Old 17-06-2017, 08:58   #4
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: charleston
Boat: bristol 27
Posts: 3,513
Re: free autopilot

The current board supports 12 volts, and 20 amps peak, 10 amps continuous. It is averaging 0.25 amps driving my boat in 15 knots of wind but using up to 1 amp when the motor is actually moving. This is steering straighter than my wind vane.

I think anything above 20 tons would need a bigger controller to work, but this is a small component easy to replace.

Since it uses generic drone motor ESC, it's possible to get any current/voltage rating needed.

Quote:
Originally Posted by Bill O View Post
Sean,
Welcome back to the States.

Thank you for updating your github source code for the AP. The webapp is interesting and will need to look at that closer.

Since you started this AP project a few years back, you were using Arduino.
Can the coding be updated to use the newer RPi Zero W (replacing the Arduino) to utilize wireless LAN? This would allow the digital compass/gyro to be mounted amidship which typically could be difficult due to the hardwiring interface needed w/the Arduino.

Bill O.
This is a complete rewrite starting 9 months ago. It runs on the raspberry pi because the arduino is too limited. It creates an access point on wifi automatically when it boots.

I have tested on raspberry zero, A+, B+ and B2. I don't have a zero W.

I will try on the orange pi soon, the nanopi has some bugs unfortunately.


The compass/gyro can be anywhere, and wired into the raspberry. Since it is i2c, it can be at most 1-2 meters from the raspberry (without repeaters) but I think in most cases it can be directly on the raspberry.

From the raspberry there is an isolated serial link to an arduino which actually controls the motor and provides feedback. This unit needs to be located several inches away so the currents in the wires don't affect the compass, but if you use rs232 translators, it could be a long link.

From there, very long wires to the brushed drive motor can be used.

There is an optional link to a second arduino which measures wind speed and direction, waterspeed and baro pressure.
boat_alexandra is offline   Reply With Quote
Old 17-06-2017, 09:16   #5
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 18,290
Re: free autopilot

1. AWESOME job.

2. THANK YOU for sharing.

3. Can you add some voiceover to the videos? Seeing is believing and hearing your explanation of what we can see is great for part of the forum.

4. PLS stay with Arduino, as far it is a viable platform, even if at any point a Pi branch gets created. I personally do not want stuff that needs more stuff to run some stuff. If Arduino is not powerful enough, we can proto an individual dedicated Pyboard.

5. Pack it up. People like things that come in neat boxes.

6. Imho looking for a viable, reliable but less expensive actuator is a parallel and worthy effort. Maybe we should think over our whole actuator idea unless we can afford extremely pricey Raymarine or otherwise components (that tend to fail at disgusting rates too).

7. AWESOME.

Thank you for sharing. I think you have done great job and it is most generous of you to share the code and the details.

barnakiel
barnakiel is offline   Reply With Quote
Old 17-06-2017, 09:22   #6
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 18,290
Re: free autopilot

Quote:
Originally Posted by Bill O View Post

(...)

This would allow the digital compass/gyro to be mounted amidship which typically could be difficult due to the hardwiring interface needed w/the Arduino.

Bill O.
Bill,

Why not have the component you want talk to the Arduino over BT or WiFi?

I am too building small Arduino/BT/WiFi components. I believe what you want is easily done with the compass being mounted onto a Nano + a BT board talking wirelessly to the main board placed anywhere.

Cost of such a compass is about USD 20.

barnakiel
barnakiel is offline   Reply With Quote
Old 17-06-2017, 09:37   #7
Registered User
 
travellerw's Avatar

Join Date: Jan 2014
Location: Grenada
Boat: Fortuna Island Spirit 40
Posts: 2,291
Re: free autopilot

Excellent job.. I have been waiting for someone to do this.

Thank you!
travellerw is offline   Reply With Quote
Old 17-06-2017, 10:26   #8
Registered User
 
Bill O's Avatar

Join Date: Jul 2015
Boat: Bruce Bingham Christina 49
Posts: 802
Re: free autopilot

Quote:
Originally Posted by barnakiel View Post
Bill,

Why not have the component you want talk to the Arduino over BT or WiFi?

I am too building small Arduino/BT/WiFi components. I believe what you want is easily done with the compass being mounted onto a Nano + a BT board talking wirelessly to the main board placed anywhere.

Cost of such a compass is about USD 20.

barnakiel
Yes that was exactly my point to Sean was to get away older Arduino format and go with a wireless like the cheap Pi Zero W w/built in wifi which he mostly has done. Seen a lot of older Arduino based systems that didn't optimally position the digital compass in the boat causing some problems. (and yes we already have a 9 axis digital compass)

Sean did have a good point about using the more powerful orange Pi, but my Pi3B works well for a central hub. The wifi based Pi boards are so inexpensive now they can be placed around the boat to link up the digital compass, the reversing motor controller for the hydraulic pump (our pump is fairly far away from the nav station) and rudder feedback.

Bill O.
__________________
Bill O.
KB3YMH
http://phoenixketch.blogspot.com/
Bill O is offline   Reply With Quote
Old 17-06-2017, 13:26   #9
Registered User
 
NahanniV's Avatar

Join Date: Mar 2011
Location: Aboard on US East Coast
Boat: Wharram Tiki 46
Posts: 1,293
Re: free autopilot

Quote:
Originally Posted by boat_alexandra View Post
... It runs on the raspberry pi because the arduino is too limited.
...
From the raspberry there is an isolated serial link to an arduino which actually controls the motor and provides feedback. This unit needs to be located several inches away so the currents in the wires don't affect the compass, but if you use rs232 translators, it could be a long link.

From there, very long wires to the brushed drive motor can be used.

There is an optional link to a second arduino which measures wind speed and direction, waterspeed and baro pressure.
Exciting to see this project !

1/ I don't know much about Arduino, but can't the functions you have implemented on the Arduino board be moved to the RPi ?

2/ Can't all the sensor inputs be Signal-K ? Or, whatever, separate from the autopilot, just inputs.
__________________
Cheers,
JM
nahannivatsea.blogspot.ca
NahanniV is offline   Reply With Quote
Old 17-06-2017, 17:22   #10
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 18,290
Re: free autopilot

Quote:
Originally Posted by Bill O View Post
Yes that was exactly my point to Sean was to get away older Arduino format and go with a wireless like the cheap Pi Zero W w/built in wifi which he mostly has done. Seen a lot of older Arduino based systems that didn't optimally position the digital compass in the boat causing some problems. (and yes we already have a 9 axis digital compass)

Sean did have a good point about using the more powerful orange Pi, but my Pi3B works well for a central hub. The wifi based Pi boards are so inexpensive now they can be placed around the boat to link up the digital compass, the reversing motor controller for the hydraulic pump (our pump is fairly far away from the nav station) and rudder feedback.

Bill O.
Yes.

Having read the github info and Sean's responses above I can see he elected Pi at a point and I am sure he was right. I only build small devices and I am a beginner so my preference for Arduino is just that. I am aware at a point Pi is the reasonable choice.

As Sean says the brain can be placed close to the center of the boat anyways so the compass issue is solved except that from the center of the boat to the tiller it can be quite a run and so the electrical part must be addressed accordingly. Good news power wires are not as vulnerable as data wires.

I am still of the opinion we should think deep about how the drive (the rod, the actuator) can be had without buying expensive and failure prone Ray stuff.

I am truly thrilled Sean built the stuff and shares the code. I am weak at Pi (Linux) application but sure thing will see if at any spot I could contribute. I do believe we need Open Hardware as much as we need Open Source software.

Big hug to all,
b.
barnakiel is offline   Reply With Quote
Old 17-06-2017, 18:40   #11
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: charleston
Boat: bristol 27
Posts: 3,513
Re: free autopilot

Quote:
Originally Posted by travellerw View Post
Excellent job.. I have been waiting for someone to do this.
I was waiting too long for this so I had to do something. I had found some hacks based on arduino, but all of them ran out of memory even on the biggest arduinos, and were still very limited.

Quote:
Originally Posted by Bill O View Post
Yes that was exactly my point to Sean was to get away older Arduino format and go with a wireless like the cheap Pi Zero W w/built in wifi which he mostly has done. Seen a lot of older Arduino based systems that didn't optimally position the digital compass in the boat causing some problems. (and yes we already have a 9 axis digital compass)

Sean did have a good point about using the more powerful orange Pi, but my Pi3B works well for a central hub. The wifi based Pi boards are so
The raspberry zero is powerful enough, I am 70% idle with lots of clients connected and various servers running and only 700mhz (can clock at 1ghz)

The orange pi is cheaper and more available (can order lots of them) and has more variations. The nanopi seemed very interesting because of the solid state drive, it boots very fast, but the wifi, spi, and gpio drivers are buggy.

The raspberry can sometimes corrupt the sd card and randomly corrupt files if it loses power at random. This always happens, at least on my boat, and is unfortunately impossible to avoid, because of the internal wear leveling, you cannot have read-only partitions that are actually safe.

The options are:
1) have a secondary sd card on hand or re-image the sd card if it happens.
2) have a secondary sd card slot on the pi, and use it for writing, locking the primary. I could add an sd slot on my expansion board...
3) build an ultracapacitor ups (costs about $10) to run the pi long enough to sync disks and lock them read only
4) use tinypilot OS (my own linux distribution based on tinycore linux) which puts everything in a ramdisk at boot, and can then run without the sdcard. This is what I have been using, and it can also even run opencpn. It seems very stable so far as well, and keeps going if the sdcard is ejected It also boots fast.

Of course, for people who want to run ubuntu, and pull the power (especially bad if writing a lot of data while unplugged) may corrupt their data.

Quote:
inexpensive now they can be placed around the boat to link up the digital compass, the reversing motor controller for the hydraulic pump (our pump is fairly far away from the nav station) and rudder feedback.

Bill O.
You might also consider a dedicated pi for the autopilot which communicates to the central pi over wifi, or even ethernet, but the autopilot and all it's servers is not going to slow the pi3 at all, I'm still optimizing.


Basically, for 1-2 amps, the compass needs to be 4-5 inches away, for 10 amps it needs to be 8 or 9 inches away.

Quote:
Originally Posted by NahanniV View Post
Exciting to see this project !

1/ I don't know much about Arduino, but can't the functions you have implemented on the Arduino board be moved to the RPi ?
Not entirely. I have two arduinos, one connects to a motor controller. I simply measures voltage and current and reports it, but also cuts the motor very quickly in over current (before the pi needs to react)

The pi cannot do this as it has no ADC, and also this arduino is optically isolated from the pi which is a nice feature.

The second arduino measures the wind sensor. You can plug this directly into it:
6410 Davis Anemometer f/Vantage Pro2™ & Vantage Pro┬«

Also it has a pressure/temperature sensor and my work in progress waterspeed sensor
Quote:
2/ Can't all the sensor inputs be Signal-K ? Or, whatever, separate from the autopilot, just inputs.
Right now all my sensors are nmea0183. They could all be signalk, but there is no advantage I can see in doing this. It would just use more cpu to do it, and not be compatible with other stuff like opencpn.

The autopilot has both signalk (my own variant of it anyway) and nmea servers. It translates between them. If you plug a nmea sensor into the pi, you can get the data from either. If you plug a nmea sensor (say gps or wind) into a computer running opencpn, and connect opencpn to the autopilot, it can now use this data (although it has more lag).

Quote:
Originally Posted by barnakiel View Post
Yes.

Having read the github info and Sean's responses above I can see he elected Pi at a point and I am sure he was right. I only build small devices and I am a beginner so my preference for Arduino is just that. I am aware at a point Pi is the reasonable choice.
Yes, well, there are boards between arduino and pi that can work as well, and it could be ported to this in the future, but it's not my priority.

My priority is more toward machine learning, and maybe even using camera inputs (that can see waves, or look at the sails)
Quote:
As Sean says the brain can be placed close to the center of the boat anyways so the compass issue is solved except that from the center of the boat to the tiller it can be quite a run and so the electrical part must be addressed accordingly. Good news power wires are not as vulnerable as data wires.
It works fine for brushed motors to have a long run, but for brushless, it also works fine with 3 long wires sensorless, but if I want to use sensors for better performance and to give position feedback (brushless controller can report this) the arduino needs to be near the motor. In this case, the isolated serial link can be used, and cheap rs232/ttl translators to have a rs232 link to the controller. You could also use usb, with usb repeaters but I consider this unreliable.

Quote:
I am still of the opinion we should think deep about how the drive (the rod, the actuator) can be had without buying expensive and failure prone Ray stuff.

I am truly thrilled Sean built the stuff and shares the code. I am weak at Pi (Linux) application but sure thing will see if at any spot I could contribute. I do believe we need Open Hardware as much as we need Open Source software.

Big hug to all,
b.
I really want to experiment with this also but I spent all my opencpn donations just getting to this point, so I cannot order any more stuff right now. I need about $200 to seriously experiment making linear rams.


Basically the way to make a much better actuator than what anyone else has (more efficient and very quiet)

1) get ball screw from amazon for $50 this is very efficient (twice as efficient as the cheap lead screws in the simrad tiller pilots)
2) get brushless drone outrunner motor of appropriate torque
3) get hall sensors (and temp sensor for motor) and mount them on the outside of the brushless motor
4) reprogram sensorless brushless controller to use sensors and report position, speed, and motor temp

The motor can directly drive the ball screw, so no gears or belts are needed. This would make a _very_ fast ram, but still with plenty of torque. I think the whole thing could probably go in pipes with rubber to seal it.


As for driving a wheel, a sensored brushless drone motor with enough torque with a belt drive and big ratio would probably work really well.
boat_alexandra is offline   Reply With Quote
Old 20-06-2017, 08:21   #12
Registered User
 
NahanniV's Avatar

Join Date: Mar 2011
Location: Aboard on US East Coast
Boat: Wharram Tiki 46
Posts: 1,293
Re: free autopilot

I would like to try this, but it seems quite complicated.

Suggestions:

Make it simpler:

- package the Rpi firmware into an SD card image.
- how is the arduino code loaded ? Can it be included in the Pi firmware, and loaded by the pi ?
- System block diagram.
- bill of material, what do I need to buy, ordering links
- instructions: How do I put it all together/use it.
__________________
Cheers,
JM
nahannivatsea.blogspot.ca
NahanniV is offline   Reply With Quote
Old 20-06-2017, 09:15   #13
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 18,290
Re: free autopilot

Yes. I will agree. I do not need one but it will sure help many others.

- a block drawing showing all components,
- a material list,

And add commentary to the videos.

I am thinking over the actuator thing. Must do more reading though esp. into brushless motors, feedback methods, etc. Right now I am a bit everywhere but will have more tinkering time this winter once we are on the other side.

@ Sean - any chance you are in the Windwards this coming winter?

b.
barnakiel is offline   Reply With Quote
Old 03-07-2017, 22:50   #14
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: charleston
Boat: bristol 27
Posts: 3,513
Re: free autopilot

Quote:
Originally Posted by NahanniV View Post
I would like to try this, but it seems quite complicated.

Suggestions:

Make it simpler:

- package the Rpi firmware into an SD card image.
- how is the arduino code loaded ? Can it be included in the Pi firmware, and loaded by the pi ?
- System block diagram.
- bill of material, what do I need to buy, ordering links
- instructions: How do I put it all together/use it.
There are various options for sd card image:
1) I have a special linux distribution for raspberry called tinypilot.
2) The autopilot is being integrated into openplotter.
3) The autopilot can use the much cheaper orange pi zero instead of the raspberry pi. I can provide debian images for this.

There are various custom pcbs to make this work, in total 4 not including the weather sensors. Also it is not just programming an arduino, but also reprogramming the brushless drone ESC to make it work for brushed motors. The raspberry cannot easily auto-program the arduino, because it's on an isolated serial link and this sacrifices the reset pin.

I will do more testing in a few days when I sail north. Hopefully I can test running in winds above 20 knots.
boat_alexandra is offline   Reply With Quote
Old 05-07-2017, 08:36   #15
Registered User
 
NahanniV's Avatar

Join Date: Mar 2011
Location: Aboard on US East Coast
Boat: Wharram Tiki 46
Posts: 1,293
Re: free autopilot

4 custom PCBs
1 Raspberry Pi
At least 1 Arduion

As mentioned before, I'd like to see a block diagram.

Can none of this be consolidated into something simpler, preferably using off the shelf components?
__________________

__________________
Cheers,
JM
nahannivatsea.blogspot.ca
NahanniV is offline   Reply With Quote
Reply

Tags
autopilot

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What free software with free offline charts can I use on my PC AFKASAP Navigation 3 23-11-2015 15:35
Crew Available: FREE manpower for you! I just need experience on sailboats, will work for FREE rvisbal Crew Archives 7 22-10-2013 09:03
Car Free/Care Free Living bahamarich Liveaboard's Forum 20 13-08-2013 11:59
Free and Nearly-Free Provisions Kindle Provisioning: Food & Drink 32 02-10-2011 20:47

Advertise Here


Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 18:19.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
×

ShowCase vBulletin Plugins by Drive Thru Online, Inc.