Trouble controlling some bipolar stepper motors...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trouble controlling some bipolar stepper motors...

5,597 Views
mauricio2346
Contributor II
Hi!!!!
in this moment i have 2 bipolar stepper motors from an old epson stylus 600 that a friend gave to me.   this motors  works  with 42 volts but  i discovered that they work fine at 12 volts.  the measurement of phase's resistance is about 5 - 6 ohms, that represents 2 and a half amperes.  the first time i tried using the original  motor controler (a disgusting ic with 28 pins and high amount of signals to control).  The B plan was a array of 4 discrete h bridges with transistors ( 2SC1162 and 2SA715) , but i noticed that they got very very hot at first, and some minutes later  they just blow out - specially the A715.  i have some integrated h bridges from freescale ( 33886).  In colombia is too hard to find that kind of stuff, and i dont want to broke them... (jeje, i dont have a second chance to use them).  so, should i connect the stepper motors to them or i have to do something else????

please i need some help.... thanks..

ahh, sorry, i know that this forum is about hc08 microcontrollers, but i couldn´t found another way to expose my problem... plus, i want to control the bipolar steppers with hc908gp32 microcontroller....

Greetings.... Mauricio




Message Edited by mauricio2346 on 2007-07-29 05:43 AM

Message Edited by mauricio2346 on 2007-07-29 05:44 AM
Labels (1)
0 Kudos
18 Replies

729 Views
mauricio2346
Contributor II
Hi!!!
 
i been finding some information about h bridges, but the schematics are very similar with my design.  another thing that i could find is the  compete model of the original integrated h bridge that controlled the stepper in the printer...
 
LB1845.
Specs: 1.75 amps max (Peak)
42 volts
this chip is so hard to use because the pins are so close between them (no posibilities of mounting in a protoboard)
so, i don't know if they are broken!!!!
 
 
SOME QUESTIONS:
 
this specs are by far lower than the specs of mi h bridge. what do you think if i use an interlock circuit instead of changing the program?   maybe won't trigg the 3904 in forbidden states, "preventing" short circuits in the BJT's.
 
i want to use a sealed lead cell ( 12v, 1.2 Ah).  is good to control 4 h bridges and some circuitry???
if i reduce the 3404's base resistor, would lend to te other BJT to bring more current (without damage) to the phase???
 
 
Thanks!!!
 
0 Kudos

729 Views
mauricio2346
Contributor II
Hi!!!

a picture may be worth a thousand words



jeje, this conversation is becoming a kind of intersting.   obviusly the secuence of stepper control's vector is wrong!!! it responses to the steps of the motor... in this moment i can't remember the combination but i think  that is something like this:

Unsigned int MotordePaso[4,5,10,9];

i used the entire port A of microcontroller because its 8 pins are in the same location of the IC, and  they gives more current to outputs (control leds for example).
 the diode is a rl206 (2A instead of 3A jeje),
my teachers in college gave to me some information about this kind of BJT Arrays (H bridge),  and they can't really understand what the hell is happening with this h Bridge. 

i have too unipolar steppers, and oviously they are better (control) and cheaper, but i want to control some bipolars because i have this wonderfull pair of bipolars (twins too), stronger but the control device is killing me!!!

if somebody want to reply, please, help me to upgrade the program, maybe with the necesary delay code between the steps...

thanks and sorry, sometimes i become a donkey while i'm writting in english...
jeje
0 Kudos

729 Views
bigmac
Specialist III
Hello Mauricio,
 
To provide you with more detailed assistance, we really do need you to post the schematic of the H-bridge drivers you are using, and their connections to the GP32 MCU pins.
 
This picture might be worth even more than one thousand words!
 
Regards,
Mac
 
0 Kudos

729 Views
mauricio2346
Contributor II
Hi!!!
dooh!! at least, the schematic image is here

Q2,Q4,Q8,Q10 are 2sa715
Q3,Q5,Q9,Q11 are 2sc1162
Q1,Q6,Q7,Q12 are 2n3404 or similar
D1 to D8 are rl206
R1,R2,R5,R6 are 56 ohm / 1watt
R3,R4,R7,R8 are 4.7K ohm /0.25watt

