Chopper circuit for steppers

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have designed this chopper circuit. I used a bootstrap circuit using an avr PWM to boost the voltage for driving an NPN mosfet on the high side.

I have on order the IRS2186 mosfet driver i will actually use.

The question I have is how do I keep the Q1 mosfet gate low while the rest of the board powers up. If the Q1 mosfet gate has built up some capacitance and is high initially the load will get a high voltage current spike when initially powered up or at least until the 2n7000 gate goes high and shuts off Q1.

I have a TLP597 ssr N.C. relay i planed to tie to Q1's gate and use the AVR to turn on the circuit when voltages have stabilized. What alternative solutions are available to accomplish this?

I also have on order the TL783 adjustable regulator that has an input voltage maximum of 125VDC to handel up to a 100VDC input. I plan to use this chopper with my own universal stepper motor driver. I have some slo-syn 20 amp steppers 1100oz/lb

There is only 1 sense resistor, I put two spots since I have both through hole and surface mount versions.

I also wanted to mention I used a 10K resistor and a 10uf capacitor to slow the voltage swing down since the comparator was switching faster than the mosfet could switch. Perhaps it would be better to use the AVR comparator and do a specific blank time, not sure about that.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sell your schematics to the Cambridge University Press for their next edition of "The Art of Electronics", namely as an illustration of how to NOT draw a schematics :lol:

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The schematic is completely wrong. Don't even think to use it at 100V.

The 10V power supply for the mosfet should have its "-" connected tot he Q1.source or through a current sense resistor.
As it is now, when you want to stop the motor, the motor voltage could keep the Q1.source at much higher voltage than the gate and you could exceed the Q1 maximum Gate-Source voltage.

Capacitor100u100VDC should be in parallel with the 10V zener diode and not with its "-" at GND. At power up or if the power supply has fluctuations, could burn the zener diode.

If you really want to play with it until will get the real driver then add a P mosfet or even pnp bipolar transistor to drive Q1. Also a diode to protect Q1's gate against negative voltages.

