Shop OBEX P1 Docs P2 Docs Learn Events
Stepper motor control with Propeller - Connect with Mach3? — Parallax Forums

Stepper motor control with Propeller - Connect with Mach3?

CassLanCassLan Posts: 586
edited 2009-08-14 00:15 in Propeller 1
Hi all,

Nothing too special but I thought I'd share, did some stepper motor control with the prop and some transistors. Enjoy [noparse]:)[/noparse]

http://www.youtube.com/watch?v=1V6K8QIia7E

Rick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


NYC Area Prop Club

Prop Forum Search (Via Google)



Post Edited (CassLan) : 8/12/2009 6:19:41 PM GMT

Comments

  • Stan671Stan671 Posts: 103
    edited 2009-08-12 18:05
    Hi, Rick.· I am not far from Union City in New Jersey.· I did not·know you formed a Propeller club - that is so cool!· I will try to attend your next meeting on Aug 13th at 6pm.· I will send an Email to the club's address so that we can keep in touch.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Stan Dobrowski
  • CassLanCassLan Posts: 586
    edited 2009-08-12 18:32
    Stan671 said...
    Hi, Rick.· I am not far from Union City in New Jersey.· I did not·know you formed a Propeller club - that is so cool!· I will try to attend your next meeting on Aug 13th at 6pm.· I will send an Email to the club's address so that we can keep in touch.
    Thats great Stan, its a very informal thing, just a few folks geeking out. Hope to see you then.


    Getting ambitious about the stepper control...I decided to try to hook it up to a PC running Mach3, which is CNC software that can be used in various circumstances.

    The connection is made via PC Parallel Port (DB25) and 1 Pin determines the step direction and 1 Pin causes a step (Thats how its supposed to work [noparse];)[/noparse]

    As it turns out the width of the pulses coming from the Mach3 Software to step seem to be about 5us (checked on a scope), and my code is not seeing this, I tried with another CNC program called KCAM which has sigificantly longer pulses and I can read/react to them.

    Is seeing a 5us pulse doable with SPIN?

    Thanks,

    Rick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    NYC Area Prop Club

    Prop Forum Search (Via Google)

    ·
  • Agent420Agent420 Posts: 439
    edited 2009-08-12 19:19
    Nice work.

    I'm no super stepper expert, but I have done a few stepper projects in the past.· Here are a couple of thoughts that you may take or leave as you wish...

    Regardless of the voltage spec on the stepper motor, it is really the current that is the limiting factor, and it is current that creates a magnetic field.· It is common for many stepper applications to use a much higher voltage than what is actually specd for the motor, and instead control the current (typically with some kind of pwm).· The higher voltage allows the field to build up more quickly, resulting in better speed and performance.

    While you can control the current with a pwm signal generated from the processor, often it is more efficient to use a dedicated chip for the task, such as the common L297/L298, LMD18200 or similar.· Allegro also has some cool driver chips.· These have the benefit of incorporating current sensing and a chopper pwm circuits so that the steppers get the correct amount of current.· Really what youv'e got here is a closed loop PID controller where you are constantly monitoring the motor current and making adjustments to keep it at a preset level.

    Several of these chips also include micro stepping features.· In recent years I have noted that assembled modules are very price competitive, so they bear consideration as well.

    Typically I use the processor for only the logic and dedicate the actual power handling to these external devices.· The benefit is reduced processor utilization and·better performance.

    Also, any dc inductive circuit like motors should include clamping diodes at the motor terminals... when the current is shut off the coil field creates a pretty big spike that can damage parts.

    Just my 2p from personal experience.

    edit - a poor pic of my stepper controlled Etch-A-Sketch attached ;-)· Used a touchpad salvaged from a dead Dell laptop to draw.

    Post Edited (Agent420) : 8/12/2009 8:31:50 PM GMT
    600 x 446 - 88K
  • CassLanCassLan Posts: 586
    edited 2009-08-13 14:50
    Agent,

    I agree, at the moment the Prop is driving the motor via the transistors, it was just sort of an experiment to see if I could have that be driven by an external source, but with the prop handling the Logic again I need to have it catch a 5us pulse from the parallel port. Thanks for the input I will take your advise about the diodes and see about getting another part for the power other than those transistors.

    Rick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    NYC Area Prop Club

    Prop Forum Search (Via Google)

    ·
  • TreeLabTreeLab Posts: 138
    edited 2009-08-13 15:22
    We have had great success with Peter Norberg's line of controller boards. They can take ASCII commands for configuration and control, as well as step/dir pulses. A bit more expensive for a multiaxis CNC though, but they include the microstepping options, acceleration codes, etc.

    http://www.stepperboard.com/

    Cheers!
    Paul Rowntree

    EDIT : As Nick points out (next post) the ramping is best left to Mach3, but it cannot be used with a Step/Dir systems anyway since it requires knowledge of the final position to determine ramps rates etc. My point was just to note that these boards are flexible in a number of very different applications.

    Post Edited (TreeLab) : 8/14/2009 3:56:17 AM GMT
  • Nick MuellerNick Mueller Posts: 815
    edited 2009-08-13 15:38
    Intelligent stepper-controlers (that do ramping) are no good idea for Mach3. It wouldn't be able to maintain a vector (X, Y, Z-axes).
    It's best to let Mach do the ramping.

    Serious stepper-drivers can be obtained from here: <http://benezan-electronics.de/&gt;
    10 A, 80 V, with current limit, microstepping (10-fold). Not the cheapest ones, but rock-solid.


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • SawmillerSawmiller Posts: 276
    edited 2009-08-13 23:50
    in regards to mach3..

    use the sherline mode , should work then (draws out the pulse longer) its a checkmark you select
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-08-14 00:15
    Nice video, thanks for sharing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
Sign In or Register to comment.