Controlling OSMC Boards with an Arduino

I wanted to contribute back to the community so I wrote
this page and supplied the lib for them. (osmclibfiles)
Controlling OSMC Boards with an Arduino

motorsetup12voltmin

If you want to control very big motors with your Arduino
you'll need a big motor control board. (big motor not shown)
Luckily, robotpower.com provides
an Open Source Motor Control board that's up to the task of driving
160 Amps of continuous output at 13 to 50 volts.
(That would fry many regular hobbyist motor control solutions many times over.)

So if you want speed and direction control of very large DC motors
you're best bet is to obtain a few OSMC boards and some car batteries.

OSMC Board
http://www.robotpower.com/products/osmc_info.html

Spec Docs
http://www.robotpower.com/downloads/

Be sure to read the Manual about the OSMC board before you do anything
with high voltage and high current. You may risk '''fire''' or '''explosion''' if you are
not careful with high current, high voltage applications.

The OSMC boards have this nifty logic car in the upper left corner of
the schematic document. I've written a library that implements the input chart.

inputchart

The letter codes correspond to the HIP4081A specs. I had to
hunt down all the connections with a logic probe and the chip
specs. It may be time consuming but I can't give you how I wired the
thing because I used a ribbon cable that changed all the leads around.
So just match the progs to the pin numbers on the HIP Chip to find the proper
connections.

findpins

When wiring up an OSMC Board the 3 letter codes correspond
to the HIP4081A chip specs.
Basically...

Pin 2 on the HIP Chip is BHI
Pin 3 on the HIP Chip is DIS
Pin 5 on the HIP Chip is BLI
Pin 6 on the HIP Chip is ALI
Pin 7 on the HIP Chip is AHI

You'll have to match up the pins yourself.
903-3104 (Allied #) HIP4081AIP MOSFET driver 20 pin DIP U2
Please note that you need a minimum of 12 Volts to activate the OSMC Board.
I used two 6 Volt lantern batteries in series to run my tests.
DO NOT reverse the power leads to the OSMC board ''you have been warned''

  1.  
  2. /*
  3. Copyright (c) 2009 Chris B Stones (welcometochrisworld.com)
  4.  
  5. Permission is hereby granted, free of charge, to any person
  6. obtaining a copy of this software and associated documentation
  7. files (the "Software"), to deal in the Software without
  8. restriction, including without limitation the rights to use,
  9. copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. copies of the Software, and to permit persons to whom the
  11. Software is furnished to do so, subject to the following
  12. conditions:
  13.  
  14. The above copyright notice and this permission notice shall be
  15. included in all copies or substantial portions of the Software.
  16.  
  17. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  18. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  19. OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  20. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  21. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  22. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  23. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  24. OTHER DEALINGS IN THE SOFTWARE.
  25. */
  26.  
  27. #include <osmc.h>
  28.  
  29. /* When wiring up an OSMC Board this values correspond to the HIP4081A chip specs.
  30. Refer to that chips data sheet to figure out which pins to wire to.
  31. Pin 2 on the HIP Chip is BHI
  32. Pin 3 on the HIP Chip is DIS
  33. Pin 5 on the HIP Chip is BLI
  34. Pin 6 on the HIP Chip is ALI
  35. Pin 7 on the HIP Chip is AHI
  36. etc..
  37. */
  38.  
  39. /* With this Very Basic library you need 5 pins per
  40.   OSMC board. They all are I/O pins but 2 of them have to
  41.   be PWM capable
  42. */
  43. int AHI = 8; // normal I/O pin
  44. int BHI = 7; // normal I/O pin
  45. int ALI = 6; // must be on a PWM I/O pin
  46. int BLI = 5; // must be on a PWM I/O pin
  47. int disable_pin = 4; // normal I/O pin
  48.  
  49.  
  50. OSMC osmc;
  51. void setup() {
  52. osmc.init(AHI,BHI, ALI, BLI, disable_pin);
  53. }
  54.  
  55. // simply show forward and reverse at some speed.
  56. int motor_speed = 200; // a value between 0 and 255
  57. void loop() {
  58. osmc.forward(motor_speed);
  59. delay(500);
  60. osmc.reverse(motor_speed);
  61. delay(500);
  62. }
  63.  
  64. // NOTE: I have also designed some special hardware to
  65. // allow control with only 3 pins so that the lib can
  66. // be called like this //osmc.init(toggle,speed,disable); // specail hardware
  67. // But my lib does not support that option right now. So if you
  68. // really want to control more OSMC boards with fewer pins let me know be leaving
  69. // comments on my site. welcometochrisworld.com And if there is enough response
  70. // I might do it. We'll see...
  71.  

My special hardware doesn't have lib support yet... but it looks like this.
Notice that the control logic chart for the OSMC board really only needs to
change 3 things. Direction, motor speed and disable/enable. I designed some logic
with some NAND gates to control the 5 pins of the OSMC board with only 3 pins
of the arduino.

specailhardware

So next time you want to build some big robots.
Remember this code and these boards exist.
bigmotorsrov

Fork me on GitHub