Posts: 2
Threads: 1
Joined: Jun 2024
Reputation:
0
Hi, is there a way to connect the HBridge (IBT-4 for instance) directly to the RPI pins ?
What is the purpose of going through an arduino controller.
Thanks.
P.
Posts: 2,324
Threads: 21
Joined: Jun 2016
Reputation:
72
2024-06-09, 09:47 PM
(This post was last modified: 2024-06-09, 09:58 PM by seandepagnier.)
it is possible but there are many reasons not to do this
1) the RPI has poor pwm support, usually software. It should be possible with 2 channel hardware pwm. There is code in servo.py to support this already but it is not normally used.
2) the RPI would not be protected from the motor controller. I have optical isolation so in the worst case the raspberry usually survives if high voltage reaches the controller somehow. Furthermore, if the IBT-2 has power input and the raspberry has power input, this creates a potential ground loop. It is much more difficult to isolate the pwm inputs compared to data inputs because of the speed.
3) the RPI has no adc, so will not be able to measure current to detect stalling the motor. You would have to use end of travel switches, but it is almost always better and nicer to measure current also for statistics of power use.
4) the IBT-4 has mosfets with both a higher resistance and lower voltage (30v) rating than the ones used in my smallest motor controller (40v), and my larger controllers use even higher voltage ratings (60v) and even less resistance. While generally 30v should be sufficient at 12v systems, it is not uncommon for a BMS to cut off when fully charged leaving the bus at 20 volts or more from solar input, then the voltage spike from switching (they use 22 ohm rather than i use 47 ohm which switches faster) which causes a higher voltage spike could potentially exceed 30 volts... who knows. Maybe it is reliable.
5) the ibt-4 has no protection for reverse polarity or voltage spikes (tvs), and components generally with less overhead like capacitor ratings
6) the avr can react more quickly to stop the motor from faults such as rudder feedback out of bounds or end stop switches than if they were wired into the raspberry pi (think of like a reflex)
7) Doing this is less modular. Having a separate motor controller that can be swapped out, and/or located in a part of the boat near the rudder feedback or other inputs could be more convenient.
Having said all of this, it certainly _is_ possible. Some of these reasons are not important to every user, but because there are a lot of reasons this is why I basically abandoned the concept of running the hbridge directly from raspberry pwm. If you do get it working or have questions about how to, please continue the discussion here.
Another thing about the IBT-4... it claims 50 amps??
Correct me if I am wrong, but the screw terminals they use would melt at even 20 amps forget 50. Especially over thermal cycles those are terrible terminals on a boat (I would know) Even if you soldered to the board directly, it would overhead at 50 amps even with the heat sink by my calculations. The heat sink is mounted on the plastic side of the mosfet...
Posts: 2
Threads: 1
Joined: Jun 2024
Reputation:
0
Thanks a lot.
This is very convincing . I'll change my plan to go through an Arduino controller.
Regards.