Hi,
Strictly, half-stepping needs the drive current to be reduced for the half-steps (when both coils are driven at the same time) which isn't (easily) possible with a L293D. Here is a quote from
the first reference I found :
"The half-step driving method is relatively more complicated than the full-step driving method. At the same time, both phases may need to be energized, and the energizing current should be √2/2 of the single-phase energizing current. Of course, it is also possible to directly pass a current equal to the single-phase current. As a result, the torque during the rotation of the motor is not constant, but it has the advantage of simplifying the driving circuit or software writing. "
However, if the inductance of the coils is sufficiently high (and/or the drive pulses sufficiently short), then you may be able to control the current by using different pulse widths.
Personally, I like to consider the drive sequences of ALL stepper modes in terms of 8 phases or "timeslots" (or an even greater number for microstepping). The eight timeslots might all have the same period, or the odd-numbered and even-numbered slots might be arranged to have different periods. This allows the current drain (and hence torque) of the motor to be controlled to suit the application (and the motor itself). In an "extreme" case, either the odd or even slots can be set to zero, to give a "normal" 4-phase sequence.
Another complication is that there are two ways to switch "OFF" each coil,
or 3 if you include "tri-stating" the pin(s), i.e. disconnecting or floating a drive pin to the coil (not possible with the L293D). Either both ends of the coil can be driven HIGH, or Both LOW (therefore no current can flow) so there is more than one "pattern" of drive sequences that can produce the desired effect. Thus, for a pair of pins driving a coil, there are four possibilities:
"00" = No current , "01" = "Forwards" current , "10" = "Backwards" current and "11" = No current. But here I will show the current flowing in the coils (A and B) as +A , -A , +B , -B and 0 if no current flows.
There are four basic drive sequences but it's possible to "morph" between some by reducing either the odd or even timeslots to zero. Moving from left towards right, the total load current increases (perhaps to "dangerous" levels) and hopefully also the torque. The third sequence column is the nearest to "Half-stepping" and setting the Even-numbered timeslots to perhaps 70% of the Odd-numbered slot-period might be rather smoother. But much depends on the physical characteristics of the stepper motor.
Code:
Timeslot Low current ............................High current
0 0 -B +A -B +A -B
1 +A +A +A 0 +A -B
2 0 +A +A +B +A +B
3 +B +B 0 +B +A +B
4 0 +B -A +B -A +B
5 -A -A -A 0 -A +B
6 0 -A -A -B -A -B
7 -B -B 0 -B -A -B
8 0 -B +A -B +A -B
Personally, I normally drive stepper motors with a simple sequence of
HIGH pin , PAUSE period1 , LOW pin , PAUSE period2 , etc. commands, or even
TOGGLE pin , etc.. because it's much easier to "see" what's happening, but if you really need a "drive sequence" then we can probably create one for you.
Cheers, Alan.