all 2n3904 switch the larger BJT, and there is no risk to damage the ports by overcharge.

any modifications are welcome...

thanks.

0 Kudos

729 Views
admin
Specialist II
I believe I see a small problem with your drivers. Those 2N3404's are spec'ed with a minimum gain of 75 at 2ma, and it will be considerably less than that at the current you're trying to pass (looks like you're trying to get around 175ma of base drive to your bridge transistors). With only a 4.7K series base resistor coming from your chip to the 3404's, you're going to get somewhere around 0.7ma base drive to the 3404's (assuming a Vcc of 5v). Even at a gain of 75, that will only give you about 55ma of drive going to the bridge. I don't think that's nearly enough.

Can you replace the 3404's with a logic level FET? (A FET that will be on pretty good at 4v)
0 Kudos

729 Views
admin
Specialist II
Wasn't quite finished ....

Either use an FET, or lower the 4.7K down as low as you can, say around 470 ohms.
0 Kudos

729 Views
admin
Specialist II
Oh, and I'm not a newbie here. I'm Wings, but when I asked FS to change my email address it looks like I had to become a new person as well. (Lame)
0 Kudos

729 Views
bigmac
Specialist III
Hello Mauricio,
 
I totally agree with Wings(y) about the lack of drive provided by the 2N3404s, and this would be one potential cause of your overheating problem.  I think use of N-channel logic FETs, to replace these transistors, would be a very good solution, so as not to stress the outputs from the MCU.
 
However, I can also see a further problem.  With the circuit arrangement you are using, the bridge transistors will be very slow to turn off.  This is because the base circuits effectively become open circuit.  The turn-off should be considerably faster with a resistor connected between base and emitter of each transistor.  Perhaps a value of 100 ohms should be suitable.
 
However, even with this reduction of turn-off period, there is still a possibility of both PNP and NPN transistors, within the same leg, conducting for a short period.  Therefore, I would still suggest that you implement a short dead time period within your code, with the following PTAD output drive sequence.
 
0x10, 0x50
0x40, 0x60
0x20, 0xA0
0x80, 0x90
then repeat the sequence
 
The first state of each pair would remain for, say 5 microseconds or so, and the second state would remain for a period dictated by the motor rotational speed.  The presence of the first state ensures that, whenever a phase changes polarity, there is no drive present for the dead time period.
 
The code to handle this might consist of two constant arrays, one array for the transitory state and the other array for the conducting state.
 
volatile const unsigned char Transit[] = {0x10, 0x40, 0x20, 0x80};
volatile const unsigned char MotordePaso[] = {0x50, 0x60, 0xA0, 0x90};
 
The following code demonstrates the use of these values -
 
for ( ; ; ) {
   for (i = 0; i = 3; i++) {
      PTAD = Transit[i];
      Deadtime();           /* Deadtime delay */  
      PTAD = MotoredePaso[i];  
      Delayms(5)
  }     
}
 
In practice, TIM output compare interrupt might be used for timing purposes (but not for deadtime) to provide a means of varying the motor speed, and possibly reversing the direction of rotation.
 
Regards,
Mac
 
0 Kudos

729 Views
bigmac
Specialist III
Hello Mauricio,
 
I forgot to mention in my previous post about the use of the RL206 diodes.  These appear to be a general purpose type, with unspecified reverse recovery time (trr).  As Rocco previously suggested, fast recovery types should be used to provide proper protection.  Alternatively, you might use Schottky diodes, provided they have adequate voltage and current ratings.
 
The presence of dead time is likely to exacerbate transient voltage levels that may potentially occur.
 
While you are experimenting with code, a further suggestion is to place a low value power resistor in series with each motor winding.  Possibly a value of 5-10 ohms, with a power rating of 5 or 10 watts.  While this will reduce the motor torque, but it will also reduce power dissipation within the transistors during initial tests.
 
Regards,
Mac
 
 


Message Edited by bigmac on 2007-08-01 07:56 AM
0 Kudos

