2021-01-19, 07:00 AM
(This post was last modified: 2021-01-19, 07:02 AM by CapnKernel.)
Hi djdsails,
Can you tell us more about your requirements, what you have, and what you'd like to do?
While I'm here, I'm going to add to what seandepagnier said. Here's a schematic for an older version, from the PyPilot website:
https://pypilot.org/schematics/hbridge_controller.pdf
This version uses an H-bridge made of discrete MOSFETs, but other solutions are possible.
If your motor controller needs an analog voltage, it would be possible (although not easy) to get the Arduino nano to generate the analog voltage you want, by modifying the code which runs on the nano (motor.ino) to emit a square wave of varying on/off time (PWM), and convert this to a varying voltage with a low pass filter:
https://github.com/pypilot/pypilot/blob/.../motor.ino
https://www.allaboutcircuits.com/technic...g-voltage/
But perhaps by "motor controller" you mean a motor driver, the thing that switches the high current, as the H-bridge does. An alternative is to use a chip such as the VNH5019 or BTS7960 which does all the switching. They are cheap and it's quite easy to hook up the nano to one of these chips. Example:
https://forum.openmarine.net/attachment.php?aid=1078
This shows connection to a VNH5019. Note, as seandepagnier has said, there is no fault detection, no feedback, and no protection for the Pi. It's just a proof of concept (which works).
(2021-01-18, 03:35 AM)seandepagnier Wrote: the pypilot motor controller uses a microprocessor. This is essentially an arduino nano and was done for several reasons. I recommend studying the schematic for the pypilot motor controller and use a $3 arduino nano clone to drive your controller.
So you cannot easily wire this generic controller to the pi zero pins, however it is possible if you hack pypilot. I don't recommend doing this because the performance is bad, there is no feedback and no protection for the pi.
Can you tell us more about your requirements, what you have, and what you'd like to do?
While I'm here, I'm going to add to what seandepagnier said. Here's a schematic for an older version, from the PyPilot website:
https://pypilot.org/schematics/hbridge_controller.pdf
This version uses an H-bridge made of discrete MOSFETs, but other solutions are possible.
If your motor controller needs an analog voltage, it would be possible (although not easy) to get the Arduino nano to generate the analog voltage you want, by modifying the code which runs on the nano (motor.ino) to emit a square wave of varying on/off time (PWM), and convert this to a varying voltage with a low pass filter:
https://github.com/pypilot/pypilot/blob/.../motor.ino
https://www.allaboutcircuits.com/technic...g-voltage/
But perhaps by "motor controller" you mean a motor driver, the thing that switches the high current, as the H-bridge does. An alternative is to use a chip such as the VNH5019 or BTS7960 which does all the switching. They are cheap and it's quite easy to hook up the nano to one of these chips. Example:
https://forum.openmarine.net/attachment.php?aid=1078
This shows connection to a VNH5019. Note, as seandepagnier has said, there is no fault detection, no feedback, and no protection for the Pi. It's just a proof of concept (which works).