(pity nice pcb, it handle an ugly shematic)
(ah, a big diode for the motor)
(and how will you drive a stepper motor with this schematic?)
(and why don't you put the motor up and Q1 down ?)
George.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can use a special program for drawing schematics like Kicad (it's free) or Eagle.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi George, thanks for taking the time to analyze this you are so kind. I just finished boasting last night to my wife how smart I have become in making circuits. Realize I have zero training in this area and I would very much how to learn to draw schematics correctly, i never thought about actually learning how to draw a schematic correctly, I will have a go at that as well.

If I understand the zener / capacitor potential problem it is that the capacitor has a voltage of 110 volts referenced to GND, if the positive power supply dips well below that the capacitor could discharge through the zener with no current limit and burn up the zener. Is that correct?

I have put the capacitor in parallel so that the inductor kickback will only charge to 10 VDC referenced to VCC.

I have tied the ground of the power supply, the 2n7000 mosfet to the source of Q1 instead of GND.

So the 10V power supply here can't produce anything unless there is a load connected? If I did not connect this as you suggested please show me what you mean. Even though I won't be using this part it is very interesting the concept here you are showing me.

Goes to show you that even if something works well it doesn't mean it is correctly built. This is working very nice at least from 6VDC to 28VDC in driving a 350 ma LED or a single coil at 1 amp. I can dial up the current and it holds at any of the voltage inputs.

This is only the chopper pert of the circuit the stepper driver board layout is from this zilog note. http://www.zilog.com/docs/z8enco...

Remember, nobody makes a 20 amp driver for these old slo-syn motors.

I tried to understand the schematic from this guy but I can't make heads or tails out of it. http://www.dalton.ax/stepper/

So I was poking around the internet to try and understand how one makes a chopper drive for a stepper and this is what it turned out to be.

Very appreciative of the help sir.

Mark

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mbedder, I do have the Art of electronics and I have seen the section on bad circuit designs I just did not realize I excelled in that area!

Slammer, Yes I do use DipTrace but as you can see it allows you to make some horrible schematics as well, I guess I never tried using the right click and tell it to connect the line, perhaps I will try that but there must be some good information on the proper way to go about drawing schematics. I just never tried to learn that part of it, yet...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Those traces on the PCB seem close. May need a larger mill bit for spacing at high voltage.

The mosfet driver is the way to go.

I sometimes use an isolated DC-DC converter to supply the bootstrap circuit. It permits full duty-cycle operation.

It all starts with a mental vision.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

metron9, try to allocate the mosfets better and place the other driving parts near them. Move away to a different area the power supply circuit. These steps will make huge improvement in your design.
See this for example
http://robotechno.us/high-curren...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can someone give me the idea behind chopper drive? Is it: hit the 3V stepper coil with about 24V for about 5 of the coil L/R time constants, then change the duty cycle so the holding current is about 1.5V?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I understand the chopper drive at least the way this circuit works is the coil is given full voltage to charge the coil as fast as possible. When the sense resistor hits a determined voltage the current for the coil is at it's maximum and the fet turns the power source off. In this design the comparator continues to operate and when the voltage drops below the set value the voltage is turned back on.

The other method of course being a resistor in series with the coil. The mosfet i am using will get plenty hot though so I don't know the efficiency difference between a good chopper drive and resistors, both generate quite a bit of excess heat.
My gecko driver can run plenty hot with 3 of the 3 amp steppers but they say it can run quite hot, I heat sink it and cool it with a fan and it's a chopper drive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So Chopper means it chops the current off, not PWM drive. Always wondered about that.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The mosfet source driven by the AVR, must be connected to ground. Replace the resistor on its gate with a resistor 100ohm for example.
You can increase the boosted voltage generated from 10 to 15V.
Make sure to use an appropriate duty cycle and frequency coming from AVR. It depends on the voltage that the inductance is driven, and the energy you take to drive the main mosfet. Avoid to saturate the inductance, it could blow up the mosfet very easy.

I suggest:
- to add a Pchannel or pnp bjt transistor connected as follow:
- source (emitter) to 10 - 15V boosted voltage through a resistor to avoid saturation
- gate (base) to a resistor divider driven by the lower side mosfet (from comparator). The resistor divider from up down: 10V boosted voltage - gate (base) - low side mosfet drena'
- drena (collector) to the main mosfet's gate, through another resistor divider that will end on the main mosfet's source
- add a big, fast enough diode between main mosfet source and ground (anode to GND). This will avoid the mosfet to stay on and act as a resistor when it is turned off, so will take a lot of heat from the mosfet, energy that will mainly be used by the motor as should be.
These additions will avoid the mosfet to be turned on at power up, and will drive it much cleaner, and will reduce the heat dissipation.
You do not show all schematic, so make sure if the resulting frequency that the motor will see, if ti exceed few kHz, add some hysteresis to the comparator so for example will turn the mosfet on when the motor current is less than 1A and off when more than 2A.

George.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Driving a stepper with higher speeds requires the use of higher voltages than the stepper was designed for if driven in constant voltage mode.

I have been trying several different approaches with and without using PWM from the MCU. The result was always limited speed and some component getting hot - usually the stepper motor.

Then I decided to try out constant current. This is quite easy to make using a current controlled PWM controller. Actually these are constant current sources when driven beyond their power limit. The limit is adjustable by the current sense resistor.

So, the result was that when the stepper is advancing slowly it receives constant current but when the speed is higher the stepper receives higher voltage as the current is lower. I could drive the stepper over 1kHz without any difficulties - wow !

One cannot just go to that sort of speed instantly - the stepper must be accelerated gently so it won't start "rattling" and to allow the voltage to raise. This requires some cumbersome programming. Stopping is easier - lot easier :)

I actually created a page for my haywire projects - this is the first of those.

Projects page

Edit: Added this post to create an alternate viewpoint on driving steppers. Schematic.pdf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

eskoilola:
Driving stepper motors is not a new science and I would say the technology involved is far more advanced that we, here at avrfreaks are talking and will be able to develop through sharing schematics, test results and thoughts.
You seems to be very happy about your new schematic / approach, but it has some serious limitations, some of them described by yourself.
Reading your post, and looking to how you have the microcontroller connected to drive the mosfets, I suppose you do not use pwm, but simple phase switching (correct me if i am wrong). This means that at low speed, or stall position the bus voltage is low. Nothing wrong so far. Using same current, this means that the current through the coils is increasing and decreasing slowly because low voltage. Now you want to accelerate. The flyback have to power the motor and to charge the electrolitic caps which takes time. This is the reason your motor would not accelerate fast. Those capacitors are way too big. And these capacitors are the reason you can stop the motor fast, because you will almost reverse the voltage to the motor and there is nothing to limit the current while to discharge the caps.
The loop: mosfet, motor coil, capacitors has no short circuit protection. When at high speed, with high voltage on the capacitors, if a short circuit between the wires to the motor happen, something has to blow up - likely the mosfets. Unacceptable.
You get it complicated with no reason. A step down converter would be much efficient than a fly back one. The transformer on the flyback converter has to carry all the power to the other side. A step down converter could run in continuous mode with a much smaller capacitor giving you a faster response, smaller inductor, short circuit protection. You only need to step down the voltage and no isolation needed.
Regulating the bus current and not each individual winding current, will make half stepping problematic. When half stepping, you would need 70% of nominal current to each phase, but you will get only 50%. Micro-stepping, out of discussion.
What you could do is to use a pwm, let say 50% at low speed and stall, and let the bus voltage to rise a bit. Then when you want to accelerate, increase the duty cycle, there will be enough energy ready in the capacitors, giving you shorter time for the motor current to increase and to decrease.
I notice you connect many I/O to GND. I find it a little dangerous. A glitch in the software could be problematic. I prefer to set unused I/O as inputs with pull-up resistors activated.
I would use PWM, variable bus voltage (not current) 40 - 100% and controlled by microcontroller, connect all mosfet source together and to GND through a current sense resistor for average current monitoring, over current and short circuit protection.
See OP's approach, self regulated switching current source, will respond instantly to accelerations. No need pwm from uC. Same mosfet is doing the pwm and phase switching. No fly-back, no transformer.
By the way, there was a recent thread where someone had problems by connecting mosfet gate directly to the uC pin. A resistor is not that expensive and big.
George.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Every time I hear folks talk about accelerating a stepper, I get confused. A stepper accelerates from zero, then decelerates back to zero on every step. If you mean 'ramping', that's a lot trickier. You have to take the next step right in the middle of the first step. Like the 2nd stage of a rocket. And do this a half dozen times, each time faster. Now you are really stepping. Hey! Where are the brakes on this dude?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"A stepper accelerates from zero, then decelerates back to zero on every step"

In full step mode that is essentially correct however it is the body in motion tends to stay in motion theory that is at work here. Powering up the next set of magnets to move the stepper forward from a dead stop is much different than a motor that has forward momentum. A running stepper motor does not stop at every step when running faster but from the stand still point it takes time to produce that inertia.

http://www.youtube.com/watch?v=i...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Naaah. If you are issuing 250 steps per second, 4ms per step, its speeding up for a ms, slowing down for a ms, and boinging back and forth against the magnetic field for about 2ms. To ramp it up, you need to change the magnetic field right at the top of the acceleration at 1ms. Otherwise, it stops after every step. Maybe you think its running at any step rate above about 30 steps a sec because of persistance of vision? You accept that motion pictures are actual sequences of still photos dont you?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

angelu wrote:
eskoilola:
Driving stepper motors is not a new science and I would say the technology involved is far more advanced that we, here at avrfreaks are talking and will be able to develop through sharing schematics, test results and thoughts....

Thanks for the thoughts and the effort on answering - it is never too late to learn new things.

The stepper controller is the #5 of series of experimenting with different approaches. So, Yes, I am quite happy with it.

The short circuit protection works just fine. The flyback supply - which is actually a constant power source (not constant current as I stated earlier - sorry about that) takes care of that. I have tested this circuit by actually shorting the stepper. The 4 power fets are "big enough" to take the current plus the discharge from the 200uF cap.

You have it right - I did not use PWM to switch the 4 power fets - that would make the flyback supply sort of obsolete. I have tried to use PWM to control the current through the motor coils but that stops working well if the motor is stepped above 500hZ or so - depending on the mileage of the MCU -> depending on how high PWM frequency is obtainable. So I decided to set up current limit othervice.

Driving a mosfet with MCU pin directly is allright. However, it requires some attention on PCB design and safety measures against inductive spikes as the FETs turn on/off. That is why there are the shottky diodes around. Yes, a 22ohm or so resistor would make that part a tad easier and would not cost too much.
In addition to the inductive coupling there may be voltage spikes originating from the gate-drain capacitance. This is mostly cancelled by the gate-source capacitance but it may exceed the MCU VCC. The shottky diodes protect also against this.
The third use for the shottky diodes is the ringing on the gate. They dampen this and eliminate false connections. Again the 22ohm resistor would propably be the thing to be here.

Having current sensing on the FETs cause problems as the voltage across the current sensing resistors will add to the gate voltage. This in turn is propably the source of trouble if the gate is driven directly by MCU I/O pin. In this case the 22ohm resistor and a shottky diode protection is a must. Having all this in place adds to the complexity and actually - very little is won. That is the reason why the current sensing is absent.

The acceleration of the motor is important because of the inertia in the load. One can set a flexible connection between the motor shaft and the load to partly eliminate the inertia effect but that has limits too. In my case the inertia was neglible because of the gear.

The acceleration - which was quite complex codevice - is there mainly to make this smooth to handle. This is an adjustable capacitor for transmitter tank circuit. It is adjusted by a control voltage which is converted into capacitor rotor position. It is a lot easier to plant a potentiometer on the front panel of the transmitter than having the mechanical alternative.

The nice thing here is that nothing is getting hot. The flyback FET has increased temperature - I measured 40 degrees celsius at room temperature. The motor has also some fever. Other than those the devices run cool.

Summa summarum:
Gate resistor: Yes
Current sensing: No
PWM: No

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To the original author of this thread (to not to hijack this)

If a FET is getting hot this usually means that it is not properly switched on/off.

Your circuit seems to be a current limiter for some system - in this case the system is a stepper motor. I suppose that the intention is to switch the Q1 off when current approaces a certain value and turn it back on when under the value.

The circuit around L1 is there just to get enough voltage to the gate of Q1 to turn it fully on.

Some things that may happen here:
- The gate-source voltage of Q1 can exceed the maximum allowed to the device causing a catastrophic failure (gate insulation breakdown). This may happen if the load is inductive and there is a positive spike incoming to output or if the load is capacitive and the gate is forcibly pulled to the ground.
- The Q1 is used in half-analog mode. This is why it is getting hot.
- You have always voltage near VCC in the 100uF capacitor - making me doubt the purpose of the L1 circuitry

I'd say the circuit does not work - at least not the way the intention was.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well it only took me about three hours to figure out the irs2186 actually works. I had put the chip on the breadboard and just used a wire to pull the input high side driver up and down by grounding it. Finally I decided to use a pulse generator and bazinga the 12VDC input popped right up to 24VDC to drive the mosfet gate.

Oh first i connected up all the pins wrong as the datasheet shows the pins scrambled on the schematic drawing, has a note too about referring to the lead assignments.

Still not sure how to calculate the correct capacitors but I used a 1.0uf and that works. Using 10 ohm resistor to mosfet gate, found that on another post out in google land.

Now I can finish playing with that chopper drive and I hope i can make a reasonable schematic to post before making the board prototype.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I tried to understand the schematic from this guy but I can't make heads or tails out of it. http://www.dalton.ax/stepper/

What exactly is it that you do not understand? :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess I did not try too hard to follow the schematic because i can't print it out big enough to see it without a magnifying lens of 6x or more.

I can't find the app note for the l297 and 4011 (I see the 4011 is some kind of counter chip)

Since you offer help with it, I will try and print it out an a bigger piece of paper so I can actually see it and then read the datasheets on the 4011 and l297.

I really don't understand how the chopper works from this schematic.
It looks like instead of having a 5th mosfet that chops the current from the high side of the stepper coil it has a sense resistor going to the l297 and the l297 chops the current by cutting the drive to the 4 mosfets drivers on the low side.

I guess i am just not understanding the chopper circuit.