erikc wrote:
>
> /* Why are you returning the LM339 output to +12V when
> everything else is +5V? LM339 is happy with +5V.
> One other suggestion: Place a 120R resistor in series with
> the FET gate. This suppresses oscillations. */
>
> /* Why are you returning the LM339 output to +12V when
> everything else is +5V? LM339 is happy with +5V.
> One other suggestion: Place a 120R resistor in series with
> the FET gate. This suppresses oscillations. */
Some FET requires a little
bit more "push" than just 5V to turn on.
The 1k pullup to 12V is just
to make sure "any" FET would work in this configuration.
I imagine the situation where
the IRLZ24/34/44 would be difficult to find as replacement, and the technician
just insert a IRF530 (as posted below). 5V pullup at the gate can fire
many of the IRLxxx FETs but not many of others. I have seen several FETs
not firing even VGS high as 6V. Sometimes is not just the voltage but the
kick of it. How fast the pullup can fill the capacitive charge of the FET
gate. Using a lower resistor value instead of R1k when connected to 5V or
just pull higher voltage at that pullup can solve both situations, higher
voltage and faster charge.
>
> +AVRDrive +5V +12V +5V
> -------. | | |
> | | | |
> R10k | R1k COIL
> | |¯¯¯¯¯| | |
> 300mV o-----(+)| | | |--' IRF530
> | | LM |---o---|--. IRL530N
> R620 | 339 | |<-| IRLZ24
> | .-(-)| | | w/clamp diode
> _|_ | |_____| |
> | |
> '---------------------o
> 300mV |
> R0.05
> ; |
> _|_
>
> R620 could be a trimpot adjusting full span current of 6A
> over R0.05.
> One LM339 houses 4 comparators, so one chip per unipolar
> motor (4 phases & FETs).
>
> /* So you're going to have 4 trimpots? */
Not really, the current limit doesn't need to be that precise. Limiting at
5.9A or 6.1A will not change that much in safety for the transistor or the
motor, not even for the power supply. The trimpot idea is just in case to
find out the better R620 value. Sometimes the problem is not with the
voltage divider R10k/R620, but mostly with the R0.05 part and connections.
A not so good soldering or terminal oxidation can change easily those tens of
milliohm and that will be a problem. Those expected 300mV can change
drastically to 400mV with a simple increase in 20 milli ohm in the shunt
resistor. Then, beign prepared for the worst, I guess a R1k small trimpot
in place of the R620 is not that bad idea. So, answering, yes, probably
will have 4 trimpots per motor.
>
> Any known dedicated IC to substitute the LM339 with
> advantages?
>
> /* LM339 is OK. This might also work and you only need one
> trimpot and fewer resistors:
> AVRdrive must be high at the same time the comparator is
> turned OFF for the FET to turn on.
>
> +AVRDrive
> |
> +5V | +5V +5V
> | | | |
> | | | |
> | 1k0 COIL 10k
> |¯¯¯¯¯| | | |
> Vref-----(+)| | | |--' IRF530 |
> | LM |---o--120R--|--. IRL530N o---Vref
> ; | 339 | |<-| IRLZ24 | (4
> places_
> +-(-)| | | |
> | |_____| | |
> | ; | 1k0<-----o
> '--------------------------o ; | |
> | | |
> R0.05 _|_
> _|_
> |
> _|_
> */
> Any known dedicated IC to substitute the LM339 with
> advantages?
>
> /* LM339 is OK. This might also work and you only need one
> trimpot and fewer resistors:
> AVRdrive must be high at the same time the comparator is
> turned OFF for the FET to turn on.
>
> +AVRDrive
> |
> +5V | +5V +5V
> | | | |
> | | | |
> | 1k0 COIL 10k
> |¯¯¯¯¯| | | |
> Vref-----(+)| | | |--' IRF530 |
> | LM |---o--120R--|--. IRL530N o---Vref
> ; | 339 | |<-| IRLZ24 | (4
> places_
> +-(-)| | | |
> | |_____| | |
> | ; | 1k0<-----o
> '--------------------------o ; | |
> | | |
> R0.05 _|_
> _|_
> |
> _|_
> */
Yes, the above is an idea.
I used something similar with the Alegro 2398 part, a common Vref supplied
by a trimpot and 339 comparing and feeding the enable/disable pin of the 2398s,
the AVR drive comes via the 339 releasing the feedback signal. Implementing the
idea in this circuit, to block the motor, the AVR simply overflows the feedback
with 5V (4.3V) and it cuts completely the FET.
+5V
+5V +12V
+5V
| | | |
| | | |
R10k | R1k COIL
| |¯¯¯¯¯| | |
0.3VREF o-----(+)| | | |--' IRF530
Common | | LM |---o-R120-|<-. IRL530N
>R1k | 339 | |--| IRLZ24
| .-(-)| | | w/clamp diode
_|_ | |_____| |
| |
(XA)o---------R10k-----------o
; _|_ ; 300mV |
A 1N4148 |
-AVRDrive | R0.05
| | | |
| | | |
R10k | R1k COIL
| |¯¯¯¯¯| | |
0.3VREF o-----(+)| | | |--' IRF530
Common | | LM |---o-R120-|<-. IRL530N
>R1k | 339 | |--| IRLZ24
| .-(-)| | | w/clamp diode
_|_ | |_____| |
| |
(XA)o---------R10k-----------o
; _|_ ; 300mV |
A 1N4148 |
-AVRDrive | R0.05
o----------'
|
_|_
_|_
Here, the LM339 will cut the FET whenever it feeds more than 6A to the
COIL, or when the AVR supplies a positive level to the (-) pin via de
diode. The only bad part here is to ensure that at power on, before the
AVR resets and assert the Drive port pins, the motors stay not running
erratic. One way to do that would include an extra "NotErratic" circuit,
that will be connected to the (X) point at the above circuit.
Perhaps a general "+MotorHold" circuit like that:
+5V
|
|
R2k2
| 1N4148
o---->|---o Phase XA
|
o---->|---o Phase XB
|
o---->|---o Phase XB
|
o---->|---o Phase XC
|
|
o----'
+AVR_MotorHold
The problem is related to the fact that during RESET, the AVR takes its
port pins to high impedance state, and that will not take XA point to +5V to
ensure motors holding. They can run erratic. They will not run erratic if
all phases will suck power at the same time, but anyway it is not desireable to
have 24A being pushed into each motor for few moments. What about if the
AVR got stuck during reset? Will have a bad power supply soon enough.
The +AVR_MotorHold above applies aprox 3.4V to XA (XB, XC and XD) whenever
the AVR is offline (port pins in high impedance). It means the FETs will
be cut as long as the AVR does not supply a negative level to the
+AVR_MotorHold. As soon the AVR feels it is safe to release motor
operation, just apply a negative level to +AVR+MotorHold, and everything will be
ok.
That means, each motor will require:
4 x IRLZ44 or similar FET units
4 x 1N4007 (clamp diode)
1 x LM339
8 x 1N4148
1 x R1k
1 x R120
1 x R0.05
1 x R10k
The common VREF being made with;
1 x R10k
1 x R1k Trimpot
Or an extra 1N4148 and a R divider to
ensure better VREF stability.
You see, initialy it seems to be few components, but then, when thinking
about everything (and something will always be missing) the coponents population
increases significantly.
This is why I thought to use some ready made FET gate driver circuit with
current limit and everything else, like enable, input, pwm counter, etc.
Wagner.