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

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

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

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.
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
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.
lowest prices for rogaine and propecia tramadol no prescription needed = 6buy cheap propecia online generic no prescription viagra = propecia lowest online prices withouth prescription growth hormone human mexico = subaction showcomments cialis start from online prescription what is tramadol = is generic viagra from india safe 2000 cheap daily feb statistics viagra
i have been using your code for the arduino/osmc project. I have a duemelnove Arduino and two OSMC boards connected to two Permobil power chair motors for my DIY Segway. I was very happy to find this website as I fried the Dalf Microcontroller I bought with the two OSMC\'s. Anyways, I finally have the motors working but also have a question.
For some reason my motors wont work with the wire configuration you have here on this page. It isn\'t until I plug the disable wire from the OSMC controller to an actual ground on the arduino that the motors start working correctly.
In your .cpp library you have [digitalWrite( this->dis, LOW);] under your void forward function. So basically the disable pin on the OSMC controller needs to go low to enable the motor, but for some reason they wont until I plug in this disable wire directly to a ground on the arduino.
A couple of symptoms I\'ve noticed, I have an audible frequency of about 480hz emitting from the OSMC controllers. It sounds like an electric forklift after pressing the accelerator from a complete stop, like the current is somehow making a \"working hard\" noise. Very weird and annoying and it makes me feel that the motors aren\'t running as efficient as they could and it might be because of this disable thing i don\'t know.
The other symptom is this: I have two OSMC\'s controlling two motors. Remember to get them to work I have to plug the disable wires to an actual arduino ground. So when I\'ve got the disable wire from the left OSMC plugged in, the left motor is very smooth and stable(still the audible frequency) forward and reverse, but as soon as I plug the right OSMC disable wire into ground, both motors rotate and speed up as expected but its real glitchy until they both get to top speed. And the glitch seems like it happens once every rotation.
I\'m really just hoping you\'ve run into these problems in your trials with the OSMC/arduino combo and might have a solution. Thank you for your hard work and documentation on this. You don\'t know how excited i was to google \"arduino and OSMC\" and find that you had done your homework.
http://www.youtube.com/watch?v=v-d6qprwhLA
Any help would be appreciated, I know that it\'s been a while since you\'ve done the OSMC\'s and you\'ve moved on to other projects, but maybe you\'ve had similar problems.
thanks
-Jay