Shop OBEX P1 Docs P2 Docs Learn Events
L297 & L298n — Parallax Forums

L297 & L298n

RubyRuby Posts: 35
edited 2011-08-04 15:03 in General Discussion
Hi everybody.
I have problem with wiring L297 - L298n. I did everything as in datasheet but i didn't get anything but a burning smell.
Can someone please tell me what did i do wrong?
I am trying to control bi-polar stepper motor by sending pulses from parallel port to L297
CW/CCW , half/full step ,reset , enable and Vref are connected to 5 volt
Control to ground
I am sending pulses to Clock from parallel port ( 3-3,5 volts )
Instead of 36 volts i am using 24 volts.
I have 4 wired stepper motor and how can i connect them to L298n?
Thanks


L297&l298n.jpg
678 x 517 - 39K

Comments

  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-01 07:28
    Ruby,

    It's impossible for anyone to tell you what you might have done wrong without more information than you have provided. Probably the best approach to solving the problem would be to "divide and conquer" - break down the problem into little pieces that you can solve one at a time.

    Personally, I have no idea how to control parallel ports on computers, but I'm sure somebody here knows how to do that. Have you considered using a Propeller or other chip for the controller rather than going directly from a computer port? There are lots of examples for driving stepper motors via Propellers, etc. on the Parallax web site, and I'm guessing having such a middle man will help protect your computer.

    But first, perhaps if you could provide a photo of your wiring set-up, then that might help get things started.
    Do you have a link to the type of motor and motor specs?

    Do you have any idea what exactly is causing the smell? Is the L298 itself getting hot? or is it the motor? or something else?

    IIRC, you need "flyback diodes" around the motor connections to prevent voltage spikes when using an L298 - do you have those installed?

    Also, please post your new information and questions to the forum and not via PM. There are lots of smart people here and everybody gets to benefit when the answers are out in the open.

    hope that helps.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-01 07:56
    Ruby,

    you might also get more attention if you go to your top posting, click on Edit, then in the next window click on Advanced, then find the little drop down menu for Prefix and click on Unsolved. That puts a little flag by your title so people know you are asking for help. Also, I think it's best to make your title say something like "I need help with....."
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2011-08-01 09:51
    Captain Obvious has to ask: where did the burning smell come from? If it came from your PCs parallel port, that's a major uh-oh.

    The L297/L298 can be effectively tested away from the PC parallel port. You can make a simple stepper using a momentary switch, and tying the other inputs low or high, depending on the action you want (e.g. direction set). Only when you have the circuit working and tested should you ever connect anything to a parallel port, and that should be done through some buffer ICs, as a precaution. The L297 won't pull excessive current from the port, but that's assuming things are wired correctly. Yanking a few amps from a parallel port can permanently damage the port, if not more.

    -- Gordon
  • RubyRuby Posts: 35
    edited 2011-08-01 14:02
    Thanks.
    I check the the motor and it needs 6.4 ohm so i need Vref 3.2 volt.
    I build it again but this time without L298n and and i put 4 leds to the output of the L297.
    First i put them between every pin and ground ; but only 2 of them worked , also i changed the CW to high but the same and when i send pulses to clock they went off.
    Then i put pair for each output ; one pair between 4 and 6 numbered pin but opposite directions ; same same....
    Why can it be?
  • Mark_TMark_T Posts: 1,981
    edited 2011-08-02 03:25
    Ruby wrote: »
    Thanks.
    I check the the motor and it needs 6.4 ohm so i need Vref 3.2 volt.
    I build it again but this time without L298n and and i put 4 leds to the output of the L297.
    First i put them between every pin and ground ; but only 2 of them worked , also i changed the CW to high but the same and when i send pulses to clock they went off.
    Then i put pair for each output ; one pair between 4 and 6 numbered pin but opposite directions ; same same....
    Why can it be?
    What motor are you using? What values for Rsense? What's the 24V PSU rating? Did you wire LEDs without current limiting resistors?
  • RubyRuby Posts: 35
    edited 2011-08-02 04:49
    A simple stepper motor from printer.
    I don't know what r u meaning with Rsense and PSU :(
    If you r meaning the two 0.5 ohm resistors , yes with them but i wired the leds to output without resistors.
    Wiring:
    CW/CCW , half/full step ,enable and Vref were connected to 5 volt
    Control to ground
    Sense 1 and sense 2 to ground with 0.5 ohm resistors
    Sync , home, reset , INH1 and INH2 to nothing
    A , B ,C and D to ground with leds than between A-B 2 pairs of led but opposite ( The same with C-D )
  • piguy101piguy101 Posts: 248
    edited 2011-08-02 05:19
    If you wired the LEDs with the two 0.5Ω resistors, that would certainly kill the LEDs and make a burning smell.
  • RubyRuby Posts: 35
    edited 2011-08-02 06:13
    Nope i didn't. First i want to check L297 all alone.
    I am reading the datasheet again and please check me if i am right.
    I am going to wire the diagram but without L298n ; everything which suppose to connect to L298n will be connected to nothing as INH1 and INH2. Sync and home also to nothing.
    Gnd directly and Sense1 - Sense2 with res. to ground.
    Enable , control , Vs , Half/Full ( for half step ) and reset to +5 volts
    Vref to 3 volts or something else....
    Now 2 things remains.
    CW/CCW : Doesn't matter high or low for now
    Clock : Pulse
    Now the thing is ; when we say pulse i thought it was "0 to "5 but is it opposite? I mean is it has to be connected to 5 volts than suddenly cutting it off ? Is this pulse ? Cutting the voltage?
    Finally i want to wire 4 leds between A ,B ,C ,D to ground just to be sure that L297 is working.
    What do u say?
  • RubyRuby Posts: 35
    edited 2011-08-02 13:00
    Ruby,

    It's impossible for anyone to tell you what you might have done wrong without more information than you have provided. Probably the best approach to solving the problem would be to "divide and conquer" - break down the problem into little pieces that you can solve one at a time.

    Personally, I have no idea how to control parallel ports on computers, but I'm sure somebody here knows how to do that. Have you considered using a Propeller or other chip for the controller rather than going directly from a computer port? There are lots of examples for driving stepper motors via Propellers, etc. on the Parallax web site, and I'm guessing having such a middle man will help protect your computer.

    But first, perhaps if you could provide a photo of your wiring set-up, then that might help get things started.
    Do you have a link to the type of motor and motor specs?

    Do you have any idea what exactly is causing the smell? Is the L298 itself getting hot? or is it the motor? or something else?

    IIRC, you need "flyback diodes" around the motor connections to prevent voltage spikes when using an L298 - do you have those installed?

    Also, please post your new information and questions to the forum and not via PM. There are lots of smart people here and everybody gets to benefit when the answers are out in the open.

    hope that helps.

    As u said. I wired only L297 but it didn't worked well....
    As you can see in the pic. i wired the outpins 4,6,7 and 9 to led than to ground. Only the second and the fourth one worked ( 0101 ) than i send pulse ( i connect the pin 18 to 5 volt ) than they went off.
    Sync , home , inh1 and inh2 to nothing
    Gnd to ground
    Sens1 and sens2 to ground by resistor ( 0,5 ohm )
    A , B , C and D to the ground by leds
    Enable , control , Vs , CW/CCW , Half/Full and reset to 5volt
    Vref to 3 volts
    OSC as in the datasheet
    Please Help.............
    1024 x 1365 - 139K
    1024 x 1365 - 134K
    1024 x 1365 - 144K
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-02 14:52
    Ruby wrote: »
    As u said. I wired only L297 but it didn't worked well......

    Ruby,

    Two things strike me when I see your photos. First, I think Mark_T already asked about the LEDs: " Did you wire LEDs without current limiting resistors?" It's possible you fried them at some point by applying too much current through them, so you might need to test them to be sure they are working. Second, I notice you have resistors twisted together but apparently not soldered. That's probably not a good idea because twisting does not necessarily mean you are getting good contact. If you never discovered the source of what caused the burning smell, there is always a possibility that something important got smoked and so your present efforts might be frustrated by that. Do you happen to have a fresh L297 chip that you can start over with? Are you sure that your sense resistors are rated for the number of watts you will be using with your motor?
  • RubyRuby Posts: 35
    edited 2011-08-03 00:00
    Ruby,

    Two things strike me when......

    Led's are ok.
    What do u mean with limiting resistors?
    I am going to give a try with a new L297 but it is the last one. If it blows away again i need to order from ebay cause i couldn't find it here. It takes too long to receive...
    About L298n :
    Can i send pulses to it without L297. I mean if connect paralelport to it ( i can send pulses 3,5 volt ) without L297 will it work?
    Just to check if L298n is ok..
    I can send pulses to pin 5,7,10,12 like 0101-0001-1001... etc.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-03 08:08
    Ruby wrote: »
    ...
    What do u mean with limiting resistors? ....

    Those are resistors that are often put in series with LEDs so the current is kept to an acceptable level and does not exceed what the LED is rated for. They are generally a good idea but I know sometimes people don't use them and they risk burning out their LEDs.

    I don't know anything about controlling things with PC ports directly but I'm sure somebody on the forum does. I found this link below that, at a glance, seems fairly reasonable. I would suggest you start with something like this, make sure you are outputting the kinds of signals you think you are, and once you are done with that, move on to your first chip. Take things one step at a time. I am afraid that you have thrown everything together all at once, hit the launch button and now you are left with a tangle of wires and possibly fried components that will make debugging and troubleshooting a nightmare.

    http://www.hardwaresecrets.com/article/How-To-Build-Parallel-Port-Prototypes/233/1

    I hope that helps.
  • RubyRuby Posts: 35
    edited 2011-08-03 11:26
    hi
    I know how to use parallel port.
    I am gonna give a try again but what do u think about the post that i wrote ; the one with the pictures?
    Did i wire it ok?
    Just check the things i wrote , leave the pictures.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-03 12:18
    Ruby wrote: »
    ...
    Did i wire it ok? ....

    I hate to say it, but to be honest: the wiring makes it very difficult to follow what is going where. You might try to clean it up somewhat and try to keep your connections from looking like a rat's nest. For example, you might cut the leads off some of your components so they will fit closer to the board and so their leads aren't in such danger of accidently making contact with something else and causing a short. Your clear LED, for example, looks like a short waiting to happen.
    Did you ever solder your resistors together properly so they aren't depending on the twist-tie concept for making contact?
    Did you ever check on your sense resistors to see if they are rated for the proper wattage?
    Are you absolutely sure that what you think you are sending to your parallel ports is actually doing what it is supposed to do - have you tested it with LEDs like the link I provided shows you?
    Did you ever find out what was burning in your original set up?
  • RubyRuby Posts: 35
    edited 2011-08-03 14:05
    I hate to say....

    I know that it looks like terrible... I am using now a new board and new components.
    About parallel port ; i am sure of it. I am using CVI National Instruments. Software that i studied. I am mechanical engineer but i almost forget everything :( But i am very good at designing mechanical models. So i just want to see them become alive :)
    I finished now wiring but i will give a try tomorrow.
    Wish me luck. I will be touch with u tomorrow and thank u very much.
    Ps: I need a tracking software ; do u know something?
  • RubyRuby Posts: 35
    edited 2011-08-04 15:03
    Hi.
    At last :))))
    Today i bought 10 leds to understand how L297 works. U were right ; the first one's pin 4 burned so i changed it with a new one. Than i wired the schematic with leds ( without L298n ) than i understood how it works. I was thinking it makes a one step when i send a pulse than i saw it when i send pulse it makes more than one cycle and when it is high it pauses. The other words when it is "0 or grounded it makes cycles and very fast. I will need to change my software but at least now the first part is working and more important i understood how it works....
    Thank u so much....
Sign In or Register to comment.