2018-09-10, 06:50 PM
Currently the "arduino" motor controller is what is supported by pypilot, but other controller setups like rpi gpio could be supported.
For your case, you need 2 outputs. This could be one to move the motor in each direction, or one output to engage, and another to specify the motor direction. The second way is safer in case you activate both outputs at the same time it will not cause a short.
I recommend using a magnet and magnetic reed switches for the end of travel stops but hall sensors are possible.
You may wish to make the schematic so that the reed switches actually deactivate the output signal. This way it doesn't rely on software to deactivate the rudder movement which has a lag, and might not work if there is a software issue. This is the best fail-safe. You can do this with 2 resistors. Let me know if you need a schematic.
At this point you should be able to control the rudder just using the gpio command. Once you get to this point it is really easy to write a simple driver for the pypilot servo... I can even do this bit once you get there, keep posting your progress and pictures if possible would be nice.
You may also wish to wire these reed sensor inputs to gpio inputs to report the end of travel condition through software so you will see it when controlling the autopilot. This part is optional since I don't recommend using software on the raspberry to react to the end of travel (better to use resistors)
For your case, you need 2 outputs. This could be one to move the motor in each direction, or one output to engage, and another to specify the motor direction. The second way is safer in case you activate both outputs at the same time it will not cause a short.
I recommend using a magnet and magnetic reed switches for the end of travel stops but hall sensors are possible.
You may wish to make the schematic so that the reed switches actually deactivate the output signal. This way it doesn't rely on software to deactivate the rudder movement which has a lag, and might not work if there is a software issue. This is the best fail-safe. You can do this with 2 resistors. Let me know if you need a schematic.
At this point you should be able to control the rudder just using the gpio command. Once you get to this point it is really easy to write a simple driver for the pypilot servo... I can even do this bit once you get there, keep posting your progress and pictures if possible would be nice.
You may also wish to wire these reed sensor inputs to gpio inputs to report the end of travel condition through software so you will see it when controlling the autopilot. This part is optional since I don't recommend using software on the raspberry to react to the end of travel (better to use resistors)