This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using pi gpio outputs / pins arduino
#7
(2018-09-10, 06:50 PM)seandepagnier Wrote: 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)

Check. But......

Yesterday i received a Arduino UNO from a colleague. So i can built the controller with the Arduino. I managed to get your software on the Arduino and it looks like OpenPlotter is communicating, i can see serial communication going on on the Arduino. I'm now looking into your sw. I noticed that you can drive the H Bridge as well, so my intention now is to use this setup. 

I pulled the sensing pin 6 down (0) to "enable HBridge mode". I expected pins 2,3,9,10 to react when moving the rudder in OpenPlotter PyPilot Autopilot control. Nothing happens. Do i need to pull up or pull down other sensing lines before motorcontrol will be initiated? I tried to find out in the code, but it is a bit difficult to reverse-engineer the sw.

Kind regards, Niels.
Reply


Messages In This Thread
RE: using gpio outputs - by affinite - 2018-09-08, 04:46 PM
RE: using gpio outputs - by seandepagnier - 2018-09-08, 06:01 PM
RE: using gpio outputs - by nvelthuijsen - 2018-09-09, 09:58 AM
RE: using gpio outputs - by affinite - 2018-09-08, 09:14 PM
RE: using gpio outputs - by seandepagnier - 2018-09-10, 06:50 PM
RE: using gpio outputs - by nvelthuijsen - 2018-09-11, 12:24 PM
RE: using gpio outputs - by jim321 - 2018-09-11, 02:08 PM
RE: using gpio outputs - by nvelthuijsen - 2018-09-11, 02:23 PM
RE: using gpio outputs - by nvelthuijsen - 2018-09-11, 05:45 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)