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.

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interfacing Pololu dual g2 high power motor driver for rpi to Pypilot
Firstly I would like to thank everyone involved in this project, and particularly Sean.
I am on a very steep learning curve, so please forgive any obvious or silly questions. So far I have installed tiny pilot (using the image) on an early RPi model B+, connected and successfully calibrated a MPU, connected to openCPN running on my laptop using the plugin and a wifi dongle - so far so good.
I have chosen the Pololu g2 high power driver for the following reasons:
1. My boat is a heavy displacement motor sailor (Fisher 46, displacement 27 tons 1977 vintage) with the original rod steering. The autopilot drive  is a Whitlock/Lewmar rotary drive which comprises a 1/4hp 12v motor driving a sprocket through an epicyclic gearbox, and fitted with a electromagnetic clutch, so the current requirement is quite high.
2. It has two channels so my intention was to use one for the motor and one for the clutch.
3. It's form factor is a RPi hat so reducing the amount of physical connection.
However I am now struggling with how to interface the Pololu to the pypilot. There is a library for the pololu board, and I have successfully driven a dc motor by writing a simple python program using that library - so the physical connection between the RPi and Pololu is working fine.
I would really appreciate any suggestions and pointers.....
i think you need an arduino to control the motor driver.?
mare liberum
I suggest reading pypilot/ and add a polulu driver.   There is already an outline for hwrpi driver to drive esc directly from rpi pins for a standard RC esc, but I have not looked at the polulu library at all.   It might be preferableto use an arduino to drive the polulu controller rather than directly from the pi, and this will allow you the least code changes and keep many of the features already in my controller. Let me know if you have any questions about this, the code already nearly supports it, have a look at arduino/motor/motor.ino

I make my own motor controllers based on arduino.  I have a regular and hydraulic version.  The hydraulic version can handle more power (more details below)

1) optical isolation to make damage rpi impossible, and prevent ground loop
2) controller not a hat to keep high current away from pi and magnetic sensors, and keep heat away from pi
3) transient voltage suppression
4) soft start and stop of motor avoid current spikes
5) thermal protection for controller and optional for motor too
6) rudder feedback and/or travel stops, and no damage if wires shorted
7) voltage and current measurement to assess efficiency and track power consumption
8)  overcurrent stall protection reaction much faster than pi can manage (like a reflex human touching hot stove doesn't reach the brain)
9) also prevent driving past end stops or rudder limits fast reaction doesn't reach pi
10) store settings in arduino eeprom for switching controllers easily keeping controller specific settings
11) lower resistances so higher efficiency than the polulu controller in hydraulic controller anyway
12) much larger filtering capacitors and higher voltage capacitors for lower ESR and longer life
13) fuse protection for both controller and clutch
14) special hack to get highest power at 100% speed

I think a few other improvements as well, but I encourage all types of controllers and I do think other designs will work.   I just wanted to list my improvements and it is probably possible to incorporate some of these features. If you use an arduino to drive the polulu and run my sketch you will get most of them.

For example, I intend to use machine learning in the near future, and for this voltage and current monitoring is even more critical because it will be used for training to reduce power consumption rather than only using stop switches.  If the controller doesn't support it, then this functionality will not be available.

From polulu site:

" Please note that the boards will be extremely hot at those maximum currents, and the available current will be lower if the ambient temperature is higher."

My controller is not too hot to touch (25C above ambient) at 20 amps after 20 minutes and supports 24 volts (60 volt mosfet and capacitors) It has a total resistance of 30 milliohms. So if battery is 13.0 volts, typical hydraulic motor will get 12.6 drawing 12 amps) Would be interesting to post the voltage drop to the motor at various loads. My controller doesn't heat more than 3C operating a 12 amp hydraulic pump even in 25 knots wind.. 12 amps makes less than half the heat of 20 amps, and the duty cycle is low with balanced sails and typical autopilot operation. So it's unfortunately over designed but this makes it slightly more efficient.

I believe my regular controller is comparable to this polulu controller, but I greatly down rate it because it's inside a plastic box. Would be very interested to hear results.
Thank you for taking the time to provide such a detailed reply - that certainly gives me lots to go at.
I will keep you updated on my progress, and I have no doubt that I will have further specific questions once I get stuck in.

Forum Jump:

Users browsing this thread: 1 Guest(s)