manual stepper motor control using cmos discretes

Discussion in 'General Electronics Chat' started by alistairsam, May 11, 2010.

  1. alistairsam

    Thread Starter New Member

    May 11, 2010
    8
    0
    Hi,
    I recently bought an a4983 stepper motor driver (from Allegro) and it works fine with a unipoler wired as a bipolar, and is microstepping correctly upto 1/16th.
    my application is not robotics but simple motor control.
    I basically want to use 1/8th stepping, so MS1-3 inputs will be set permanently, but with 4 different options using manual switches/digital latches for the following scenarios

    Clockwise - Hi Speed
    Clockwise - Lo Speed
    CCW - Hi Speed
    CCW - Lo Speed
    Tracking - Intermediate
    (Hi Speed for CW and CCW will use same clock freq, Lo Speed for both DIR will use same lower CLK freq)
    I'm obtaining different clock frequencies using a Silicon oscillator - LTC6900, output to a 4060 freq divider.

    To achieve one of the 4 states above, I thought of multiplexing one of the two different clock outputs from the 4060 (between 400 to 1200Hz) to the CLK input of the A4983, and using a ganged switch, set the DIR to CW or CCW.

    I've thought of using either a multiplexer, or a non inverting buffer or a CD4066 bilateral CMOS switchfor a common CLK bus.
    my problem is setting mux , buffer or cmos switch ctrl pin states using physical switches and pull down or pull up resistors, or digital latches (using a 4013).

    A simple 2 input - 4 channel multiplexer should allow selection of any 3 frequency inputs from the divider with the following truth table
    CTRLA CTRLB CHANNEL
    L L 1
    L H 2
    H H 3

    What would be the best way to set the above logic states using dpdt momentary switches
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Use SPST switches to control the SET/RESET inputs of flip-flops, with pull-up or pull-down resistors to the SET/RESET inputs as appropriate. Otherwise, your switch contacts will bounce and cause you no end of trouble trying to debug the thing.

    Since you haven't bothered to post your schematic or links to datasheets, there's not much more I feel like going into at this point.
     
  3. alistairsam

    Thread Starter New Member

    May 11, 2010
    8
    0
    Hi,
    Thanks for the reply. I have'nt posted a schematic yet as i have'nt completed it and was stuck on what device to use to switch the clock signals.
    But will post a block diagram shortly describing what I'm looking for along with datasheets.
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Apologies if I sound a bit grumpy. It's just that virtually all new members fail to provide schematics of what they have so far and/or links to datasheets of what they're trying to control, or use to control something. Without having such information available, about all we can do is make wild guesses.

    You don't want to deal with wild guesses, as they are very frequently incorrect, which makes threads go on for many pages while you are getting frustrated and burning up parts.
     
  5. alistairsam

    Thread Starter New Member

    May 11, 2010
    8
    0
    totally understand and agree. a diagram speaks for itself and without one, there can be many different interpretations and just not enough data to understand the problem.
    i've already drawn it in visio, but realized the errors, so had planned on redrawing. but as mentioned, am drawing up a block diagram right now, and will provide links to datasheets shortly.
    thanks
     
  6. alistairsam

    Thread Starter New Member

    May 11, 2010
    8
    0
    Hi,
    have attached a block diagram showing what i've arrived at.
    at this stage, I have tested the oscillator - LTC6900, freq divider - CD4060, and the A4983 stepper driver. It works well when manually coupled with a clock signal from one of the divided pins of the 4060.

    I need to get a control panel similar to the one in the diagram working with flip-flops, gates or latches, uncertainties remain on how to control the Mux control pin states using switches, whether to use a Buffer or Bilateral switch or Mux, and whether the Direction input can be incorporated in the controls.
    One possible way could be programming values in an EEPROM and choosing addresses to get the desired outputs, but I don't have access to programming kits.

    Will post links to datasheets shortly.

    Thanks
     
  7. alistairsam

    Thread Starter New Member

    May 11, 2010
    8
    0
  8. alistairsam

    Thread Starter New Member

    May 11, 2010
    8
    0
    Hi,
    I just tested the second method of using switches to select different resistors in parallel to generate the 3 different frequencies, but it did not work properly. the waveforms were distorted, and the frequency was drifting all over.
    but i also tested the first method using the 4051 multiplexer and a simple slide switch to select one of two channels, each of which are connected to two pins of the 4060 frequency divider, and it works well.
    i just need a method of digitally incorporating the three functions using momentary spst or dpst switches.

    i had to use one of the schmitt triggers to change the mux control pin states, as otherwise it was'nt reliable. i guess the same can be done with a pull down or pull up resistor.
     
  9. alistairsam

    Thread Starter New Member

    May 11, 2010
    8
    0
    Hi,

    I think i found an answer to what I'm looking for with a 20key encoder MM74C923N. (http://www.fairchildsemi.com/dwg/N2/N20A.pdf)

    The outputs for my truth table are available by depressing the appropriate spst switch as below. It has built in debounce circuitry, and is tri state. only thing is i'm not sure what the mux output would be when its input is high Z (when keypad buttons are open), or the A4983 motor output when its EN pin is at high Z.

    Code ( (Unknown Language)):
    1.  
    2. Keypad  X  Y  EN  INH  DIR
    3. 12      0  0   1    1    0  - Need this o/p when switches are off to reduce motor draw
    4. 1       1  0   0    0    0  - Hi Speed CW
    5. 18      0  1   0    0    1  - Lo Speed CW
    6. 17      1  0   0    0    1  - Hi Speed CCW
    7. 3       1  1   0    0    0  - Mid Speed CW
    8. 2       0  1   0    0    0  - Lo Speed CCW
    9.  
    (X,Y are inputs to the Mux, EN - Enable for the stepper driver, INH - Inhibit for the Mux, DIR - Direction for the Stepper driver)
     
    Last edited by a moderator: May 13, 2010
Loading...