FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    How to Arduino L298N H-bridge and to achieve with the use of a bipolar stepper motor control

     

    Step 1: What you'll need The project will require some attention, if you are reading this content, you probably already have: / p " * Some flavor arduino (I'm using UNO) * Stepping motor (please refer to the specifications table) * L298N driver circuit board similar to the picture * Certain power, providing at least 5V voltage, but less than the maximum voltage of the motor * Cable, wire strippers, etc. fader wires (without soldering on the project) Digital multimeter may be helpful Step 2: L298N connected to Arduino I am described in the previous section, but let us explain in detail: There are four pins on the module L298N IN1-4, there are four output connections OUT1-4. Junction box module and a + V and GND. And a + 5V terminal (we will not use). IN any pin can be connected to the control pin on the Arduino. In my case, I have an LCD screen on the UNO, so I used the analog pins (A1 to 4, which is very important in the future). And then connect them as follows: A1- "IN1 A2- "IN2 A3- "IN3 A4- "Importantly, must also be grounded arduino pin connected to a common ground terminal, otherwise it will not work! ! ! ! ! I then connected to the variable power source + V, and ground again by a ground terminal. Step 3: Wiring of Stepper If you view the specification table that shows which wires should be A + A- B + and B- sometimes, they do not use this specific language, but you have a box is a box having four wires, they are divided into two Group. You can view the multimeter by measuring the resistance (or connection), to view the two pairs (if not illustrated). In order to make a real motor rotation, you need to ensure that A + and B + respectively attached to OUT1 and OUT3. If you are wiring the motor, and the motor just vibration, then one pair will reverse. FIG wiring substantially: A + (Black) - "OUT1 A- (green) - "OUT2 B + (blue) - "OUT3 B- (red) - "OUT4 Step 4: Programming: Overview and warnings Therefore, when I first started this odyssey, the document is very small, but even worse is that most of the examples are still dependent on the use digitalWrite to handle pin operation, or Worse still relies on the built-in stepper arduino library, the library actually achieve the same thing. However, in this way there is a big problem operations. digitalWrite system is very slow, and, if you want to do is digitalWrite, and then perform another digitalWrite, then it really is ugly, terrible slow codes. If you are not familiar with it, you should read the following: https://www.arduino.cc/zh/Reference/PortManipulati. . This allows us to do is, instead of writing a pin high or low, simply register by addressing these pins control the entire pin high or low will write to . Warning: L298N H-bridge is the essence of four separate switches, run as a switch, if used in conjunction with existing arduino Stepper library, there is a major bad habits, or if you use duplicate digitalWrite () statement, also That is, since the waiting time before the pin, while it may be at high level IN1 and IN2. This will cause the crash, and may not be more than twelve minutes, check your smoke might bridge. I spent a few days of debugging time to figure out why the bridge to pull 4 amps of current, and after running for about 5 seconds, the radiator becomes too hot to touch. Step 5: programming examples Thus, there may or may not need something extra, for example LCDShield main loop check code or code execution time. If you are using A1-A4, you should compile this code (Arduino IDE 1.6.5), and the motor rotation. Most of this code is my own, borrowed or modified a bit from Stepper.h file. Notice: The delay "StepFast" in microseconds, so 2000 is only 2 milliseconds, in most cases, if the attempt to retard the stepping motor is less than 1200 it will skip step, although for most motors, the 800 step 4 is a full circle, but you may find that the motor can only rotate a quarter turn. This code is only as an example, currently not reversed, it will not absorb feedback L298, it will not do a lot of other things I want to do. When viewing an existing Stepper.h, I would probably use the next few weeks in this method to handle steps to re-write it, because existing methods could damage the L298 or any other H-bridge configuration. #include #include // Keypad Shield LCD pins LiquidCrystal lcd (8, 9, 4, 5, 6, 7); long unsigned int lasttime; long unsigned int timer; int timeuntil; float exectime; int smallcount; Void setup () { lcd.begin (16, 2); lcd.print ( "Motor Test"); delay (2500); lcd.clear (); } void StepFast (long int steps, long unsigned wait) { DDRC = B00011110; // set arduino ports A1-A4 output remember this works backwards! // ^ -pin 7 ^ -pin 0 int pattern = 0; int mydelay = 0; for (int i = 0; i "steps; i ++) { switch (pattern) { case 0: // 1010 PORTC = B00001010; // arduino analog port we're using pins A1-A4 So we're only going to change those Break; case 1: // 0110 PORTC = B00001100; Break; case 2: // 0101 PORTC = B00010100; Break; case 3: // 1001 PORTC = B00010010; Break; } pattern ++; if (pattern "3) {pattern = 0;} delayMicroseconds (wait); } PORTC = B00000000; // de-energize to motor } void loop () { lasttime = timer; timer = millis (); exectime = (timer - lasttime) / 1000; if (timeuntil "timer) { lcd.clear (); lcd.setCursor (0,0); lcd.print ( "Clockwise"); lcd.print (exectime); lcd.setCursor (0,1); lcd.print (timer); lcd.print ( ""); lcd.print (lasttime); timeuntil = timer + 1500; } StepFast (800,2000); // steps, delay in microseconds delay (5000); } Notice: This code is in the middle of stepping speed ~300RPM (stepping rate is about 1ms) under can work well, because you try to raise it to 1000RPM, unless voltage increases, otherwise it begins to lose step, however, if the "5V operation of the motor at 60RPM (5ms), the L298N will start to get hot. Step 6: ideas and afterthought So I have no truly mentioned things in the original article I attach great importance to the process. Among the key issues are: With increasing speed step, a power supply voltage must be increased Pins ENA and ENB as PWM input to keep the voltage low on pace, and with the increase in speed is increased step Acceleration and inertia to respond, Read more

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us