Monster moto shield + Arduino + Pololu 12V, 29: 1 Problema de hardware del codificador del motor de engranajes

2

¡Entusiastas del desbordamiento!

Estoy tratando de construir un robot de equilibrio con dos ruedas, usando el motor de engranajes de polulu como se mencionó anteriormente. Con el fin de tener un conductor de motor fuerte, el escudo de moto monstruo se utiliza en este proyecto. Aquí están los componentes y las hojas de datos que se utilizan.

Componentes

baterías lipo Arduino santo inteligente 2x Pololu 12V, motor de engranajes 29: 1 con codificador Monster moto shield

Ahora, volviendo al tema ... Bueno, el primer problema que encontré fue mi controlador de motor. Se calienta después de un tiempo, siempre que lo uso (corro 2 motores a través de 1 controlador). Y la parte más frustrante es que los motores pueden detenerse por un tiempo y luego reiniciarse (sospeche un reinicio de hardware aquí). ¿Hay alguna manera de resolver esto? He revisado la hoja de datos del controlador de monster moto, pero no puedo entender si los componentes ya están en el PCB o tengo que agregar manualmente nuevos componentes como resistencias, condensadores, etc. Esté contento si ustedes me dirigieron en este tema.

En segundo lugar, el otro problema que tengo es que los motores funcionan a la velocidad de CW y a la de CCW cuando invierto la dirección. También he visto a otras personas que tienen el mismo problema que yo y me pregunto por qué sucedió esto.

¿Debo agregar componentes externos? Entonces, ¿qué componentes debo usar para solucionar este problema?

Aquí hay algunas imágenes para aclarar el problema. Principalmente, utilizando cables para conectar entradas, etc. Me encantaría que se preguntara algo y quisiera que publique más información.

pictures:

Código

/*  MonsterMoto Shield Example Sketch
  date: 5/24/11
  code by: Jim Lindblom
  hardware by: Nate Bernstein[![enter image description here][1]][1]
  SparkFun Electronics
 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, BRAKE[![enter image description here][1]][1]VCC, 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.

This code is beerware; if you see me (or any other SparkFun employee) at the
local, and you've found our code helpful, please buy us a round!
Distributed as-is; no warranty is given.
 */
#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] = {7, 4};  // INA: Clockwise input
int inBpin[2] = {8, 9}; // INB: Counter-clockwise input
int pwmpin[2] = {5, 6}; // PWM input
int cspin[2] = {2, 3}; // CS: Current sense ANALOG input
int enpin[2] = {0, 1}; // EN: Status of switches output (Analog pin)

int statpin = 13;

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

  pinMode(statpin, OUTPUT);

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

void loop()
{
  motorGo(0, CW, 1023);
  motorGo(1, CW, 1023);
  delay(500);
  motorGo(0, CCW, 1023);
  motorGo(1, CCW, 1023);
  delay(50);
  if ((analogRead(cspin[0]) < CS_THRESHOLD) && (analogRead(cspin[1]) < CS_THRESHOLD))
    digitalWrite(statpin, HIGH);
}

void motorOff(int motor)
{
  // Initialize braked
  for (int i=0; i<2; i++)
  {
    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 motor, uint8_t direct, uint8_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);
    }
  }
}

saludos, Volkan

    
pregunta ozzmanli

0 respuestas

Lea otras preguntas en las etiquetas

Comentarios Recientes

+ Activator Software + Componentes / BrandNet + Módulos Bluetooth + Celulares Panasonic + Clarion safety + 2 teletipo + cii map + Legacy 5D4 Smart phone + Backcountry explorer + Ceo Technology MX40 20.35.0 + Broadcom SBC + Digikey Transmitter LE500 + escáner Graft 1008G + cronógrafo Rolex + martillo Hemi Ultimate + mini placa Osram Chronomicrog + cámara Phillips + Qtek power F3000 + paneles solares Isuzu + aplicación manual iAnmeter temps + aplicación económica de carga eléctrica inteligente. divisor + generador... Lees verder