| Author |
Message |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
05 Jul 2005 4:34 l297 vref |
|
|
|
|
good day... too many question to ask... please help...
this is the data sheet i need help on
http://www.st.com/stonline/books/pdf/docs/1334.pdf
| Code: |
| The L297 integratesall the control circuitry required to control bipolar and unipolar steppermotors. Used with a dual bridge driver such as the L298N forms a complete microprocessor-to-bipolar stepper motor interface. Unipolar stepper motor can be driven with an L297 plus a quad darlington array. This note describes the operation of the circuit and shows how it is used. |
i hav few questions... please help... i am using it to control 2 phase variable magnet bipolar stepper motor
1. could anyone explain to me wad is the purpose of OSC pin?.. i know it is stated as chopper rate... anyone know how to explain this using more simple term?...i dunno wad is chopper even though i read many time the data sheet D....
wad is the value for the RC circuits,,, wad is this for... n wad value i can use,, any?
2. wad is the control pin for??... it stated either to act on A,B,C,D or /INH1/2 faint:)
3. wad is tht /INH1 and /INH2 for?? should i use it if i just wanna control the stepper motor. please explain on this 2 pin,,, i am really headache read over n over again wthout any understanding on this...
4. and how about the SENSE1 and sense2 pin....wad is tht also...
5. how fast the frequency of the step clock can i input to the /clock pin of the L297.... does it depend on the stepper motor i use?...
6. for stepper motor, which part of the data sheet i should refer in order to know how fast the step/clock i can use wth the motor from my controller??
i would b grateful if anyone can help... u can answer part or even one question if u r really busy... any will help....
many many many thanks... in advance...
my warm regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
05 Jul 2005 16:34 l297 home |
|
|
|
|
1. The IC has a 'protection' mechanism that is triggered (activated) when the current exceeds a certain level (as measured by Sense1/Sense2 and compared to Vref). What happens then is that the output switches off. It is then restarted a certain time later (determined by the chopper rate, which is set by the OSC pin). This mechanism is then repeated over and over.
This basically means that, when this switching off and on again happens, that the (stepper) motor is driven by a constant current (the current sensed by Sense1/2).
The timing of this chopping is set by the resistor/capacitor value. The frequency is 1/(0.69 * R * C). With the 22kOhm and 3.3nF in the sample application this would result in a frequency of 20 kHz.
2/3. The control pin determines if either the ABCD outputs or the inhibit outputs are used to switch off the driver. Typically the inhibit outputs place the driver in a floating situation, whereas the ABCD would switch it off actively (this all depends on the driver used). In a 'floating' situation the motor keeps it's momentum, and in the active off situation the motor is being 'braked'.
4. The sense pins are used to measure the current flowing through the motor windings. This is done using a series resistor.
5. The clock input does depend on the stepper motor used. A stepper motor can only go at a certain speed before it looses torque etc. A stepper motor is typically accelerated to it's speed (if a high speed is the goal). For slow speeds no acceleration is typically needed.
6. I don't know what parameters are given in a typical stepper motor datasheet, but I think you should have a look at the steprate. There is typically a curve with the steprate versus torque (or something simular).
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
06 Jul 2005 5:51 l297+r sense |
|
|
|
|
thanxs Marcel Majoor... ur help is really appreciated n informative.... anyway, i pressed the helped button... thanks
for question num.1 so wad is the best chopper rate?... the higher the better??...
for question num.2 and 3... do u mean tht the control pin is use to select the switch off mechanism only?... b4 reading ur help... i was confuse as we would always use ABCD to control the motor... if use INH1/2.. how to control the stepper motor?..
so the bottom line is tht this CONTROL pin is use to control the motor behaviour when no clock step are input to the driver(switch off)... am i correct?
for question num.4... the sense resistors..y it use 0.5ohm?... 10ohm will works?... wad is the selection of the value?
for question num.5.....if i use 1MHz.. will the motor works?... how to determine the max frequency? Marcel Majoor mentioned tht the motor will losses its torque... i tot when frequency too high... the motor willl stall....
thanks again and again.... i m grateful
my warm regards,
sp
|
|
| Back to top |
|
 |
