Shop OBEX P1 Docs P2 Docs Learn Events
Community project - SX Stepper Controller — Parallax Forums

Community project - SX Stepper Controller

PLJackPLJack Posts: 398
edited 2008-01-19 18:41 in General Discussion
I've been meaning to work this project for some time now. Can't think of a better time to start than the first day of the new year.

Goal:
Create a highly versatile easy to use 4 axis high amp stepper controller.

There are easy to use stepper controller IC's but they are not intended for large motors.
There are controllers for large motors but they are expensive and often proprietary.
None that I know of are programmable.


Concept:
Create high amp stepper controller circuity that is driven by an on board SX chip.
The SX software will allow for at least three modes.
1) Autonomous mode:
Set it and forget it. Speed, direction, etc.
2) Manual mode:
Emulate an UCN 5804 chip or similar.
3) Pass through:
Allow full control via an outside pulse source. Such as parallel or serial applications.

Project Phase Overview:
1) Develop a very robust four coil stepper driver circuit. (Current phase)
2) Use the above circuit to create a four stepper motor controller circuit.
3) Start work on the SX software.
4) Develop the PCB layout.
5) Built one of many prototypes.


Unipolar vs. Bipolar?
I would like this controller to handle both types of motors.
I only have experience with Unipolar circuity. If anyone wants to work the bipolar side please jump in.

Community project.
I would love it if everyone worked together on this project to make the controller as robust and versatile as possible. Having said that, open projects scare me a little. They seem to spiral out of control allot. To prevent that from happening here I have to insist that I drive the project. (a bit terse in retrospect, just work together) I'm happy to do the leg work, build prototypes, and take suggestions.
This will be a completely open project. You are all welcome to the code and circuits.
If you don't like any of my decisions I encourage you to take any part of the project and start your own thread. (There it is again[noparse]:)[/noparse]

Enough of the disclaimers. Let's dig in.
This is what I have so far.

This shows a one coil circuit. It is repeated three more times for each stepper coil.
attachment.php?attachmentid=51212


The test bed.
attachment.php?attachmentid=51214

The stepper controller board.
attachment.php?attachmentid=51213

An 8mb movie of the controller working.
MP4 Movie


This controller works very well.
It has about eight hours run time and so far no heat issues.

I would really like your input and suggestions on this coil circuit before I move on.
Can I make it better, safer, more robust?

.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -



Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.

Post Edited (PLJack) : 1/4/2008 1:37:06 AM GMT
298 x 533 - 33K
600 x 404 - 76K
600 x 425 - 49K
1024 x 689 - 170K
«1

