BB-VNH3SP30 writes only on a pwm 55 and warms himself

Started by Pkod, September 05, 2017, 09:53:16 PM

Previous topic - Next topic

Pkod

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('.');
}