729 Views
mke_et
Contributor IV
I had a project that I used to use TTL OC outputs on, and they were, shall we say, less than optimal?

I kept looking for a replacement and finally found one. It was a chip I was told was developed for the 'gaming industry' (as in slot machines). I drive it directly off the output pins of a 9S12 chip, and I can run MULTIPLE devices with it. At one point we ran THREE drag strip 'trees' at one time for a couple of days just to see how they would hold up. Really rugged little part.

Anyway, the part was a transistor array. I don't have datasheets anymore, but the number was M54513P. It's speced to handle 50ma, but I have yet to see one toasted.

http://www.mitsubishichips.com/Global/content/product/power/transistorarray/ tarray/tarray/m54513fp_e.pdf

To use this link, take out the spaces. I put the spaces in to keep from screwing up the page. If you have a 'long line', the forum insists on trying to make the whole page fit without a line wrap.

Message Edited by mke_et on 2007-08-01 12:41 PM
0 Kudos

729 Views
bigmac
Specialist III
Hello Mauricio,
 
With your expected motor winding current, the transistors you have chosen would be operating very close to their upper limit - perhaps more conservatively rated devices would be appropriate.
 
High dissipation can result if both NPN and PNP transistors both conduct for a short interval.  Do you take steps to allow a short delay between the turn-off of one device, and the turn-on of the opposite device?
 
You also do not mention whether you have taken steps to control transient voltage spikes, possibly using diodes, that may occur because ot the inductive load.
 
Regards,
Mac
 
0 Kudos

729 Views
mauricio2346
Contributor II
Hi !!  

I forgot to say that i used some protection diodes (3 amps) between  transistor's emitters and collectors.   maybe the main problem is the size and dissipation of the transistors..  because their collectors goes to 4 different phases, i can't mount them into a common disipator.  
maybe the problem is the "off" time between steps.  i control the steps with a vector, like this:   
the motor works softly at 200 Hertz ( 5 milliseconds by step)

unsigned int MotordePaso[1,2,3,4];   
for(i=0;i=3;i++){  
**=MotoresdePaso[i]  
Delayms(5)  }      

Delayms(5) is a short function that uses the clock's frecuency to make delays of milliseconds    

