Pages: [1]   Go Down
Author Topic: arduino victor 884 control help needed  (Read 976 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an arduino project where I want to control a couple of victor 884 motor controllers.

This code worked for me before but it is not working anymore. Now when the code is
setting the victors into full forward or full reverse, the victors flash thier LEDs orange
which means that they are being pulsed.

When the code is setting them to neutral, the victor's LED is solid orange.

In the full forward the Victor's LED should be Green and in full reverse it should be
red and orange when in neutral.

The only thing different is that I am tying the 3.3v line to the analog reference and
setting the analog reference to external. This shouldn't have anything to do with it
should it? This is hardwired and I would have to unsolder it where if I were to just
remove the code the arduino would have a short between 3.3v & 5 volts I think.

Anyhow, here is the simple code that I am using.

What am I going wrong?

Thanks!

*  ---------------------------------------------------------------------------------------------------------------------
   victor884servo.pde - An Arduino application for controlling two victor 884 motor controllers.
   ------------------------------------------------------------------------------------------------------------------------*/
       
#include <Wire.h>
#include <Servo.h>

// motor controller variables
int LPWM = 9;          // left motor PWM
int RPWM = 10;         // right motor PWM

Servo victorL;
Servo victorR;

void setup() {

  Serial.begin (19200);  // start serial monitor at 19200 bps
  Wire.begin ();         // join i2c bus with address 0x52

  victorL.attach(LPWM);  // set up left victor motor controller
  victorR.attach(RPWM);  // set up right victor motor controller

  // Tell Arduino to use the Aref pin for the Analog voltage - don't forget to connect 3.3v to Aref pin
  analogReference(EXTERNAL);

}


void loop() {
 
  victorL.writeMicroseconds(1000);    // set both victors to full reverse
  victorR.writeMicroseconds(1000);
  delay(5000);   // delay for 5 seconds

  victorL.writeMicroseconds(1500);    // set both victors to neutral
  victorR.writeMicroseconds(1500);
  delay(5000);   // delay for 5 seconds

  victorL.writeMicroseconds(2000);    // set both victors to full forward
  victorR.writeMicroseconds(2000);
  delay(5000);   // delay for 5 seconds

  victorL.writeMicroseconds(1500);    // set both victors to neutral
  victorR.writeMicroseconds(1500);
  delay(5000);   // delay for 5 seconds
 
}  // ------------ end of loop -------------------------
Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 30
Posts: 2246
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The documentation shows a calibration routine that you should go through to set the min and max limits.

The analogReference shouldn't affect your PWM signals.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Victors have already been calibrated and were working but for some reason are no longer working.
The only thing that I changed was the external reference but I removed this and removed the short and
they are still not working.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried setting up a PWM pulse (1ms pulse and 17 ms off) with the following code but the victors still flash an orange indicator which signifies bad PWM signal:

void setup()
{
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
}
void loop()
{
  digitalWrite(9, HIGH);
  digitalWrite(10, HIGH);
  delay(1);  // delay 1 ms - full reverse
  digitalWrite(9, LOW);
  digitalWrite(10, LOW);
  delay(17); // delay 17 ms - off time
}

I am beginning to wonder if my victore 884 comtrollers are bad....

Any ideas?
Logged

Pages: [1]   Go Up
Jump to: