Go Down

Topic: Converting 4-Input Stepper Driver (A,B,C,D) to Step & Dir Input Driver  (Read 2247 times) previous topic - next topic

raschemmel

I have a DIY stepper driver (see attached file H_Bridge3.jpg)
Note: That schematic has an error. The driver chip should actually be the TC4427 (Non-Inverting). I discovered this after trying it with the TC4428 and eventually figuring out that that was the "Complimentary Output" version and not the "Non-Inverting " version. After obtaining the TC4427 , the circuit functioned correctly. This driver can handle up to 20A (although my steppers only draw 0.5A).
I have several RAMPS A4988 drivers that work fine with my steppers, but I would like to upgrade my DIY H-Bridge driver by adding a "Front-end" circuit that will convert my driver to a driver
that accepts only two inputs STEP & DIR instead of 4 inputs (A,B,C,D).  I understand that the main difference between my DIY driver and the RAMPS A4988 is that the RAMPS is a "Chopper" type driver.

I have three questions:
1- Would adding a logic circuit that accepts STEP & DIR and outputs A,B,C,D , like this one:

make my DIY h-bridge driver a "chopper" type ?
2- Is there any other circuit that will perform the same logic conversion as the one shown ?
3- Is it possible to modify my DIY driver to convert it to a "chopper " type and if so how ?

I have many years of on the job experience as an Electronics Engineering Tech so building circuits is not a problem.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Robin2

but I would like to upgrade my DIY H-Bridge driver by adding a "Front-end" circuit that will convert my driver to a driver that accepts only two inputs STEP & DIR instead of 4 inputs (A,B,C,D).
I suspect this is not a simple task because each successive step has to cause the appropriate set of voltages to appear on the 4 wires - and there is a sequence of 8 (I think) sets of those voltages that can be seen if you write an Arduino program to control a stepper with a h-bridge without using the stepper library.

A simpler solution would be to write your own Arduino step and direction functions that cause the appropriate sequences to happen. You could have functions with the same names that are written to work with the A4988. Then by including the appropriate version of the functions in your program, the same code could work with an A4988 or with your h-bridge.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

MarkT

A chopper drive circuit has to monitor the winding current at high bandwidth and keep switching the
drive on and off to maintain the current in a narrow band of values (due to winding inductance
the current will be a low amplitude sawtooth wave on top of the programmed current, while the
winding voltage is a rectangular wave.

Most commercial chopper drives use a hybrid of slow and fast decay modes to try and reduce
switching losses in the motor (while usually increasing diode losses in the bridge!)

The simplest arrangement is a free-running bang-bang current loop using a current sensor,
a reference current signal and a comparator that compares them and drives the relevant
bridge in synchonous rectification mode.  If the current is sensed in the actual winding circuit
this method works for any current value (positive or negative or zero).  The amout of
comparator hysteresis and the motor inductance set the operating frequency.  The frequency
will not be steady but very variable, causing the motor to produce interesting noises.

Since you need two independent current control loops for each winding, its usually easier to
buy rather than make such a stepper driver.

If your motor has high impedance windings there is little point using current control as the
supply voltage and winding resistance already limit the current.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

raschemmel

I have more than a few RAMPS A4988 chopper type stepper drivers (but they are only rated for about 0.5A) . I also have a DIY h-bridge (see attached) Note: The part number for the chip is an error. The correct part number is TC4427 (Non-Inverting outputs). The main difference with how the H-bridge works is that while it is designed for PWM inputs on A & B, the motor will only rotate if A & B are complimentary because the TC4427 ignores any combination of inputs that are not complimentary. (A must always be opposite logic of B and vice versa).
Making A HIGH, B LOW = FORWARD rotation
        A LOW   B HIGH = REVERSE rotation


This method works but "required" the use of a CD4050 CMOS-to-TTL converter chip to convert the 12V output signals of the RAMPS A4988 to 5V signals to input to the TC4427 chip. The TC4427 datasheet says the inputs can tolerate up to Vdd so technically the CD4050 is unnecessary but I damaged a couple of chips and don't know how. Since I added the CD4050 I haven't had any more chips damaged. I know that doesn't make sense but I think I'll just play it safe instead of connecting the A4988 Outputs directly to the TC4427 inputs.
This arrangement allows me to run sketches that use STEP & DIR and if I want to run sketches that use IN1,IN2,IN3 IN4 I can just temporarily disconnect the A4988 and connect the GPIO to the TC4427 inputs.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Atabek

Try to programming attiny85 as step dir controller are described in this instructables
 
http://www.instructables.com/id/Attiny85-as-a-StepDir-Stepper-Motor-Controller/

raschemmel

Quote
Try to programming attiny85 as step dir controller are described in this instructables 
GREAT IDEA !
THANKS !
+1
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Go Up