Cruisers Forum
 


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 31-03-2022, 06:17   #1
Registered User

Join Date: Sep 2011
Posts: 18
Pypilot Motor Controller Types

Greetings!


I am gathering the bits and pieces to enable me to build a PyPilot/Tinycore Linux/Raspberry Pi Zero W/Arduino Nano - based autopilot. This project has transformed me from a lurker into a poster.



My plan is to interface my Arduino Nano + IBT-2 to my existing Robertson AP200 Autopilot by patching into the J101 (maybe it's J100, but that's immaterial to this question) junction box. (I would disconnect the AP200 from the J101 to preserve the AP200 as a backup). I figure, worst case, I can completely bypass the J101 and connect the IBT-2 directly to the existing hydraulic ram (which is perfectly adequate), and the wiring of which should be pretty straightforward.



My status is that I've installed TinyCore / PyPilot onto the RPi and that's up and running. I'm still waiting for the gyro/compass 9-axis sensor unit (arrives in a week or so). But I have the Nano and I'm at the point where I have to burn the sketch onto it, and have some EE ignorance here, and so herein lie the questions:

  • How can I determine if my patch to the hydraulic RAM (for which I know the terminals on the J101) requires RC PWM or HBridge? I assume RC PWM translates to measured on/off pulses, right? How might I confirm this?
  • Is wiring up the Pin0 - Pin4 optional, recommended, or mandatory?
  • Anyone have guidance how I should configure D4 and D5 in my application?
Having a TinyPilot "buddy" to bounce things off would be a wonderful thing!


Adrian
1982 M43 "Canto"
Chesapeake Bay
vadrian is offline   Reply With Quote
Old 31-03-2022, 06:45   #2
Registered User
 
Bill O's Avatar

Join Date: Jul 2015
Boat: Bruce Bingham Christina 49
Posts: 3,328
Re: Pypilot Motor Controller Types

Adrian,
Did you try to contact Sean w/the technical questions or post anything on the pypilot forum?

Not familiar w/the guts of the J101 to know if it is a Hbridge or not. This is where you need more info to help you set up the controller.

We have an electronic controller that Sean developed and it works well. Do not know if your AP motor needs this much power (30 amps). If not, possibly the other motor controller would work.
__________________
Bill O.
KB3YMH
https://phoenixketch.blogspot.com/
Bill O is offline   Reply With Quote
Old 31-03-2022, 13:10   #3
Registered User
 
JeffBurright's Avatar

Join Date: Aug 2013
Location: Oregon
Boat: Northwest 21 & Islander 36 (too many boats problem)
Posts: 78
Re: Pypilot Motor Controller Types

