Posts: 16
Threads: 4
Joined: Apr 2016
Reputation:
0
Yes I do it.
Pay attention to use a SoC chip working at 3.3V likewise RPI, otherwise you need to adapt the logic.
Posts: 2,179
Threads: 20
Joined: Jun 2016
Reputation:
64
I want to drive a pwm dc motor controller. This can control the rudder with any kind of motor, for example, a linear actuator or a smaller motor on a trimtab or pendulum gear to make an autopilot. Could also control hydraulic etc...
I build a working autopilot this way 3 years ago using an rpi1 and arduino and it did work, but now I want to update it, and improve the software to work in waves better.
I think the pi can produce PWM directly, but it needs to measure current also to prevent stalling and to stop at the ends. Also should be optically or somehow isolated to avoid damaging the pi from reverse emf.
Of course I also need an imu for this. I looked at freeimu and berryimu. The author of freeimu just died which isn't encouraging, and the software for berryimu is not great. Ideally there would be an actual kernel driver for the imu rather than some userspace program calling ioctls to get the data. This would ensure realtime but also reduce cpu.
I think connecting the imu to the arduino might be useful as there would be no pins needed from the pi header as the arduino could simply plugin over usb to the pi, and even a laptop or other computer could be easily swapped in as the brain.
If there is much interest in this sort of autopilot I could create a simple "glue" pcb to plug an arduino, pi, imu, motor controller, and dc/dc power supply, shunt, isolator etc.. all together without having any little wires... but placement of the magnetometer should be at least several inches from high current wires.
Of course a wind direction sensor would be nice... any suggested ones?
Posts: 2,179
Threads: 20
Joined: Jun 2016
Reputation:
64
I am already asking for what I need...
I need to know which are the best sensors to use for an imu. Initially I can use gps and magnetometer, but eventually a wind direction sensor would be great as well. I intend to drive either rudder directly, or a trimtap or pendulum, so these configurations may have different tuning parameters...
until the autopilot gets really smart, there is a matrix to calculate feedback, and the user can simply tweak all of the values one at a time to improve performance in a particular sea state. The more users on different boats and sea states the better, because once we can quantify the data, then the number of adjustable parameters can be reduced as well as get an idea of good initial settings for a given configuration... Finally, the autopilot might get smart enough to automatically adjust itself which would be a great goal, but not actually required to make it function initially.
Flat water is the easiest as there are only two gains to adjust (heading error and heading rate of change) but with waves you could potentially have 4 or more gains to adjust.
Posts: 579
Threads: 65
Joined: Nov 2016
Reputation:
20
My boat has an old SeaTalk bus (the original 4800 bps bus system). I just finished, today, a WiFi-based autohelm control using a NodeMCU module, which is programmable via the Arduino IDE and has WiFi built in. You can get them for $10. The NodeMCU talks to the SeaTalk bus and controls the AutoHelm. The OpenPlotter RPI produces a simple web page with buttons for Autohelm control, which can be displayed on a smartphone or tablet. It still needs a sea trial, but so far everything is looking pretty good.