Arduino Playground is read-only starting December 31st, 2018. For more info please look at this Forum Post

Controlling OSMC Boards with an Arduino

Written with Ard IDE 0015

Overview

  • The Nifty Chart is not correct. AH and BH =1 gives a brake condition, as does ALin and BLin =1. For a motor speed control

direction CW AHin=1 and BLin=PWM, direction CCW BHin=1 and ALin=PWM. The disable pin must be low for the chip to be enabled.

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.

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.

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

Lib Code and Demo Sample in a zip

http://welcometochrisworld.com/wp-content/uploads/2009/06/osmclibfiles.zip

Lib Demo Example

/*
Copyright (c) 2009 Chris B Stones (welcometochrisworld.com)

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/

#include <osmc.h>

/* When wiring up an OSMC Board this values correspond to the HIP4081A chip specs. 
Refer to that chips data sheet to figure out which pins to wire to. 
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
etc..
*/ 

/* With this Very Basic library you need 5 pins per
   OSMC board. They all are I/O pins but 2 of them have to 
   be PWM capable 
*/
int AHI     = 8;     // normal I/O pin
int BHI     = 7;     // normal I/O pin
int ALI     = 6;     // must be on a PWM I/O pin
int BLI     = 5;     // must be on a PWM I/O pin
int disable_pin = 4; // normal I/O pin


OSMC osmc;
void setup() {
  osmc.init(AHI,BHI, ALI, BLI, disable_pin); 
}

// simply show forward and reverse at some speed.
int motor_speed = 200; // a value between 0 and 255
void loop() {
  osmc.forward(motor_speed);
  delay(500);
  osmc.reverse(motor_speed);
  delay(500);
}

// NOTE: I have also designed some specail hardware to 
//       allow control with only 3 pins so that the lib can
//       be called like this //osmc.init(toggle,speed,disable); // specail hardware
//       But my lib does not support that option right now. So if you 
//       really want to control more OSMC boards with fewer pins let me know be leaving
//       comments on my site. welcometochrisworld.com And if there is enough response
//       I might do it. We'll see...

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.

For more Theory on Speed control via PWM signals

http://homepages.which.net/~paul.hills/SpeedControl/SpeedControllersBody.html