Welcome! Log In Create A New Profile

Advanced

Arduino/Sanguino and LMD18200 Motor Driver

Posted by Anonymous User 
Anonymous User
Arduino/Sanguino and LMD18200 Motor Driver
June 02, 2009 01:18PM
Hi all,
It's my first post here on the reprap forum, but i'm and arduino fan from quite long time. smiling smiley
After played with some funny little circuit i'm thinking to make something serious, and my classic dream is a diy cnc machine , i know that this is not the right forum for speak about pure cnc machine, but is surely the most related about driving stepper with arduino... eye rolling smiley
So i would like to use arduino as controller board for the stepper motor, i already know the reprap project and i've looked for the very nice "stepper motor driver 2.3" with DMOS chip, but my idea is to start with motor like the nema23 (rated about 2.6 ampere) so i need a more powerful driver.
I'm thinking about the LMD18200 chip, a H-bridge motor driver cabable of deliver 3Ampere continuos and 5Ampere peak, TTL and CMOS compatible inputs, and a pinout similar to the L298...
But after start to buy all the stuff it i would like to know if someone have successfully piloted it with an arduino/sanguino, i've searched on the forum but actually i didn't found nothing...
Re: Arduino/Sanguino and LMD18200 Motor Driver
June 02, 2009 04:29PM
Don't worry about driving current. It's rarely a good idea to drive steppers at maximum rated current. While the motor is actually moving at any reasonable speed, induction and back EMF will cause maximum current that you'll be able to drive through the motor to drop to only a fraction of the rated current. High current are mainly relevant for holding torque, but you'll have that plenty anyway. Likely you'll want to limit current to something more like 1A - 1.5A to prevent the motors from heating up too much.

Another issue with using high currents is damping: the stepper will "snap" into the next step with a lot of force and then oscillate a bit. Your entire system will be subject to this shock. Lowering the maximum driving current a bit will make the system behave smoother at low speeds, while making no difference at all as soon as you're going at more than a few hundred steps per second.

So, don't even worry about driving anything at more than 2 amps.
Re: Arduino/Sanguino and LMD18200 Motor Driver
June 03, 2009 06:05AM
I don't think those boards are designed for direct driving of an L298 like chip, too many pins on the driver side. I think all the boards Zack designed used an L297 to convert step and direction requests into motor coil control.

I don't like designing in more chips than are required, so on my machine I designed in a bigger microcontroller from the start. If you want ardwino compatibility, and multiple channels, you might have to use an L297 like the other people.
Re: Arduino/Sanguino and LMD18200 Motor Driver
June 03, 2009 11:30AM
FWIW I think the L297 is one of the big limitations of the stepper board as soon as you want to go beyond simple half stepping. A cheap AVR chip can be programmed to do the same (albeit with slightly different pinout) and would allow things such as dynamically switching between full stepping/half stepping, reducing current when idle and delayed last step to reduce resonance.

-Geert
Anonymous User
Re: Arduino/Sanguino and LMD18200 Motor Driver
June 03, 2009 05:58PM
Hi,
thanks for the advice about the current limiting, in any case my choice for the lmd182xx is for make a modular driver, if in future i'll want some bigger motor the driver will be already good...

Abount the controller i think that with the 32 I/O pins of the Sanguino board it shouldn't be a problem to drive three 182xx , also the RepRap Motherboard v1.x is basically a sanguino board and drive non only the motor...
Correct me if i'm wrong but the pin connected between a 182xx<-->sanguino should be 5 (thermal, current, pwm, brake, dir), so maybe it should be possible also to make a microstepping with two 182xx per axis...it make any sense?
I found someone that use it with a pic [www.embeddedtronics.com]
Re: Arduino/Sanguino and LMD18200 Motor Driver
June 04, 2009 02:49AM
OK, just had a quick look at the chip you are talking about:
-Dead simple to use.
-Has some basic current control in-built.

-Micro stepping difficult to implement with this chip, the external logic you would need, would eliminate any benefits of using it.

If you want some ideas, have a look at my image at the bottom of this page:
[forums.reprap.org] ,
where I have an L298 direct connected to a 3.3 volt STM32 ARM microcontroller. To do the job properly, you need:

4 x pin phase inputs
2 x pair enable inputs (to control the motor coils independently on a bi-phase stepper)

And, if you want to have feedback of the current at the sense resistors (otherwise optional), then you need two analogue inputs connected too, per axis.
with three stepper motors, and an 8 input analogue to digital convertor, that would only leave you 2 spare inputs, I used a bigger micro that has 16 ADC pins available, and 4 stepper motor channels. So... that's 32 dedicated pins for the stepper motors alone !
How can I connect a normal 3 pin RC receiver to this chip? What do I connect to the Direction pin and What connects to the PWM pin?
VDX
Re: Arduino/Sanguino and LMD18200 Motor Driver
July 23, 2009 03:51PM
... normal 3 pin RC modules have VCC, GND and PWM - you connect VCC and GND to the corresponding pins (or maybe better to a separate power-source).

The PWM-pin of the RC module will be connected to a PWM output of the Arduino/Sanguino (with a separate PS you have to connect GND of the PS/module and the chip too).

The PWM circuit in the RC module selects the direction of the servo by the pulse-ratio - at a specified threshold pulse-width it's in the middle (or stopped for a continuous RC-servo-winder), below it goes in one direction and above in the other ...

Viktor
grael Wrote:
-------------------------------------------------------
> OK, just had a quick look at the chip you are
> talking about:
> -Dead simple to use.
> -Has some basic current control in-built.
>
> -Micro stepping difficult to implement with this
> chip, the external logic you would need, would
> eliminate any benefits of using it.

Could you elaborate on why micro stepping would be difficult, and how all benefits would be lost upon implementing?
It seems to me that I could naively implement micro stepping by chopping the current progressively higher until the current limit of the chip is reached. Just use the current sense and increment the max allowed current in the AVR software per micro step.
Sorry, only registered users may post in this forum.

Click here to login