**=(entire port that i want to control as stepper's output)     

In this moment i have the other parts to do the 4 h bridges, only 2 burned and broken transistors (luckily), should i change the program to connect the steppers??? 

Sorry, i'm not programming in this moment so i forgot some c++ structure jejejeje  

Thank you so much.
0 Kudos

729 Views
rocco
Senior Contributor II
Hello again Mauricio,

unsigned int MotordePaso[1,2,3,4];  

for(i=0;i=3;i++){  
**=MotoresdePaso[i]  
Delayms(5)  }     

I must say that I am confused as to your step sequence. Without seeing you drive circuit, I can't tell which I/O bits control which phase, but I would guess that your array should be one of the following:

For full stepping, either:
unsigned int MotordePaso[10,9,5,6];      //  1010, 1001, 0101, 0110     more likely
unsigned int MotordePaso[12,9,3,6];      //  1100, 1001, 0011, 0110     less likely

Or for half stepping, either:
unsigned int MotordePaso[10,8,9,1,5,4,6,2];      //  1010, 1000, 1001, 0001, 0101, 0100, 0110, 0010
unsigned int MotordePaso[12,8,9,1,3,2,6,4];      //  1100, 1000, 1001, 0001, 0011, 0010, 0110, 0100

I am assuming that the low four bits of the port control your eight transistors, and the deadtime between turn-off and turn-on is controlled by your drive circuit.
0 Kudos

728 Views
bigmac
Specialist III
Hello Mauricio,
 
You seem to be trying to implement a look-up table in the form of a constant array (stored within flash).  Firstly, the size of each entry should be 8-bit, rather than 16-bit, and the array format you have shown I think is incorrect.
 
To take Rocco's first instance for full stepping, I believe the corrected format should be -
 
volatile const unsigned char MotordePaso[] = {0x0A, 0x09, 0x05, 0x06};    
 
If "deadtime" is not controlled by your drive circuit, and needs to be included within the MCU code, a somewhat different approach would be required.  You would need to control each transistor individually, i.e. a total of 8 control signals.  The size of the lookup table would then need to be extended (doubled) so that between each change of polarity for a winding, there is a state where all four transistors for that winding are turned off.  I would guess that this state should remain for about 5 microseconds to allow the previously conducting transistors to fully turn off.  During this interval, the conduction state of the transistors for the other winding should remain unaffected.
 
If this approach is used, you will need to make sure than, during initialisation of the MCU, there is no possibility that any of the transistors will be driven to a conducting state during this process.
 
Further to Peg's comment about the use of a unipolar stepper motor type.  These will typically be of lower power than the bipolar type, and have four windings with a common connection point to the supply voltage.  The motor can then be controlled by the switching of four NPN transistors.
 
Regards,
Mac
 
0 Kudos

729 Views
mke_et
Contributor IV
Hmm, just a tip.

I learned about stepper motors and how to do them years ago from printer service manual. Back in the Radio Shack LP-V and LP-VI days. Also, stuff like the Shugart and Seagate 8" disk drives. It seems that service manuals back then were almost tutorials about how things worked, as opposed to the 'block in to block out' service manuals you find today.

Some manuals were better than others. Some were terrible. But there were a few that were almost written as if they were a 'designers tutorial' about things worked and what all the tricks were that ended up being incorporated into the design to make them work. The more 'discrete' components the design had the better the manual seemed to be to try to understand how they worked.

I still remember the Radio Shack Model II service manual for FM/MFM data separation for a disk drive as well!

I wish I could remember which printer manual it was for stepper motors that was so good...
0 Kudos

729 Views
rocco
Senior Contributor II
Hi Mauricio,

mauricio wrote:
I forgot to say that i used some protection diodes (3 amps) between  transistor's emitters and collectors.

What type of diodes are they? Often, ordinary diodes won't do the trick. You may need fast-recovery diodes.

If your drive circuit turns the transistors off slowly, then you can use ordinary diodes. The drawback is that the transistors will dissipate energy while they are in their linear region. Another drawback is that it will limit your maximum speed.

If your drive circuit turns the transistors off quickly, then they may turn off faster than an ordinary diode can turn on. The inductive energy stored in the motor winding may cause damage before the protection diodes can do any protecting. You need to insure that your diodes are faster than your transistors.
0 Kudos

729 Views
rocco
Senior Contributor II
Hi Mauricio,

The first three things that come to mind are the same three things that Mac mentioned. To add to that:

How are you driving the transistors? If they are not either fully off or in saturation, they will dissipate a lot of heat. It would help if you could post your drive circuit, specifically how the GP32 controls the transistors. As Mac mentioned, you need to worry about shoot-through (both upper and lower transistors on at the same time), as bipolar transistors typically turn on quicker than they turn off.

Also, your protection diodes and how you switch your transistors are important in controlling the recirculating current from the windings. If not handled correctly, the di/dt can cause voltages many times higher than the 12 volt supply, and take out your transistors.

And now for a philosophical observation: Controlling a stepper motor is not trivial. You typically need to vary the drive current based on what you are doing at the time; a low holding current when stopped, so as to not dissipate a lot of energy, and high current when you need the torque. For higher speed work, you also need enough voltage to quickly reverse the current in a winding at each phase change. You can do a lot of this in firmware, but those stepper-controller chips go a long way toward where you want to be. After building a working drive circuit, you may find that those 28-pins are each worth the trouble.
0 Kudos

729 Views
peg
Senior Contributor IV
Hi Mauricio,
 
This is one of those things where the basic principles are fairly simple but converting that into a reliable working circuit is quite challenging, especially at higher currents.
Google is you friend here, although you have to filter out most hobbyist circuits as they are for unipolar motors.
Actually, perhaps trying to get some unipolar motors might be the go as they are easier to control (less explosions when something goes wrong) and might provide a better start point for you. Any old printer is a good place to look. Google covers this too! (where to find them)
 
0 Kudos