نمایش نتایج: از 1 به 4 از 4

موضوع: ماژول درایور موتور 30 آمپر VNH2SP30 full-bridge

  1. #1
    مدیر ویژه
    تاریخ عضویت
    Mar 2014
    نوشته ها
    586

    ماژول درایور موتور 30 آمپر VNH2SP30 full-bridge

    معرفی پینهای ماژول

    برای دیدن سایز بزرگ روی عکس کلیک کنید

نام: VNH2SP30_SINGLE_1-500x500.jpg
مشاهده: 204
حجم: 82.3 کیلو بایت

    برای دیدن سایز بزرگ روی عکس کلیک کنید

نام: 0J5062.624.jpg
مشاهده: 159
حجم: 20.0 کیلو بایت

  2. #2
    Junior Member
    تاریخ عضویت
    Mar 2016
    نوشته ها
    8
    سلام نحوه اتصال به آردینیو را هم قرار می دهید با یک مثال ساده برای حرکت و جهت
    تشکر

  3. #3
    مدیر ویژه
    تاریخ عضویت
    May 2014
    نوشته ها
    259
    کد PHP:
    /*  MonsterMoto Shield Example Sketch
      date: 5/24/11
      code by: Jim Lindblom
      hardware by: Nate Bernstein
      SparkFun Electronics
     
     License: CC-SA 3.0, feel free to use this code however you'd like.
     Please improve upon it! Let me know how you've made it better.
     
     This is really simple example code to get you some basic
     functionality with the MonsterMoto Shield. The MonsterMote uses
     two VNH2SP30 high-current full-bridge motor drivers.
     
     Use the motorGo(uint8_t motor, uint8_t direct, uint8_t pwm) 
     function to get motors going in either CW, CCW, BRAKEVCC, or 
     BRAKEGND. Use motorOff(int motor) to turn a specific motor off.
     
     The motor variable in each function should be either a 0 or a 1.
     pwm in the motorGo function should be a value between 0 and 255.
     */
    #define BRAKEVCC 0
    #define CW   1
    #define CCW  2
    #define BRAKEGND 3
    #define CS_THRESHOLD 100

    /*  VNH2SP30 pin definitions
     xxx[0] controls '1' outputs
     xxx[1] controls '2' outputs */
    int inApin[2] = {74};  // INA: Clockwise input
    int inBpin[2] = {89}; // INB: Counter-clockwise input
    int pwmpin[2] = {56}; // PWM input
    int cspin[2] = {23}; // CS: Current sense ANALOG input
    int enpin[2] = {01}; // EN: Status of switches output (Analog pin)

    int statpin 13;

    void setup()
    {
      
    Serial.begin(9600);
      
      
    pinMode(statpinOUTPUT);

      
    // Initialize digital pins as outputs
      
    for (int i=0i<2i++)
      {
        
    pinMode(inApin[i], OUTPUT);
        
    pinMode(inBpin[i], OUTPUT);
        
    pinMode(pwmpin[i], OUTPUT);
      }
      
    // Initialize braked
      
    for (int i=0i<2i++)
      {
        
    digitalWrite(inApin[i], LOW);
        
    digitalWrite(inBpin[i], LOW);
      }
      
    // motorGo(0, CW, 1023);
      // motorGo(1, CCW, 1023);
    }

    void loop()
    {
      
    motorGo(0CW1023);
      
    motorGo(1CCW1023);
      
    delay(500);

      
    motorGo(0CCW1023);
      
    motorGo(1CW1023);
      
    delay(500);
      
      if ((
    analogRead(cspin[0]) < CS_THRESHOLD) && (analogRead(cspin[1]) < CS_THRESHOLD))
        
    digitalWrite(statpinHIGH);
    }

    void motorOff(int motor)
    {
      
    // Initialize braked
      
    for (int i=0i<2i++)
      {
        
    digitalWrite(inApin[i], LOW);
        
    digitalWrite(inBpin[i], LOW);
      }
      
    analogWrite(pwmpin[motor], 0);
    }

    /* motorGo() will set a motor going in a specific direction
     the motor will continue going in that direction, at that speed
     until told to do otherwise.
     
     motor: this should be either 0 or 1, will selet which of the two
     motors to be controlled
     
     direct: Should be between 0 and 3, with the following result
     0: Brake to VCC
     1: Clockwise
     2: CounterClockwise
     3: Brake to GND
     
     pwm: should be a value between ? and 1023, higher the number, the faster
     it'll go
     */
    void motorGo(uint8_t motoruint8_t directuint8_t pwm)
    {
      if (
    motor <= 1)
      {
        if (
    direct <=4)
        {
          
    // Set inA[motor]
          
    if (direct <=1)
            
    digitalWrite(inApin[motor], HIGH);
          else
            
    digitalWrite(inApin[motor], LOW);

          
    // Set inB[motor]
          
    if ((direct==0)||(direct==2))
            
    digitalWrite(inBpin[motor], HIGH);
          else
            
    digitalWrite(inBpin[motor], LOW);

          
    analogWrite(pwmpin[motor], pwm);
        }
      }


  4. #4
    Junior Member
    تاریخ عضویت
    Mar 2014
    نوشته ها
    14
    سلام. برای درایو موتور dc استغاده کردم. 13ولت 2آمپر. اما آیسی و برد زیریش خیلی داغ میکنه. !!!
    کسی به این مشکل برنخورده

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •  

SEO by vBSEO