Welcome, Guest

Author Topic: BB-VNH3SP30 writes only on a pwm 55 and warms himself  (Read 443 times)

Pkod

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
BB-VNH3SP30 writes only on a pwm 55 and warms himself
« on: September 05, 2017, 09:53:16 PM »
Hello

I need your help.
I connect the BB-VNH3SP30 to arduino nano.
All connection as per instruction.
The driver starts to squeak only on pvm 55-65 and then turns off the voltage. It is very hot.
I'm applying a voltage of 7.4 volts.

My progamm:
const int inaPin = 9;
const int inbPin = 13;
const int pwmPin = 11;
const int XPin = A0;
int xPosition = 0;

void setup() {
  pinMode(inaPin, OUTPUT);
  pinMode(inbPin, OUTPUT);
  pinMode(pwmPin, OUTPUT);
  pinMode(XPin, INPUT);   

  Serial.begin(9600);
}

void loop() {

  xPosition = analogRead(XPin);
  Serial.print("X: ");
  Serial.print(xPosition);

  if(xPosition>510) //едем вперед
     {
         digitalWrite(inaPin, HIGH);
         digitalWrite(inbPin, LOW);
         analogWrite(pwmPin, constrain(map(xPosition, 510, 1023, 0, 255),0,255));
         Serial.print(" | Shim: ");
         Serial.print(constrain(map(xPosition, 510, 1023, 0, 255),0,255));
      }
     else
      if(xPosition<480) //едем назад
      {
        digitalWrite(inaPin, LOW);
        digitalWrite(inbPin, HIGH);
        analogWrite(pwmPin, constrain(map(xPosition, 480,  0, 0, 255),0,255));
        Serial.print(" | Shim: ");
        Serial.print(constrain(map(xPosition, 480, 0, 0, 255),0,255));
      }
      else if(xPosition<=499 && xPosition>=450)
      {
        analogWrite(pwmPin, 0);
      }

      Serial.println('.');
}