Fragrance
Joined: 26 Jul 2002 Posts: 1385 Helped: 24
|
06 Jul 2005 7:09 l297 clock |
|
|
|
|
hi
here is the simulation cicuit fOr L297 how it works
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
06 Jul 2005 11:53 stepper motor controller l297 |
|
|
|
|
thanxs for reply,,, could u make it more easily to read,, like pic,,,
bcos my pc hav no much space left for me to install orcad capture...
hope other will continue help answering my question... grateful
thanxs,,,
regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
06 Jul 2005 16:28 vref l297 |
|
|
|
|
A higher chopper rate is not necessarily better. A low frequency is typically 'worse' for our ears (audible range), so this is one reason to choose a frequency like 20 kHz. If the frequency is too high then, (guessing), the current limiting becomes less effective (the motor windings are a coil ... ..).
When the (over)current becomes active the output (ABCD or INH1/2) are -momentarily- switched off (one cycle of the chopper frequency). The control pin only select which of these will be chopped (either ABCD or INH1/2). This has nothing to with the normal operations of the device. You use the device as you would normally use (just assume this current regulation mechanism does not exist). The control pin ONLY defines the action taken during 'protection' and not when no step signal is being generated.
Note: You don't need to use the current regulation feature of the device. If you don't use any sense resistors and short the sense inputs of the device to 0V then no chopping will be used at all. In that case the device only translates the clokc/direction inputs to an ABCD output sequence.
The (sense) resistor value is based on the the current 'protection' level you want. The current through this resistor generates a voltage which is 'sensed' by the L297 (Sense1/2). If the L297 protection level is set to 0.5V (Vref input) then the maximum current allowed through the motor winding would be 1A with a 0.5 ohm resistor. With a 10 ohm resistor this would be 0.05A . So, the selection is based on the allowed current through the motor winding and the Vref you are using. A typical VRef would be 1.2V (using a 1.2V reference 'zener'). If you require a maximum current of, for example 0.5A, then your resistor would be 1.2V / 0.5A == 2.4 ohm
With 1MHz the motor will definitely not run. With every clock signal the motor moves from one position to the other. The motor has to have time to move to that position before you should generate the next clock signal. It has to overcome it's mass and any inertia present. I think a few hundreds herzt as a maximum frequency is probably a very high value (and you typically have to accelerate to the maximum possible speed).
If the clock changes too fast, the motor just does not have time to move to the next position and, hence, will not move (or very slow/obscure).
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
06 Jul 2005 18:57 l297 chopper frecuency |
|
|
|
|
thank you Marcel Majoor for all the help... i am really grateful... u almost clear all my doubt,, now it is turn for me to try out myself,,,
anyway... wad is the frequency hav to do wth ear?.. or u mean analogy...
as for the ABCD and INH1/2.. i think i get it finally,,,, however, which one should i use,,, ABCD or INH1/2?? i mean i should set wad to control pin,,, which one is more preferable?...
i am connecting the Vref to my +5V... should it ok,, bcos i want max peak current,,, if i use 0.5ohm so 5V/0.5ohm= 10A... so will this 10A too large n burn some of my part?..
another one would b how i know wad is the max step my stepper motor can support... i buy from an electronics shop n the guy dunno anything bout it... the motor length is 2cm including the head come out from the motor and the diameter is bout 2.5cm... n it has 4 wire(red yellow blue brown...i dunno how to connect this also).. any idea?
thank you again,,, i really dunno how to express my gratefulness
regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
07 Jul 2005 19:32 l297 c source |
|
|
|
|
The frequency at which a motor (or a switching power supply for that matter) is controlled has a lot to do with the human ear. The switching of the motor (or chokes/transformers in a swtching power supply) do generate an audible sound (as if they were speakers). 'Users' don't like to hear a continuous noise coming from an electrical circuit or motor. That is one of the reasons why a frequency higher than audible for the human ear is generally preferred. Obviously there are also other reasons for selecting other frequencies, but this is just an, obvious, one.
I think you just experiment to decide which one (ABCD or INH1/2) is better. Using INH/2 reduces the dissipation in the sense resistors so this might be an obvious choise. But, it mght be that the motor runs better using ABCD-control instead of INH1/2-control. You just have to experiment.
Don't connect Vref to +5V. The maximum input is 3V!!
If you are using the +5V then at least use a resistor divider. For instance, put two 10 kOhm resistors in series and connect the ends to the 0V and +5V. The center connection then goes to the Vref input, which should be about 2.5V then (I assume the input impedance of the Vref input is relatively high).
Depending on the motor you use (and/or the capabilities of the driver/output drive), you have to set the current. You have to look at the specificatiosn of the driver and/or motor to find out which is an absolute maximum allowed current. Then set your 'protection' somewhat lower (75% ??).
If you are using the L298 as a driver, then this one can drive a maximum (!) current of 4A. The continuous current for this device is 2A, so in this case you would set the 'protection' to 2A (2.5V/2A = 1.25 ohm).
Figuring out the connection for a stepper motor should be not to difficult, but be aware that their are different type of stepper motors. Unfortunately I don't have the information by hand on how to find out the connections.
For the maximum speed concerned; this can be determined by experimentation. By slowly increasing the speed (clock frequency) you should easily be able to determine at which speed it still runs correct and at which it does not (be sure to connect the mechanical 'load' to the motor when testing...)
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
08 Jul 2005 5:47 limit curent l297 |
|
|
|
|
dear Mr. experience,
thank you again,,,, but my question continue,,,, please b patient wth me.... hehehe
| Quote: |
Don't connect Vref to +5V. The maximum input is 3V!!
If you are using the +5V then at least use a resistor divider. For instance, put two 10 kOhm resistors in series and connect the ends to the 0V and +5V. The center connection then goes to the Vref input, which should be about 2.5V then (I assume the input impedance of the Vref input is relatively high) |
fortunately u mention it... i tot 5V would b ok,,, how u know maximum is 3V??
if i use voltage divider...will it increase the losses too much as current may flow in any condition?...
for this paragraph....
| Quote: |
Depending on the motor you use (and/or the capabilities of the driver/output drive), you have to set the current. You have to look at the specificatiosn of the driver and/or motor to find out which is an absolute maximum allowed current. Then set your 'protection' somewhat lower (75% ??).
If you are using the L298 as a driver, then this one can drive a maximum (!) current of 4A. The continuous current for this device is 2A, so in this case you would set the 'protection' to 2A (2.5V/2A = 1.25 ohm). |
for the absolute maximum I for L298,,, i look at the data sheet but i only can find the "TOTAL DC CURRENT UP TO 4 A" at the intro on the front page of the data sheet... i cant seems to find it inside the data sheet... which specification mention the max allowed current?
this i just wanna make sure... for 75% of 4A... it should b almost 3A.. why u mention 2A??
hope i am correct assuming "(2.5V/2A = 1.25 ohm)" is to find the sense resistor...no???.......... (and if Vref can support 5V... and i want 3A... so 5V/3A = 1.6667 ohm.. so i find my sense resistor... yes?)
i think i start to understand tht the sense resistor is to cutoff the current when it is over the limit set by user...for "2.5V/2A = 1.25 ohm" the max current is 2A... over then it is cut out....correct??
if the L298 can support 4A but my motor can only support 2A.. is it ok to just use 4A?...or this maximum current is depend on the voltage n load condition (ohm's law) so it doesnt matter....
wad i mean is tht the max current is not a constant current supply to the motor,,, it is just the max current available tht the motor can eat up (if the motor request more than 4A, the L298 will say sorry; and if the motor request less, L298 supply less).. am i correct again??
the last part u teach how to find the motor max speed,, it is brilliant...
thank you Marcel Majoor and everyone helping ... thanks lot.... really grateful..
(when u think u solve a problem, u might just create another, so many question really hav to ask... i am in doubt)
my warm regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
08 Jul 2005 9:35 l297 problems with cw |
|
|
|
|
The absolute maximum of 3V can be found in the datasheet of the L297. It is a simple as that. Look at page 7 of the datasheet, electrical characteristics of the Vref input - min 0V, max 3V .......
Thus, never put 5V on the Vref input. This might (will) destroy it!
The sense resistor calculations are based on the law of Ohm: U = I * R, so calculations are simple, assuming you know the Vref you decided on (< 3V !!) and you know the maximum current you want to allow.
The sense resistor is not used to cutoff the current directly (although it -will- limit the current flowing based on Ohms law), but the sense resistor is used to measure the current flowing through the motor winding. This is done by converting this current into a voltage (by means of the sense resistor). This voltage then goes to the sense input of the L297, where it is compared with the Vref voltage. If it is higher, then the driver outputs (ABCD or INH1/2 depending on the control input, you remember) are temporarily switched off.
A voltage divider always draws some current, but the current depends on the resistor values choosen. With 2x10kOhm this would be 5/20000 == 250 uA which is negligible . Even if you have to use 1KOhminstead of 10kOhm this would still be 2.5 mA, which should be no problem for the +5V power supply.
Instead of a voltage dvider you can use a voltage reference IC (e.g. which generates 1.2V or 2.5V). This makes the Vref more stable, but these devices also draw some current ....
On page 2 of the L298 datasheet themaximum rating are also beding shown. There is also additional data (under 'Peak output current), like 'Non repetative', and 'DC'. This 'DC' is the allowed current when the device is continuously on
The reason for 2A is that you typically want to be in the safe 'area' of the device. This is, at all times, 2A (assuming the devices is being cooled the way it should). Thus if you use 2A as your 'protection' base (disregard the 75% in that respect) then you should be fine. Don't try to draw 4A out of the device. This is an absolute maximum .... Even 3A is only allowed 'Non repettive'.
Thus, use 2A as the 'protection' in your design (note: this 'protection' is then only used to protect the L298 driver - if the motor has a lower maximum current then you should design for that limit).
BTW: It is the L297 which limits the current (by the chopping mechanism), based on the sensed voltage and Vref. The L298 does not limit the current in any way.
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
09 Jul 2005 3:04 l297 simulation |
|
|
|
|
sorry... i was looking at the application note of the L297,,,, tht's the prob... sorry...
thanks again,,,Marcel Majoor... i press the helped anyway...
if i am using 2.5V (voltage divider)... i can't use 0.5ohm as it shows in the data sheet for R(sense).... if i want to hav 1A... so R(sense)=2.5V/1A=2.5ohm... correct?...
anyway... could u tell me bout the clk timing... as u can c from the bellow pic... y the tclk time is just on the low pulse,,,, wad it means?..
if the tclk is shown... can we determine the clk period??....i think this is the fastest posible clk pulse allowed....
it seems like u are teaching me how to understand the datasheet....hehehe
Thank you.... i am grateful....
my regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
09 Jul 2005 9:56 pull up l297 |
|
|
|
|
The 2.5V/2.5 ohm == 1A is correct.
From the 0.5 us in the datasheet you could conclude that the (max) clock is 1 MHz (0.5 us low/0.5us high signal).
However, you should not be bothered about this, because this maximum is far (and I mean faaaar) beyond the capabilities of the steppermotor. Assuming you have an *ideal* steppermotor, only then you would we able to run at this frequency. Simple calculation dictate then, that with 1 Mhz, the steppermotor will do 1000000 steps/s. Assuming you have a stepper motor with 250 steps/revolution this is 4000 rotations/s == 240000 RPM ........
Unfortunately we don't deal with an ideal stepper motor so the maximum frequency you will actually be using willbe in the few hundreds Herz ... (just guessing here).
The L297 'steps' on the rising edge of the clock input.
The 'setup time'/'hold time' and such you see in the datasheet means that you can't (should not) switch the other signals at the same time as the clock signal. They need to be present a certain amount of time before the clock signal is activated, and need to be present some time after the clock signal is removed. Typically you don't have to bother about this at all, since these signals (CW/CCW/HALF/FULL) are fixed level signals. You don't change them all the time. Only the CW/CCW signal is changed, for changing directions, and an 'incorrect' timing would only mean that you would do one or two false steps.
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
05 Aug 2005 10:49 what is clock in l297 |
|
|
|
|
sorry for asking again... need help on the "HALF/FULL_NOT" pin
as listed on the L297 DS... as bellow...
| Code: |
Half/full step select input. When high selects half step operation,
when low selects full step operation. One-phase-on full step mode
is obtained by selecting FULL when the L297’s translator is at an
even-numbered state.
Two-phase-on full step mode is set by selecting FULL when the
translator is at an odd numbered position. (The home position is
designate state 1). |
there are 3 type...half step op, One-phase-on full step mode, Two-phase-on full step mode...
the half step is ok, just set the "HALF/FULL_NOT" pin to '1';
however, for the "One-phase-on full step mode" and "Two-phase-on full step mode" how to select one of it?...set the "HALF/FULL_NOT" pin to '0' and the 2 mode depend on your luck??????? like it mention there it depend on the translator state, can the translator state b controled?..
hope someone can help....
many many many thanks...
regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
05 Aug 2005 16:56 l297 y driver de 10a |
|
|
|
|
You have to know the state the L297 is in. This can be detected using the HOME output of the L297. When this output is active you know that the L297 internal controller is in state 1. Once you know this, and because YOU control the steps (clock), you also know in which state the L297 (should be), and when to switch to the correct FULL STEP mode.
Note that you should do this 'synchronization'/'detection' in HALF STEP mode, since in this mode all states are 'used'.
You can also use another approach. When you set the FULL STEP MODE then the HOME output is activated only when the NORMAL DRIVE MODE is active. The HOME output is not active when WAVE DRIVE MODE is active. Thus, set FULL STEP mode, do 4 or more steps and when the HOME was activated then NORMAL DRIVE MODE is active. If this is NOT the mode you want then switch back to HALF STEP mode, do 1 step, switch to FULL STEP mode and check again. This time it should be the correct mode.
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
06 Aug 2005 7:45 différence osc ou clock l297 |
|
|
|
|
wow! u are great... thank you....
from wad u say... so the full step mode cannot b control using mechanical switch as the motor move so fast...
so it would only feasible to control it using the controller....
actually yesterday nite i already can run the stepper motor,,, but one prob is the cw/ccw_not... i change to ccw using switch... but the motor doesnt wanna change direction,,,
thank you again...
warm regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
06 Aug 2005 9:39 what is chopper l297 |
|
|
|
|
The FULL STEP mode can be controlled by mechanical means, but you still need some logic to make sure the correct full step mode is switched on.
OR .... if you also use the RESET input then you know that, after a RESET, the controller is in state 1 ('HOME').
So, using the RESET input of the L297 you can also set the correct mode, without using the HOME as feedback.
NORMAL DRIVE MODE: set HALF STEP mode, activate RESET, de-activate RESET, set FULL STEP mode
WAVE DRIVE MODE: set HALF STEP mode, activate RESET, de-activate RESET, do one step (1 clock cycle), set FULL STEP mode
Changing directions is typically done at 'zero' speed of the motor. If you use a mechanical switch make sure that is (preferably) debounced, and that you swith from one level to the other (switch-over contact). Alternatively you could use a make or break contact switch (instead of a switch-over) and use a passive resistor (10k) to +5V. You let the switch then shorten the CW/CCW input to 0V.
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
11 Aug 2005 7:20 reset l297 |
|
|
|
|
thank you x 1000 Marcel Majoor... again
wth "HALF/FULL_NOT" set to '0' and after reset_not for L297 is press and release... the home state(0101) start.... so this "NORMAL DRIVE MODE " is easily enter...
but for "WAVE DRIVE MODE" after reset_not ,,, waiting for one clk cycle is imposible for mechanical switch?... i think tht cannot do....
this is ok,, i can live wth the normal wave drive mode.... but the open collector output of the "home"... i cannot read from this pin, i dont understand why ... when it reach the 0101 state "home" will b '1' or '0'??
for the cw/cww_not.. the problem solved D,
the "app_note in L297" use a 470uF btween the power supply pin and gnd pin of L298N, but i dont hav the 470uF, so i used 10uF instead(my mistake)... the motor so weak n it cannot change direction....
after i plug out the capacitance, everything work supperb...
and the change direction is synchronously, so u can change anytime u like:)
another question is regarding the voltage drop for L298N... i use 15v from adapter(ac to dc) and it drop to 8-9V after the motor start to run....
so for this, should i use a voltage regulator to make it constantly 12V?...i prefer 12V
actually under my observation, the motor run better wth higher voltage(btween 9-10V).. 12V constantly should b better?...
the cheap stepper motor cost bout USD3.5(max almost 1000 steps per second, i try it out myself).... and everytime i assert the reset_not(L297)... the motor need some time to settle down,,, it shakes(not spinning well) a lot before it cool down and run properly, higher voltage shorter the time to settle down.
so 12V voltage regulator required? or a 9V one?
and for the "control" pin... it make no diff(high or low) on the performance....any comment?
should i buy better motor so tht it doesnt shake tht muchafter reset_not.. is quality the problem here?
thank you again.... i am grateful again.. hehehe...
my warm regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
11 Aug 2005 18:15 chopper frequency l297 |
|
|
|
|
Using a mechanical switch to select the mode is, basically, only possible with some dediacted hardware added. So in your situation I don't think it is a possibility.
Since the HOME output is an open-collector output, it floats when it is inactive. This means that if you want to measure the signal that you need a pull-up resistor (e.g. 10 kOhm) to +5V. This way you will measure 5V when the L297 is in it's initial state , and 0V otherwise. Thus, only with a pull-up resistor you will measure a '1' (HOME) or '0'. Without it you will either measure a '0' or a floating signal (which most of the time also 'translates' in a '0').
The 470 uF you mention is the 'buffer' of the power supply. The actual value depends on the current drawn from this power supply by the motors. Typically, the larger the better. The 10 uF you used does not 'buffer' that much (meaning that the voltage drops or becomes more erratic/changeable). When you removed the 10 uF the voltage probably dropped even more.
Using a regulator will not make the voltage become higher. Only a buffer capacitor (like the 470 uF) can make some difference here since it will provide additional power when a temporarily higher power is needed by the motor and which the power supply can not always provide (fast enough).
Most of the erratic movements might be due to an irregular voltage. A constant voltage is always the best. This does not necessarily need to be a regulated voltage (the motor does not really care if it has 5V or 5.5V ....). This constant voltage can be created using at least a large buffer capacitor. Obviously the power supply you use must also be able to provide enough power/current to the motor without a decreased output voltage. If you have a good power supply, and not connected that far away from the electronics then you can omit the buffer capacitor, or at least use a smaller one.
The CONTROL function is that it will chop the output only when an overcurrent situation occurs. If the current is lower than at what the chopper operation is set to, then you won't notice anything. And even when the chopper 'kicks' in, this might not be too obvious when looking at the motor (it should still functions as normal, only the 'torque' the motor can generate is less because the power applied to the motor is reduced by the chopper).
So, check if the power supply can generate the voltage and current the motor requires (without knowing the requirements of the motor things will stay 'experimental').
If not, use another power supply - a buffer capacitor is always a good idea but with a good power supply not that critical. During operation of the motor the voltage should not drop too much (this would indicate that the power supply can not supply the required current). If the voltage drops more than 0.5 - 1V (just guessing here) then I would suspect an 'underpowered' power supply.
Bottom line: You probably need a better power supply. Use a buffer capacitor. Check for the correct voltage for the motor (a few volts too high is almost never a problem).
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
14 Aug 2005 11:58 how to control stepper motor with l297 |
|
|
|
|
thank you x 10... again...
for the "home" i understand D.... however the low output voltage level is 1.2-1.5V(using 1Mohm)... but my controller can only accept the max low is 0.8V(Vil)...
wad should i do?...i think this is the prob tht i cannot detect the change on this output...
for the buffer u meantion... can u look at the the diagram on my topmost first post....
there is another 100nF(C3) connected wth parallel wth the 470uF,,, wad is the purpose on this so-many-capacitors?... a 470uF is not enuff?..
i can change the direction of the motor,,,, but after a while,,, nth works anymore,,, i hav no idea wad is the problem... is it the prob wth the voltage from the adapter?..
sometimes it can,,, sometimes it cannot,,, i am really sick of it
i check the input to the CW/CW_NOT, it is asserted properly so it is not mistake-connect prob..
wad can i do?..
is it also my lousy motor quality?... when i tried wth 1000 steps/s the motor spin more smoothly... but wth my hand,,, i can change the direction to wadever direction i want,,, it doesnt seems like following my direction switch...
| Code: |
| without knowing the requirements of the motor things will stay 'experimental' |
this is good one... i am sick of this lousy motor....
but i do learn a lot(from you)...
thank you again... please help
warm regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
15 Aug 2005 16:47 sense resistors l297 |
|
|
|
|
The reason for a smaller and a larger capacitor is that the smaller capacitor is used to filter out the higher frequencies and the larger for the lower frequencies (or in your case to buffer the power supply). A capacitor has a certain resistance at a given frequency (impedance). With a given frequency the resistance of a smaller capacitor is lower than that of a larger capacitor and will therefore 'shorten' the signal more to ground than a large capacitor. The higher the frequency, the lower the resistance, the more the signal is shortened to ground.
The HOME output should have no problems getting the signal low enough (the datasheet mentions 0.4V as a maximum). However, be advised that using a pull-up resistor of 1 MOhm is not typical. A typical pull-up is more in the 10 kOhm .. 100 kOhm range (depending on fast/steep the pull-up should be). I would use a 10 kOhm resistor. You can use a pull-up which is as low as 1 kOhm (not advised though), and still you should have a 0.4V output (max) when the HOME output is active (meaning NOT HOME). When the HOME output is inactive (meaning HOME) the level should reach the 5V the pull-up is connected to (maybe 1V lower). This is the situation when the HOME output is not conencted to anything (except the pull-up resistor). Check this first. If this is correct, then connect the HOME output to the circuit you use for detection and test again. You probably will experience some different values, but the 0.4V 'low' voltage should still be possible (the HOME output can sink at least 5 mA without getting above the 0.4V level -> if not the circuit connected to the HOME is probably not correct).
If you have a 'bad' power supply you can get bad results. Also, when driving the motor too fast, the torque of the motor is very low and thus the motor can easily be stopped by 'external' means (a finger touching the motor). The only way to get the motor restarted is then typicall to lower the frequency which drives the motor. A stepper motor can only be run at a relative low frequency when no acceleration is used! I would advise to use a much lower frequency than the 1000 Hz you are using. Try it at 100 Hz and see if the motor behaves in the same way as it does at 1000 Hz.
|
|
| Back to top |
|
 |
Google AdSense

|
15 Aug 2005 16:47 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
16 Aug 2005 3:22 using an l297 with high amp motors |
|
|
|
|
| Quote: |
| The reason for a smaller and a larger capacitor is that the smaller capacitor is used to filter out the higher frequencies and the larger for the lower frequencies |
i c tht line i understand everything... and also wad i used to see y need so many C... now i start to understand... can i know who are you?... impressive...
for the home output, i connect it(home) to a 10kohm and the 10kohm(another node) to Vcc(5V)...and my controller read from the home output at the same time....
i use a multimeter to check the home output... all of the time it is 4.7-5V(high)... when i assert the reset_not(reset_not = 0 for L297) the home output is 1.2V(multimeter reading)... i assume tht when i assert the reset_not... the translator go back to 0101 state... so i think when it is 0101 state it turn on the transistor for the home, so the home is pull down to the gnd wth a transistor voltage drop(Vce) of 1.2V??.. i hope my concept is wrong too....
for the motor, i hav try many frequencies,,, but only 1000Hz works smoothly.. all other shakes a lot n very hot... when i used 1kHz, it very smooth n less hot(mayb)
100Hz i tried and shakes lot, first few try on reverse direction is working, after tht no respond D it continue turning same direction...
and one weird thing is tht the torque is higher when it spin faster... it is harder to stop it wth fingers than when it is running slow(easily stop)...
thank you Marcel Majoor... grateful..
my warmest regards,
sp
|
|
| Back to top |
|
 |
Marcel Majoor
Joined: 17 Jan 2004 Posts: 79 Helped: 25
|
16 Aug 2005 16:57 what should be the chopper frequency for l297 |
|
|
|
|
1.2V for a low level of the HOME output is not good. You are correct to assume that, when the RESET is activated that the device is at the home position. However, according to the data sheet the HOME output is: 'The transistor is open when this signal is active'. This means that the transistor (if I am interpreting it correctly) is -not- on, hence the pull-up resistors are pulling this output to +5V. However (yet again) you do measure +5V at other times ..... I must assume that I interpret this incorrectly and that the HOME output tranistor is on when the device is in it's home position. But still, the incorrect 1.2V. I can only think of the other circuitry connected to the HOME output which 'generates' this behaviour. Try checking the home output with -only- the pull-up resistor, and then, when the output is still that high, you might assume something is wrong (with the device maybe).
General note: An improper power supply (noisy, underpowered, ..) can generate strange effects (e.g. a device can reset itself again and again).
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
27 Aug 2005 4:57 l298 maximum frequency dc motor |
|
|
|
|
thank you Marcel Majoor... again
everythings working now.... u know wad happen, the ST L298N is defect, i change n everythings work fine.
how i find out?.... i plug out 2 wires(same phase) out of the circutis n i find out the motor still moving, but when i plug another 2 wires out, the motor isn't run anymore...
i check chip by chip n finally found the L298N is broken...it is murphy's law...the last chip i check is faulty, y it is not the first chip?...
actually wad is the rate failure of an IC, i heard tht ST quality is bad..true? like the dual diode half bridge L6210 IC... i check the diode action using multimeter, every chips i bought is different, but it is working...
then i check short circuits on the L298N some pins shows short circuits characteristic on one chip but not if i try another chip
wad i feel weird is tht the motor can run wth single phase...but torque is low i suppose..
wad u interpret is correct, when in home state the transistor is open circuits...so the home is high... tht day i read 1.1 to 1.2V is when transition, it is flunctuating so the averange is tht value i suppose
i can read the step D... n another prob is my controller code is handicap as well... there is some errors on coding....now settle.
many many many thanks...
my warmest regards,
sp
|
|
| Back to top |
|
 |
BHATKAL
Joined: 10 Dec 2008 Posts: 1
|
12 Dec 2008 6:34 l297 clock speed |
|
|
|
|
Hello sir,
i have some doubts regarding the stepper motor controller L297.....
There is a three mode of operation isn't it....(Half step mode , Full step mode ( Normal drive mode , Wave drive mode))......if the active high on the Half/Full~ pin is taken as half step mode na.....and active low means Full step mode....in that how to differentiate between wave drive and normal drive.....i know that if translator output is 2,4,6,8 wave drive and 1,3,5,7 normal drive......but we are getting normal drive and wave drive......if we want to run the motor in normal drive mode only ....is there any external setting for that........is there any effect to motor if i simply make the port pin low....................
|
|
| Back to top |
|
 |
sp
Joined: 01 Jan 2004 Posts: 420 Helped: 27 Location: Floating Garden
|
17 Jan 2009 8:22 control input in l297 |
|
|
|
|
hi BHATKAL
phew! it used to be my final year project and i now have difficulties understand it. it's been some time...
ok let me try to help on the Full Step Mode. it has 2 modes: normal and wave drive.
for normal it's easily determine, assert reset and make sure it's in Full Step Mode. you get normal drive.
for wave drive, you need to switch to Half Step Mode first and let the translator go to any of the 2,4,6,8 state and change to Full Step Mode, this you will get wave drive.
i dunno is there any other way to obtain wave drive mode, but the method i mention is from Marcel Majoor.
You are welcome
|
|
| Back to top |
|
 |
Vash1011
Joined: 05 Mar 2009 Posts: 3
|
05 Mar 2009 4:18 l297 darlington array circuit |
|
|
|
|
Hi, I am trying to control a stepper motor with a microcontrollr which should be able to send commands to the motor and make it move a certain number of steps either CW or CCW depending on the key pressed.
It is a colour wheel motion.
10 colours = 360deg = 200 steps using a 1.8deg step angle motor.
I am not being able to choose which motor to use: Bipolar or Unipolar? javascript:emoticon(' ')I know it doesnt matter in this case, but I would like to control it using the L297 and a driver to make the software from the microcontroller shorter and use 2 pins of the microcontroller, rather than 4 pins.
In case of using Bipolar and L297, I read the datasheet of L297, but its quite ambiguous. My motor would be driving at less than 1A/ phase. So I should choose to use L293E rather than L298, though I dont find any reason why I should not be able to use L298? Please advise.javascript:emoticon(' ')
Next step is to make the connections.
I found a really useful connection here:
http://www.societyofrobots.com/member_tutorials/node/169
According to that circuit, my microcontroller should be sending a set of 1s and 0s with 5ms in between per step for one colour movement, and then, after 20 steps(meaning that it has eached the next colour), a delay(which could be 1second) is sent and then the 5ms clock pulse are sent again. To choose CW or CCW, this should be connected to a pin on the microcontroller to be set high or low according to the key pressed.
I have a few questions:
The wheel will have a small part cut out(an opto switch interrupter to sense the reset position) Once, the opto switch receives the signal from the emitter, it sends a HIGH to the microcontroller which should then make the motor stop. This is the RESET position of the motor.
Is there any way to make the motor, driver, translator 'remember' that reset position so that whenever a single colour change is desired, it goes back to the reset point and then the motor turns according to the number of times the key for 'next colour' is pressed. Please note that there should be two keys: one for next CW colour and one for next CCW colour.
One key should be making the motor turn at a specific speed per colour, its the speed the wheel changes from colour A to B, not from 1 step to the other. so basically, its the delay between every 20 step commands sent to the motor.
While the motor is moving,say CW, it moves step 1 to step 200 until the optoswitch sends a HIGH to the microcontroller. At this specific point, the motor must stop(all wires should be 0000) and then turn CCW until the optoswitch again sends a HIGH to the microcontroller where the motor then turns CW...this goes on continuously.
Please note that the optoswitch is primarily there for the RESET position so that a 'good' colour change takes place rather than a messed up effect.
If you have a suggestion to the movement of the wheel, you are warmly welcome to advise me please.
My main question:
Will this circuit above work according to my specifications? Any changes you may suggest? Im quite reluctant in choosing the driver, L293E or L298?
Lets say im going to use a 12V 2-phase Bipolar stepper with a 1.8 step angle with a rated current of 0.48A per phase.
So, for a delay of 1 second between colour:
The input to Clock should be, since it is 'Pulse Low to step', a low from the microcontroller will make the motor move 1 step:
0(5ms)1(5ms)0(5ms)1(5ms).....x 10, then (1 second high-stops the motor completely)0(5ms)1(5ms)0(5ms)1(5ms).....
This sequence goes on for 200 steps until the opto switch sends a HIGh.
Please advise on the softwre and circuit side of the motor movement?
I read about using the ULN2003 transistor arrays, but this would implement tougher programming, i presume. Whereas I just need these movements:
1.....Move from 1 colour to the other with 1 second delay, 0.5second delay, 0.1 second delay, 0.05 second delay, 0.01 second delay and then 5ms delay: these are basically the different speeds I will make the motor move, 1 second being slowest and 5ms being the fastest.
Here is the motor:
http://www.rapidonline.com/Electrical-Power/Fans-Motors/Motors/2-phase-Bi-polar-stepper-motor-12V/73192
2.....After moving all 200 steps, move back in the opposite direction to reach back to the RESET point.
3.....If the 'RESET' key is pressed, the motor should move clockwise until the optoswitch sends a high to the microcontroller and then the motor stops.
4.....If the 'CW NEXT COLOUR' is pressed, the motor should move to the next clockwise colour.
5.....If the 'CCW NEXT COLOUR' is pressed, the motor should move to the next anticlockwise colour.
That is all I could find out that my colour wheel and motor would do, improvising for a hopefully small program..
Please help me decide on the chips to be used because I need to order the motor, the L297 and the driver by today evening!
Thank you very much for your patience for reading such a long message.
Thank you very very much in advance for helpful.
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
05 Mar 2009 4:42 l297 vref voltage |
|
|
|
|
| Can you use one of the microcontrollers registers (or a memory address) to keep a number (0 to 200) indicating present position? then the controller would know how far it has gone since seeing the index sensor and your code would always know where the wheel is.
|
|
| Back to top |
|
 |
Vash1011
Joined: 05 Mar 2009 Posts: 3
|
05 Mar 2009 5:20 l297 clock signal |
|
|
|
|
| patweadock wrote: |
| Can you use one of the microcontrollers registers (or a memory address) to keep a number (0 to 200) indicating present position? then the controller would know how far it has gone since seeing the index sensor and your code would always know where the wheel is. |
This sounds fantastic.
So, for example, to choose colour B which is 60 steps after the RESET(SENSOR), the count from the memory address would be Present position+60?
What about the circuitry? will it work on the circuit i sent above?
|
|
| Back to top |
|
 |
patweadock
Joined: 13 Feb 2009 Posts: 35 Helped: 3 Location: Near Burlington, VT
|
05 Mar 2009 16:03 orcad part for l6210 |
|
|
|
|
Though I've used the l298, it's hard for me to understand your circuit description without a schematic. The current sense feedback is usualy needed if one wants to over-voltage motor coils for max torque. If that isn't required of your application, you wouldn't need it. I'm curious about your application though, usualy, color wheels are turned at a constant rate while the light shone thru them is pulsed on at the color position desired, like with DLP projectors or "propeller clock" operation. An optical index position sensor is used with these too.
Also, the easiest way to sequence a bipolar stepper is with 2 exor gates and 2 D type flip flops, the outputs from the flip flops drive four MOSFETS. You would only need 2 pins of the controller for this; step and direction, with the controller adding or subtracting steps from the position register according to the direction bit.
|
|
| Back to top |
|
 |
Vash1011
Joined: 05 Mar 2009 Posts: 3
|
05 Mar 2009 18:18 l297 plus a quad darlington array |
|
|
|
|
| patweadock wrote: |
Though I've used the l298, it's hard for me to understand your circuit description without a schematic. The current sense feedback is usualy needed if one wants to over-voltage motor coils for max torque. If that isn't required of your application, you wouldn't need it. I'm curious about your application though, usualy, color wheels are turned at a constant rate while the light shone thru them is pulsed on at the color position desired, like with DLP projectors or "propeller clock" operation. An optical index position sensor is used with these too.
Also, the easiest way to sequence a bipolar stepper is with 2 exor gates and 2 D type flip flops, the outputs from the flip flops drive four MOSFETS. You would only need 2 pins of the controller for this; step and direction, with the controller adding or subtracting steps from the position register according to the direction bit. |
Thank you very much for replying.
Actually, im building an illuminator, the light source is a 12v 75W halogen lamp, it cannot be pulsed nor dimmed. Its on constantly.
All special effects are made using the colour wheel, the stepper which are thus controlled by the microcontroller.
It is precisely important to use a microcontroller as the title of the project is Microcontrolled POF Illuminator, my Final Year project, for which i have a poster presentation this coming wednesday...
I am suggesting to use L297 as the translator and L298 as the driver whilst the microcontroller sends the clock pulse and direction pulse according to the program.
So, the wheel will be moving either clockwise or anticlockwise and the speed of rotation of the wheel will be determined by the frequency of clock going into the L297, or am I right?
The schematic for using bipolar motor as well as unipolar motor is attached. It is from a website i mentioned earlier.
Please ignore the connections to other L297s in the schematic.
According to the schematics, i see unipolar as being the easiest to implement, but what is the purpose of R7?
How should I program the stepper to move CW and then suddenly change direction? this will include a STOP phase and then re-power the wires, does this have to be included in the clock pulses or does the L297 do it within the translator?
|
|
| Back to top |
|
 |