Hi,
Slightly different here, but maybe I can help some. I have built an Arduino Uno pilot using an IBT-2 connected to a wiper motor. I am not using a Pi as the brain, as the Arduino can handle the basic PID control function, an LCD and an IR remote for simple compass-based steering adjustment (I don't plug into GPS or wind for my unit).

I don't know specifically whether your hydraulic ram is binary on/off or PWM modulated, but my guess would be the latter. The simple test would be whether the ram can operate at variable speed (which is what the PWM 1-255 setting does). If you just want full speed steering at all times, you can just set your Arduino IBT-2 PWM setting to 255.

Below is an excerpt from my sketch, which uses the BTS7960 library. In my actual sketch, I have a separate "motorspeed" function that takes the place of the "255", which allows me to have variable speed steering depending on how far off course the boat is.


#include<BTS7960.h>
<Setup>

constuint8_t EN = 8; // not actually used since I power the EN pins directly
constuint8_t L_PWM = 5;
constuint8_t R_PWM = 6;
BTS7960motorController(EN, L_PWM, R_PWM);

<Loop>
in my PID loop (example for left rudder)
voidLeft_Rudder()
{
motorController.TurnLeft(255);
}

You know about patching the EN pins on the IBT-2 to the 5V incoming line on the controller, yeah? The EN pin needs to be powered in order for the IBT-2 to work in each direction, and the kludge fix is just to leave them powered all the time. This cuts down on the number of wires you need.

Not sure what you mean about wiring up Pin0-Pin4. Is that at Tinypilot guidance thing? In Arduino, you can assign pins to various functions, so long as it's the right kind of pin (e.g., digital, analog, PWM, I2C).

I'm not much help on D4 and D5 either I'm afraid. What function are you trying to assign to those pins? Are those your PWM outputs? If so, the existing example sketches for IBT-2 and the BTS7960 libraries can give you some context clues for how to define those pins as PWM outputs.


Good luck on it!
__________________
Knowing we were fools had not made us sages.
https://www.taketothesea.us
JeffBurright is offline   Reply With Quote
Old 31-03-2022, 17:49   #4
Registered User

Join Date: Sep 2011
Posts: 18
Re: Pypilot Motor Controller Types

Quote:
Originally Posted by Bill O View Post
Adrian,
Did you try to contact Sean w/the technical questions or post anything on the pypilot forum?

Not familiar w/the guts of the J101 to know if it is a Hbridge or not. This is where you need more info to help you set up the controller.

We have an electronic controller that Sean developed and it works well. Do not know if your AP motor needs this much power (30 amps). If not, possibly the other motor controller would work.

I didn't realize this was not the pypilot forum. Which one is `pypilot`?



For the motor, I guess I can always just disconnect it from the J101. I am only guessing, but was hoping I could use the J101 as the controller (as it works today) and drive it with lower currents. I'm going to have to set aside some time to just lay out under my cockpit and play with it. I think our motor spikes at 20A, but I'm not 100% certain.
vadrian is offline   Reply With Quote
Old 31-03-2022, 18:11   #5
Registered User

Join Date: Sep 2011
Posts: 18
Re: Pypilot Motor Controller Types

Quote:
Originally Posted by JeffBurright View Post
Hi,
Slightly different here, but maybe I can help some. I have built an Arduino Uno pilot using an IBT-2 connected to a wiper motor. I am not using a Pi as the brain, as the Arduino can handle the basic PID control function,....


I don't know specifically whether your hydraulic ram is binary on/off or PWM modulated, but my guess would be the latter. The simple test would be whether the ram can operate at variable speed ....
Hi Jeff, thanks for the info. I will study it in more detail as time progresses -- right now, I don't even have all the parts. I did know about needing to interface the Nano with the IBT-2. I guess the answers to the questions about the pins will be salient when I connect them. Good tip about trying the ram at variable speed -- I think I can test that.
My hope is that the J101 will do some of the heavy lifting for me, but as it's proprietary, I first have to reverse-engineer it. It could be the comm between it and the brain is digital, and I don't have a good way to decode that.

Indeed, the series of pin-specific questions is instigated by comments in the motor.ino file which resides in the PyPilot/Tinycorelinux image. Already, you've made me wiser by confirming my suspicion that the pins completely assignable. I mean, I'm not planning on making any reassignments, but at least I now know there's no hard-wired magic there.

I'm very excited at the prospect of having a smarter autopilot (the AP200 is not very smart), controllable from a remote station!! But the learning curve for me is steep so I must be patient with my slow progress. Thank you for speaking up - could I lean on you for additional help if I need it?



Once I have all the parts, perhaps I'll be able to hook the IBT-2 up to some power and a multimeter, hook the Pi up to a display running debug trace, turn the sensor unit this way and that, and get a better view of how it's all supposed to work.

Also, I'm very impressed that you built your AP using only the Arduino. Is it just using an external fluxgate compass signal?



Adrian.
vadrian is offline   Reply With Quote
Old 31-03-2022, 19:52   #6
Moderator
 
Jammer's Avatar

Join Date: Jan 2010
Location: Minnesota
Boat: Tartan 3800
Posts: 4,861
Re: Pypilot Motor Controller Types

Quote:
Originally Posted by vadrian View Post
I didn't realize this was not the pypilot forum. Which one is `pypilot`?

https://forum.openmarine.net/forumdisplay.php?fid=17
__________________
The best part of an adventure is the people you meet.
Jammer is offline   Reply With Quote
Old 31-03-2022, 19:54   #7
Moderator
 
Jammer's Avatar

Join Date: Jan 2010
Location: Minnesota
Boat: Tartan 3800
Posts: 4,861
Re: Pypilot Motor Controller Types

Quote:
Originally Posted by vadrian View Post
  • How can I determine if my patch to the hydraulic RAM (for which I know the terminals on the J101) requires RC PWM or HBridge? I assume RC PWM translates to measured on/off pulses, right? How might I confirm this?

If you are connecting to the motor terminals in place of the existing controller, it's Hbridge. If you are reusing the Robertson motor controller, you would need something else, PWM might be it.


Quote:

  • Is wiring up the Pin0 - Pin4 optional, recommended, or mandatory?
  • Anyone have guidance how I should configure D4 and D5 in my application?

I'm lost. Pins 0-4 of what? The Pypilot motor controller doesn't have those pins that I can see. Not sure what you mean by D4 and D5.
__________________
The best part of an adventure is the people you meet.
Jammer is offline   Reply With Quote
Old 01-04-2022, 05:14   #8
Registered User

Join Date: Sep 2011
Posts: 18
Re: Pypilot Motor Controller Types

Quote:
Originally Posted by Jammer View Post
If you are connecting to the motor terminals in place of the existing controller, it's Hbridge. If you are reusing the Robertson motor controller, you would need something else, PWM might be it.


I'm lost. Pins 0-4 of what? The Pypilot motor controller doesn't have those pins that I can see. Not sure what you mean by D4 and D5.
Thanks for the response. The discourse about the pins is located in the motor.ino file that's in the Pypilot image (for burning onto the Arduino; but that doesn't mean to imply I'm not also lost).
vadrian is offline   Reply With Quote
Old 01-04-2022, 07:38   #9
Moderator
 
Jammer's Avatar

Join Date: Jan 2010
Location: Minnesota
Boat: Tartan 3800
Posts: 4,861
Re: Pypilot Motor Controller Types

ok. I believe Sean's sketch is tied pretty closely to his version of the motor controller (which I thought you were using until I reread the OP). But it should be possible to just ground the pins and have it work. Most motors and controllers can overheat though, and can be damaged or at least suffer excessive wear if repeatedly bottomed out, so you might want to think about connecting those pins so that the controller can sense those conditions and compensate for them.
__________________
The best part of an adventure is the people you meet.
Jammer is offline   Reply With Quote
Old 01-04-2022, 07:49   #10
Registered User
 
Bill O's Avatar

Join Date: Jul 2015
Boat: Bruce Bingham Christina 49
Posts: 3,328
Re: Pypilot Motor Controller Types

I think I found the manual for the unit, maybe this will help everyone. https://echomastermarine.co.uk/asset...0%20Manual.pdf
__________________
Bill O.
KB3YMH
https://phoenixketch.blogspot.com/
Bill O is offline   Reply With Quote
Old 01-04-2022, 16:05   #11
Registered User

Join Date: Sep 2011
Posts: 18
Re: Pypilot Motor Controller Types

I managed to burn the arduino after a few trials (needed to clear my browser cache to get the com ports to appear).



Encouraged by that small success, I went to Wikipedia, to study-up on ESC (electronic speed control), HBridge (looks like an H), and PWM. From my days as a kid playing with PWM servos in RC aircraft, I am sure my motor is not that. After studying Wikipedia, I became pretty sure I want the H-Bridge, as mentioned by Jammer.

I am somewhat concerned about the amperages required, but the documentation (p.43 on the docs Bill dredged up) doesn't seem to address the amperages for the "power unit" as powered by the J101A. I have an image of my J101A and the wires there appear to be 10GA, suggesting a working load of about 5A. On our instrument panel, however, I remember seeing current draws of higher than that, in short spikes. Anyway, I expect I can measure that by simply inserting an ammeter and operating the rudder (there are manual buttons for this on the J101A board). If the amperages are not too great, I could patch right into the motor with the IBT-2 configured as an H-Bridge (right?)

Alternatively, I see terminals 5 and 6 on the J101A are for starboard and port rudder commands. This suggests to me I could send a small 12v signal to those terminals to instruct the "reversible switch mode regulator" (again, PDF page 43) to handle the current reversal and power load for me. (Do you know what I would have to change on the Arduino to make that happen?)



Anyway, I think I'm much closer now - I can envision the entire project. Thanks, guys, for the help. I am greatly encouraged.


Adrian.
vadrian is offline   Reply With Quote
Old 01-04-2022, 19:25   #12
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: Pypilot Motor Controller Types

You may have better success on the pypilot forum:
https://forum.openmarine.net/forumdisplay.php?fid=18

I also suggest reading the work book as it may hint a lot of your questions.
https://github.com/pypilot/workbook/wiki

As noted: yes it is possible to use only the arduino, but the result is something much more limited in several different ways.
seandepagnier is offline   Reply With Quote
Old 02-04-2022, 08:18   #13
Registered User
 
JeffBurright's Avatar

Join Date: Aug 2013
Location: Oregon
Boat: Northwest 21 & Islander 36 (too many boats problem)
Posts: 78
Re: Pypilot Motor Controller Types

Hi again,
It's sounding like you have two motor controllers (the J101 and the IBT-2) when all you need is one. Either one would serve to allocate power to the +/- 12v wires feeding into the simple DC motor in the hydraulic ram. The "pulsing" of power supply via PWM will rapidly cycle the power on and off at a variable frequency determined by the Arduino (0-255), which is what gives you variable motor speed. The IBT-2 is an H-bridge controller that allows Pulse Width Modulation of its power output, so I've been a little confused by your terminology.

I'm going to back up a bit, so apologies if I'm covering ground you already know. To use the IBT-2, you need to have 2 output wires from PWM pins on the Arduino to the L_PWM and R_PWM input pins on the controller. The controller also needs 5V to the VIN, L_EN, and R_EN leads, and a ground to the ground lead. The IC pins you can leave alone.


Note that I'm still building my unit, so the above description doesn't account for power oversupply when the ram reaches its ends (and possible controller burnout). There are a few ways you can address this issue, and I'm working to build a rudder position sensor to tell it to stop the motor before it reaches the end of rudder motion. Fair warning.



Once wired, you need to assign the Arduino PWM pins to act as outputs, which the BTS7960 library can do automatically or you can do directly via code (examples are available online).

The pypilot will likely send some signal to the Arduino, which will in turn trigger whether the Arduino needs to send a left rudder, right rudder, or stop command to the IBT-2 via the two PWM wires.

Again not familiar with the J101, but I would assume it works on the same principle. If the 5&6 leads on the J101 are essentially the same as the PWM input pins on the IBT-2, then the two controllers are probably interchangeable. All they do is regulate the direct 12V power that makes it to the DC motor in the ram, based on the voltage input they receive from the head unit. Please note that this signal from the head unit is a 5v PWM signal, not 12v. I would not recommend supplying 12v to the 5&6 pins on the J101 without knowing more.

Did this help at all?


PS - here's my Arduino pilot setup in progress. I can get it to keep a heading based on a reading from the compass (in the wired tic tac box), and I can tell it to change heading based on input from the little IR remote. The wiper motor mount attaches to my steering pedestal and turns the wheel via a belt drive connected to a larger gear attached behind the wheel. The motor mount swings and locks to engage or disengage the belt (at least in theory). The Arduino unit will be installed inside the cockpit coaming through a pre-existing hole, hence the polycarbonate plate.

Yes, my electronics enclosure is a parmesean cheese can. Maybe you shouldn't be taking advice from me.

https://i.imgur.com/1ALShd9.jpg

https://www.reddit.com/r/sailing/com...is_an_arduino/

My inspiration came from this old blog post: The Marine Installer's Rant: The Arduino autopilot that Jack built

I found Jack's code and repurposed it for my simpler use case. Jack has been very kind also in helping me troubleshoot as I learned how to read the code.
__________________
Knowing we were fools had not made us sages.
https://www.taketothesea.us
JeffBurright is offline   Reply With Quote
Old 04-04-2022, 05:51   #14
Registered User

Join Date: Sep 2011
Posts: 18
Re: Pypilot Motor Controller Types

Quote:
Originally Posted by seandepagnier View Post
You may have better success on the pypilot forum:
https://forum.openmarine.net/forumdisplay.php?fid=18

I also suggest reading the work book as it may hint a lot of your questions.
https://github.com/pypilot/workbook/wiki

As noted: yes it is possible to use only the arduino, but the result is something much more limited in several different ways.

Hi Sean, Thanks for the tip. I'm thinking it makes sense to finish this topic here (respond to posts on this thread) and post additional questions I encounter in the pypilot forum.


EDIT: also, I should be clear I'm not using only the arduino. The idea is to use the IBT-2, driven by the arduino. Is that not correct?
vadrian is offline   Reply With Quote
Old 04-04-2022, 06:00   #15
Registered User

Join Date: Sep 2011
Posts: 18
Re: Pypilot Motor Controller Types

Quote:
Originally Posted by JeffBurright View Post
Hi again, ....

Did this help at all?

....

Yes, I think this will help. I don't have all the parts in front of me now; indeed, I'm still waiting for key components to arrive in the mail. I should have everything by April 15. At that point, armed with all this, I think the next step for me is to hook up a multimeter, set aside a few hours, and start experimenting.



Also, I've been given a LOT of information on this thread, and need some time to digest it all. Sorry if my questions are confusing -- it is because I don't yet know what I'm doing. As a middleware software engineer, I know software, but haven't spent time diddling around with HW interfaces since the TRS-80 (and now you know my minimum age).



Adrian.
vadrian is offline   Reply With Quote
Reply

Tags
motor


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
PyPilot rgleason OpenCPN 123 31-10-2023 18:34
Pypilot Motor Controller Types vadrian Marine Electronics 1 28-03-2022 14:01
Pypilot - Motor Driver for Rudder actuator karthikpraveen OpenCPN 0 31-12-2021 22:47
Pypilot Motor speed Control karthikpraveen OpenCPN 2 30-12-2021 04:18
Anchor types & Bottom types pbiJim Anchoring & Mooring 31 03-06-2014 20:38

Advertise Here


All times are GMT -7. The time now is 20:10.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.