Comments

  • PLJackPLJack Posts: 398
    edited 2008-01-01 21:21
    This is the stepper test code:


    ' -------------------------------------------------------------------------
    ' Program Description
    ' -------------------------------------------------------------------------
    
    
    
    ' -------------------------------------------------------------------------
    ' Device Settings
    ' -------------------------------------------------------------------------
    
    DEVICE          SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
    FREQ            4_000_000
    ID        "HIGH-LOW"
    
    
    idx            VAR    Byte            
    StpMaxIdx        VAR    Byte
    StpIdx            VAR    Byte            
    StpSteps        VAR    BYTE
    StpSpeed        VAR    WORD
    RDM            VAR    BYTE
    ' -------------------------------------------------------------------------
    ' IO Pins
    ' -------------------------------------------------------------------------
    
    Motor        VAR    RB
    TRIS_Motor    VAR    TRIS_B
    
    
    ' -------------------------------------------------------------------------
    ' Constants
    ' -------------------------------------------------------------------------
    
    
    ' -------------------------------------------------------------------------
    ' Sub
    ' -------------------------------------------------------------------------
    
    FullForward        SUB
    FullBackward        SUB
    FullBackAndForth    SUB
    HalfForward        SUB
    HalfBackward        SUB
    HalfBackAndForth    SUB
    IncStpIdx        SUB
    DecStpIdx        SUB
    
    
    FullStepExample    SUB
    HalfStepExample    SUB
    
    
    ' =========================================================================
      PROGRAM Start
    ' =========================================================================
    watch StpSteps
    watch StpSpeed
    watch RDM
    
    
    Start:
        TRIS_Motor = %00000000        'set as outputs.
        Motor = %00000000        'set to zero.
        StpIdx = 255
        StpSteps = 255    
        StpSpeed = 2
        RDM = 124
    
    ' -------------------------------------------------------------------------
    ' Program Code
    ' -------------------------------------------------------------------------
    
    Main:
    
    FullStepExample
    HalfStepExample
    
    GOTO Main
    
    
    
    ' -------------------------------------------------------------------------
    ' IncStpIdx
    ' -------------------------------------------------------------------------
    IncStpIdx:
    
        INC Stpidx
        IF Stpidx > StpMaxIdx THEN
            Stpidx = 0
        ENDIF
    RETURN
    
    ' -------------------------------------------------------------------------
    ' DecStpIdx
    ' -------------------------------------------------------------------------
    DecStpIdx:
    
        DEC Stpidx
        IF Stpidx > StpMaxIdx THEN
            Stpidx = StpMaxIdx
        ENDIF
    RETURN
    
    
    ' -------------------------------------------------------------------------
    ' Forward
    ' -------------------------------------------------------------------------
    FullForward:
        IncStpIdx 
        Motor = %00000000    
        READ CPFullStep + Stpidx, Motor
        PAUSE StpSpeed
    RETURN
    
    ' -------------------------------------------------------------------------
    ' Backward
    ' -------------------------------------------------------------------------
    FullBackward:
        DecStpIdx 
        Motor = %00000000    
        READ CPFullStep + Stpidx, Motor
        PAUSE StpSpeed
    return
    
    ' -------------------------------------------------------------------------
    ' Forward
    ' -------------------------------------------------------------------------
    HalfForward:
        IncStpIdx 
        Motor = %00000000    
        READ CPHalfStep + Stpidx, Motor
        PAUSE StpSpeed
    RETURN
    
    ' -------------------------------------------------------------------------
    ' Backward
    ' -------------------------------------------------------------------------
    HalfBackward:
        DecStpIdx 
        Motor = %00000000    
        READ CPHalfStep + Stpidx, Motor
        PAUSE StpSpeed
    return
    
    
    
    ' -------------------------------------------------------------------------
    ' FullBackAndForth
    ' -------------------------------------------------------------------------
    FullBackAndForth:
        FOR idx = 0 TO StpSteps
            FullForward
        NEXT 
        FOR idx = 0 TO StpSteps
            FullBackward
        NEXT 
    RETURN
    
    ' -------------------------------------------------------------------------
    ' HalfBackAndForth
    ' -------------------------------------------------------------------------
    HalfBackAndForth:
        FOR idx = 0 TO StpSteps
            HalfForward
        NEXT 
        FOR idx = 0 TO StpSteps
            HalfBackward
        NEXT 
    RETURN
    
    ' -------------------------------------------------------------------------
    ' FullStepExample
    ' -------------------------------------------------------------------------
    FullStepExample:
    
        StpMaxIdx = 3
    
        StpSteps =  4
        StpSpeed =  500 
        FullBackAndForth
        PAUSE 1000
        
        StpSteps =  50
        StpSpeed =  50 
        FullBackAndForth
        PAUSE 1000
    
        StpSteps =  255
        StpSpeed =  2 
        FullBackAndForth
        PAUSE 1000
    
    RETURN
    
    ' -------------------------------------------------------------------------
    ' HalfStepExample
    ' -------------------------------------------------------------------------
    HalfStepExample:
    
        StpMaxIdx = 7
    
        StpSteps =  8
        StpSpeed =  500
        HalfBackAndForth
        PAUSE 1000
    
        
        StpSteps =  50
        StpSpeed =  50 
        HalfBackAndForth
        PAUSE 1000
    
        StpSteps =  255
        StpSpeed =  2 
        HalfBackAndForth
        PAUSE 1000
    
    RETURN
    
    
    ' =========================================================================
    ' User Data
    ' =========================================================================
    
    
    CPFullStep:
      DATA  %00000001
      DATA    %00000010
      DATA    %00000100
      DATA  %00001000
    
    CPHalfStep:
      DATA  %00000001
      DATA  %00000011
      DATA  %00000010
      DATA  %00000110
      DATA  %00000100
      DATA  %00001100
      DATA  %00001000
      DATA  %00001001
    
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • BeanBean Posts: 8,129
    edited 2008-01-02 03:50
    PLJack,
    The more refined the specs, the more control you will have for a community project. Anything left undefined is bound to be created exactly the way you DIDN'T want.
    I'm up for the sx code. Do you want all for axises to move at the same time ?

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com

    ·
  • JonnyMacJonnyMac Posts: 9,186
    edited 2008-01-02 19:34
    I can help with SX code too -- so long as you want it in SX/B!
  • PLJackPLJack Posts: 398
    edited 2008-01-02 20:43
    Bean (Hitt Consulting) said...

    The more refined the specs, the more control you will have for a community project. Anything left undefined is bound to be created exactly the way you DIDN'T want.
    Bean

    I hear you Bean.
    I can only spec out so far at the moment.
    We don't have the hardware completed yet.

    In this phase I only want to focus on the driver circuitry.
    I was hoping the forums could help design a robust driver for one stepper.
    Then we can simply multiply that by four to get our four axis controller.

    The controller should handle up to 24 volts and 5 amps per motor.
    I think the schematic I attached should work.
    But it's my first attempt and I'm not really sure.

    When we complete the driver schematic that should tell us what SX chip to use.
    This will almost certainly be a SX48. If only for the advanced features.

    Bean (Hitt Consulting) said...

    I'm up for the sx code.
    Bean

    That is wonderful news.
    Bean (Hitt Consulting) said...

    Do you want all for axises to move at the same time ?
    Bean

    As in simultaneously?
    If the controller is used on a CNC machine it would be used in pass through mode so the cnc software would take care of that.
    If the controller is configured in autonomous mode I would think that simultaneous movement would be more precise.
    So I would say yes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.

    Post Edited (PLJack) : 1/2/2008 8:52:57 PM GMT
  • PLJackPLJack Posts: 398
    edited 2008-01-02 20:49
    JonnyMac said...
    I can help with SX code too -- so long as you want it in SX/B!

    As an open project I think that releasing it in a variant of Basic would reach a larger audience than Assembly.
    SX/B cranks along pretty fast at 50Mhz.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-01-02 23:49
    I've got some dual-axis SX (assembly) unipolar stepper code posted here, along with a document that describes the serial interface protocol. It employs ramping and linear interpolation and was designed to hack the X10 "Ninja" pan-and-tilt platform. But the basic drive stuff is pretty universal. (Note: The email address posted at that website is inactive.)

    -Phil
  • PLJackPLJack Posts: 398
    edited 2008-01-04 00:23
    Hi All.

    So, should I go ahead and physically replicate the coil circuit listed above?

    This will require that I solder up 16 TIP120G's. I was hoping for some feedback on that circuit before I do that but it does seem to work pretty well.

    As for the resistor on the SX I/O pins. I always like to see a resistor between it and the rest of the circuit.
    Technically , with a diode right next to it, the pin should never see any incoming voltage.
    But I like them there in case a bare wire or other VCC source brushes near the SX.

    Right now I'm using 1K's.
    Should I be using something larger?

    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • PLJackPLJack Posts: 398
    edited 2008-01-08 01:32
    Update.

    Currently working on the schematic and PCB design
    I really like the PCB Artist software but I am having an issue routing for a QFP package (sx48).
    I have an email in to the 4PCB tech support.

    Anyone ever use this software before?

    I'm trying to form a business relationship with a PCB fab company and have chosen 4PCB.
    The PCB Artist software even does live quotes.
    Here is hoping that the issue is between the keyboard and the chair and not with the software.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • SawmillerSawmiller Posts: 276
    edited 2008-01-08 10:41
    just a quick question... what are you going to use to limit current to the coils ?
    are you going to use a current sensor/ chopper circut like Pminmo's or the more inefficent current limiting resistor.
    i dont see either in your schematic. of course its just starting but thats one thing i would be looking at due to the fact you can burn up a stepper with too large a current flow, but in the cnc world its common to run steppers with up to 20 ( i think ) times the voltage they are rated for, just keep the amps to the rated max. ( i have used pminmo open source boards for both of the cnc routers i have built)
    however his driver board, using the A3977 chopper is only rated for 32 volts/2.5A i think ( bipolar)
    dan
  • PLJackPLJack Posts: 398
    edited 2008-01-08 23:53
    Thanks Dan for the feedback.
    That is just the kind of help I need.
    Dan said...
    current sensor/ chopper circuit like Pminmo's or the more inefficient current limiting resistor.

    After some research the chopper circuit seems like the obvious choice.
    I recognized Pminmo's website. Been there before in my travels.
    Integrating the chopper is next on my list now.

    Am I right that if we use a POT for the current sensing resistor that we can easily adjust the current ceiling?

    Found a nice PDF on chopper use here:
    Drive.PDF

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • SawmillerSawmiller Posts: 276
    edited 2008-01-09 01:18
    thats what i've seen· and adjusted on the 2 diff types of bipolar driver boards i use.
    ·a multi turn potentiometer that you adjust to a certain voltage value, depending on your motor max amps
    dan
  • PLJackPLJack Posts: 398
    edited 2008-01-10 23:15
    For those interested on how a chopper works I found a great resource here:
    Current Control of Stepper Motors

    Hope to make some progress tonight integrating the chopper.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • SawmillerSawmiller Posts: 276
    edited 2008-01-10 23:41
    thats a good explanation of choppers.

    sounds like a lil experimentation is in order. but 20 Khz is pretty fast, do you think the sx can sense it and send the signal, or are you going to offload some of the tasks ?

    dan
  • PLJackPLJack Posts: 398
    edited 2008-01-11 23:54
    .

    OK, you just confused me.
    Sawmiller said...
    but 20 Khz is pretty fast, do you think the sx can sense it and send the signal, or are you going to offload some of the tasks ?
    dan

    attachment.php?attachmentid=51409

    Granted I've never used a chopper but here is what I took away from that article.
    I connect my sx pin (Activate Signal) to the AND gate.
    Then connect the AND gate to the power transistor and the OR gate to the AND gate.

    With the rest of the circuit in place I could keep an SX pin high a long as I wanted because the chopper would fire as needed to control the current.

    The 20Khz is what a typical 5 volt stepper powered at 24 volts will chop at (20,000 times a second.)
    So if I pulse (turn on) a coil on the above stepper for 2 milliseconds the chopper would fire roughly 40 times. With no need for interaction from the SX.

    Is this not the case?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.

    Post Edited (PLJack) : 1/11/2008 11:59:18 PM GMT
    340 x 295 - 3K
  • SawmillerSawmiller Posts: 276
    edited 2008-01-12 01:52
    in the chopper explanation, it said that the chopper works at about 20000/sec
    looking at that diagram, i was wondering if you were going to sense the voltage above the sensing resistor ,which tells what the current is , with the sx
    or use a different chip to do the comparison between the rising voltage and the ref voltage .

    i figure you could use a chip ( no idea which one ) to do the comparison, then put the yes/no signal into the sx, and then fire off a activate signal, thus using the sx as both a control and a and circut.

    but you prolly cant do compare,and activate both in the sx at 20khz.
    however i am in noway a expert/elect enginneer.

    i just play with cnc stuff

    just a quick browse around and it looks like the traingle thing in the diagram... tongue.gif
    is a comparator circut, and we prolly need make it a schmitt trigger type
    dan

    Post Edited (Sawmiller) : 1/12/2008 2:06:06 AM GMT
  • kelvin jameskelvin james Posts: 531
    edited 2008-01-12 06:50
    I think this is what you might be looking at to do for the driver
    1224 x 1583 - 304K
  • PLJackPLJack Posts: 398
    edited 2008-01-12 18:00
    This is what I like about working with steppers. It seems pretty straight forward until you get into the details.
    Dan:
    When I was reading that article it did occur to me that the entire circuit could be reproduced via SX software.
    The SX48 is a pretty powerful chip.
    But there is no point in that until I fully understand what I am reproducing.

    My first thought is to use a adjustable voltage regulator for the VREF and individual gates from an IC for the logic components.
    Now you have me wondering what that "triangle thing" is. smile.gif
    Seems to me there should be a + and - symbol on that chip if it was something other than a simple gate.

    Either way I have some time set aside this evening to work it.
    If I see any magic smoke I'll know that I don't understand what I am doing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.

    Post Edited (PLJack) : 1/12/2008 6:44:26 PM GMT
  • PLJackPLJack Posts: 398
    edited 2008-01-12 18:40
    kelvin james said...
    I think this is what you might be looking at to do for the driver

    That is quite a chip.
    Microstepping Driver with Translator

    $3.00 on Digikey.
    3/4 amp 24 pin IC per stepper.

    In a round about way this is what I am trying to make.
    Only higher amps.
    In then end I want the SX to have a setting to emulate just such a chip.
    I know, big plans. But even if I don't achieve this goal there is bound to be lots of good things to come from this project.
    Like me understanding how the heck a chopper circuit works. [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • PLJackPLJack Posts: 398
    edited 2008-01-12 19:26
    Seems obvious now that my supposedly "OR" gate is a voltage comparator (OP-AMP).

    A couple of LM339 or similar IC's will give me 8 of them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • SawmillerSawmiller Posts: 276
    edited 2008-01-12 23:29
    yup, looking at some op amp circuts , it appears that you could use a voltage divider with a multi turn potentiometer as one of the resistors to get your variable voltage.
    heres a web page showing that circut i think

    http://www.ecircuitcenter.com/Circuits/curr_src1/curr_src1.htm

    just need to put the sx between the opamp and the mosfet

    james the problem with those all in one chips, like A3977 and such is that they are limited to 2.5 amps or so, and they are comparativly expensive to a sx, opamp and some mosfets

    thanks for starting this thread, im learnin stuff, pl
  • kelvin jameskelvin james Posts: 531
    edited 2008-01-13 00:45
    No issue with the expense, i just posted that because it is a good document to show the workings of a stepper controller. Actually sparkfun sell a ready made board with that chip and a variable pot for $15. Those chips are made to offload the work from the processor, so if the sx has the power, the good stuff can be done with the software. I really like this new motor controller, just can't figure out how to run a stepper with it yet.
  • PLJackPLJack Posts: 398
    edited 2008-01-13 22:13
    Well my first time working with choppers was a failure.
    I'm using one quarter of a LM399 for my breadboard.

    I could not get more than .6 volts to the TIP120 base.

    I'll try again tomorrow and post some pics of the test bed and any questions I might have.
    I'm not using a stepper for this test. Just working a one coil circuit for now.
    My first problem was finding something that pulled some amps.
    I think tomorrow I just use a resistor to ground for the amp load.
    I had the AND gate in the circuit at first, but pulled it when the OP-AMP circuit did not work.
    I'll start with a clean breadboard and try again.
    The lowest resistor I could find is a 10ohm.
    I'll have to look through my pile for something smaller.


    NOTE:
    I went to Radio Shack for the LM399, and guess what else was in stock.
    Parallax PIR sensor's! I'm wrapping up my bench time tonight with the PIR so the night won't seem like a complete loss. [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.

    Post Edited (PLJack) : 1/13/2008 10:20:36 PM GMT
  • PLJackPLJack Posts: 398
    edited 2008-01-15 01:45
    Strike Two.

    My goal tonight was to get one of the comparators of the LM339 to behave the way it should in the chopper circuit.

    I started here:
    Voltage Comparator Information And Circuits

    That site states:
    Basic Comparator Operation
    Input Vs. Output Results
    1. Current WILL flow through the open collector when the voltage at the PLUS input is lower than the voltage at the MINUS input.
    2. Current WILL NOT flow through the open collector when the voltage at the PLUS input is higher than the voltage at the MINUS input.


    attachment.php?attachmentid=51449

    Very simple indeed.
    I did not have 5V and 6V available so I used 5V for the L [noparse][[/noparse]+] and 12V for the H [noparse][[/noparse]-] inputs.
    I was unable to generate any voltage from the output pin.
    I tried all four comparators on the LM339 with the same results.

    Is this because of the 7V difference between the two inputs? (don't see how)
    Did I fry my LM339 last night?
    [noparse]:)[/noparse]

    I did learn a few thing today though.
    One being that an OP-AMP is a bad choice for a chopper circuit. Apparently they are too generic and slow for this application.
    That is one reason why they make dedicated comparators in the first place.
    Also why the REF voltage on a chopper is so low. 1 volt or so. It's because you are measuring up from ground.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.

    Post Edited (PLJack) : 1/15/2008 1:50:51 AM GMT
    564 x 402 - 6K
  • T ChapT Chap Posts: 4,223
    edited 2008-01-15 05:05
    You may want to explore a fixed off time chopper circuit instead, use a shift register to set the fixed off time. I may have a circuit somewhere for it. Basically you trigger the shift register by the comparator, set a latch, the shift register starts counting and outputting on each pin till it hits the pin you have chosen, which resets the latch. The latch feeds and AND which is being pulsed by the stepper sequence output. The SR can get it's clock from any source. This way, you specify how long the off time is per over current. Tune the system for best performance, you could even use the SX to do this function, and have user defined off time.

    I know this is already discussed:

    After many variations of chopper experiments, a dedicated driver turned out to be the ultimate solution, although takes a lot of fun out of figuring the stuff out.

    Allegro's A3986 is what I use on various bipolar projects, plug in your own mosfets with up to 50V, amps are a concern of the mosfets, so there is a lot of flexibility there.

    The input are step and dir, with whole, half, 1/4 and 1/16 options, plus options for decay.

    I have working boards in Eagle if anyone wanted to give it a go, all SMT except for the mosfets.
  • PLJackPLJack Posts: 398
    edited 2008-01-15 22:55
    TChapman said...
    You may want to explore a fixed off time chopper circuit instead, use a shift register to set the fixed off time. Tune the system for best performance, you could even use the SX to do this function, and have user defined off time.

    All good ideas.
    Offloading the work to the SX has occurred to me.
    And is still on the table.
    TChapman said...

    Allegro's A3986 is what I use on various bipolar projects, plug in your own mosfets with up to 50V, amps are a concern of the mosfets, so there is a lot of flexibility there.

    Another great idea. I don't think I've ever seen that arrangement in a circuit before.
    That would be a great technique for a low cost easy to build controller.

    The one thing that keeps me working on the chopper is that I really like the idea of current control being built into the circuit with discrete components.
    To that end I stopped at RatShack today and picked up another comparator.
    We will see how far I get tonight.

    Thanks for the input TChapman.

    .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • T ChapT Chap Posts: 4,223
    edited 2008-01-16 01:27
    I think PMinmo made some stamps with the 3986, check his site.

    That would be a very quick and easy project if he has those done.

    I spent countless hours going down this chopper method road, the mostfet driver [noparse][[/noparse]of any sort that suits the app] is the way to go imo.
  • PLJackPLJack Posts: 398
    edited 2008-01-17 01:02
    TChapman said...
    I think PMinmo made some stamps with the 3986, check his site.
    That would be a very quick and easy project if he has those done.
    I spent countless hours going down this chopper method road, the mostfet driver [noparse][[/noparse]of any sort that suits the app] is the way to go imo.

    There is a huge write up about that chip on the CNCZone.
    14 pages of board design only to find out that the 3986 is flawed.
    You can get an idea of the flaw on the last page.
    Unlike me who spent 40 minutes reading the whole thread only to find out the chip is not suited for DIY'ers.

    I do like PMinMo's modular designs though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • T ChapT Chap Posts: 4,223
    edited 2008-01-17 19:52
    On the cnczone thread I am the user "originator", I spent a lot of time on that thread.

    I have the 3986 running on 3 machines working stainless and aluminum with no issues, I never did phase error tests, as friction on a machine never allows for a perfectly linear motor-to-travel factor anyway. It is always "averaged" to some extent due to play in the table, energy transfer etc. I even have one machine which has dual X motors that operate in parallel off the same control signal, the system operates fine with Nema23's at 36 volts cutting precise parts and fine engraving tools. In my opinion, I have more than sufficient evidence for home DIY use, with the only exception being the soldering learning curve.

    I suggest using some type of mosfet driver at least, IR2184 has been a very popular tried and true driver, there may be newer versions of the part or better versions from competitors. There needs to be some type of built in dead band protection, which the driver like 2184 will provide.
  • PLJackPLJack Posts: 398
    edited 2008-01-18 22:56
    TChapman said...

    I even have one machine which has dual X motors that operate in parallel off the same control signal, the system operates fine with Nema23's at 36 volts cutting precise parts and fine engraving tools. In my opinion, I have more than sufficient evidence for home DIY use, with the only exception being the soldering learning curve.

    Well there you go, I stand corrected. Thanks for the correction.

    If I am unable to design and build an easy way to adjust current load then I will start looking at dedicated stepper IC's.
    It may be that my entire premise is wrong and there is no need for another stepper controller constructed of basic components.
    But with a SX chip at it's heart, I somehow doubt that is true.
    If so, it will be documented here.
    If I do pull it off it could be an incredibly versatile board.

    Sounds like you have been down this road before.
    Please chime in when ever you can.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
  • T ChapT Chap Posts: 4,223
    edited 2008-01-18 23:59
    My only question is what is the intended role of the SX if not for actual sequencing the steps?

    Taking Step and Direction from a software like Mach3 or other is a useful role for the SX to convert it to 4 control signals per motor [noparse][[/noparse]assuming bipolar]. The Prop is better suited in my opinion since you can drive probably 4 bipolars easily, but certainly it is just a pref which processor. Either is easy in Spin or SXB, unless you really need high speeds at 1/16 res, then you may get a little bogged down. But on a home type system, this is not important, most cutting is slow speeds.

    The I spent a lot of time on designing some CNC controllers, and finally ended up using the Prop as a sort of master that reads the Step and Dir input from 4 channels off Mach 3, then have the Prop read the encoders as well while comparing actual motor steps with the incoming steps, and stopping the system on some threshold of error. Real time error correction was not a desire of mine, since I want the machine to stop dead if there is an error, in case something has been hit by the tool or the tool has binded up in a part.

    I think you really have to first identify what the end goal is, then make a plan. If it is a simple 3 axis machine that does not require encoders, then any PC CNC app plus your choice of SX or Prop Step and Dir to 4 channel decoding is very easy. Just set up some shunt off the low side of the fets, use a comparator, use a shift register for setting a fixed off time, use a latch to trip on over current, I may have some earlier drawings I can post, I just need to look back through my files.

    Like I said, the main thing is first establish the ultimate goal. I would stay away from Gcode decoding, it's too cheap and easy to use software.

    I like Mach3, and there is a free demo that is fully functional for smaller projects, I think 1000 lines of code which is ok for getting started. It is hard to beat this software.

    From the PC, just make a board that accepts the various pairs of Step and Dir[noparse][[/noparse]DIN25], put in a PS, run the sequence in the SX/Prop, use an IR2184 for highside fet driver, some chopping, and there you go.

    I'll look for the old files when I was working with chopping.
Sign In or Register to comment.