July 2010
M T W T F S S
« Jun «-»  
 1234
567891011
12131415161718
19202122232425
262728293031  

Leaving Chris World?

Why not bring back a souvenir?

Archives

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''

 
/*
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 special 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.

specailhardware

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

4 comments to Controlling OSMC Boards with an Arduino

  • Ross

    I was wondering at what freq. the PWM is at when driving the motor? I have looked through your code but dont see the adjustment from the default 490Hz to drive the OSMC at the suggested higher KHz ranges.

    I am interested in the NAND gates idea if you dont mind elaberating a bit.

    Here is what I have built (http://www.youtube.com/user/iShannons#p/a/u/0/KJHMWdiabs4) with the OSMC boards, but I used a BrainStem MOTO board to generate the PWM @ 13KHz. I am planning on competing in the SparkFun Autonomous competition and would like to switch everything over to the Arduino platform.

    Thanks in advance

    Ross

  • The NAND circuit
    I scaned and uploaded it here for you…
    http://w2cw.com/starm/images/f/f8/NandBridge.png

    Basically you can see that the 3 pins will translate into the 5 pins you need.
    And the chart on the bottom left explains how the commands should map.

    I have not written library functions for those. Which is why there are not more details.
    And the circuit was never tested with the real OSMC boards it was merely confirmed
    to work with an Oscillscope.

    If you examine the original chart for the OSMC board you’ll see that AHI and BHI stay
    as 1 most of the time. Meaning the only thing changing is the PWM pin.
    So I devised a way to toggle that from just the switch input I created.

    Thus this chart should map to the OSMC chart.

    e/d  switch  pwm  outcome
    =========================
    1       1    pwm  Forward
    1       0    pwm  Reverse
    0       x     x   Diable
    1       0     0   Brake
    

    The extra black Nands on the end that act like invetors are there because the logic
    ought to be right but since I never tested it on the real board you may need to invert
    the outputs to get the proper control signals. In other words this schematic is sort
    of a rough idea of what you need.

    Frequency adjustment to 13KHz…..

    This page would be your guide
    http://www.arduino.cc/playground/Main/TimerPWMCheatsheet

  • admin

    hmm I realize that my osmc lib doesn’t have freq…
    mmmmm

  • If you are willing to buy a car, you would have to receive the mortgage loans. Moreover, my sister usually uses a short term loan, which seems to be the most firm.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Security Code: