Pages: [1]   Go Down
Author Topic: Victor 883 motor controllers  (Read 3366 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

Has anyone successfully been able to drive Victor 883 motor controllers with the Arduino?

It has been hit and miss for me where I was able to get the Victor spinning a motor once but can not do it consistently. Is there a timing or value limit on this device that affects how the arduino needs to control it?

Typically, the victor operates with a pwm of 0 for full reverse and 127 for neutral and 255 for full forward but I am wondering if the arduino has the capability of driving the victor at its extremes or if there is a range that it can only drive the victor. (i.e. 80 - 200 PWM)

The other question is whether there needs to be some sort of a delay on the arduino or not when controlling the victor.

Any info on this is appreciated
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 360
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm fairly certain the Victor uses RC "PWM", which isn't really PWM in the Arduino sense.  Use the Servo library instead, and uses writeMicroseconds between 1000 (full rev) and 2000 (full fwd), with 0 at 1500.  Experiment a bit - use a potentiometer to figure out the correct values for everything. 

PWM in Arduino refers to duty-cycle modulation, giving a square-wave output suitable for directly driving LEDs and/or motor H-bridges, while the Victor is expecting RC pulses, which are a 1ms to 2ms pulse every 20ms, where the pulse length is proportional to the joystick position (a form of PPM).  The Servo library will handle it all for you.
Logged

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

Thanks for the info!

Is there a white paper or some document available that describes the
Servo Library, its commands, and how to use it?
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 360
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.arduino.cc/en/Reference/Servo is the reference page for the Servo Library.  It is admittedly somewhat awkward to be referring to a motor controller as a servo, but it's the easiest way to generate the correct output.  

Basic usage is as such:

Code:
#include <Servo.h>

#define VICTOR_PIN // the pin that the victor's signal line is attached to

Servo victor;

void setup() {
  victor.attach(VICTOR_PIN);
}

void loop() {
  victor.writeMicroseconds(1000); // drive full reverse
  delay(1000); // wait a second to see the effect
  victor.writeMicroseconds(2000); // drive full forwards
  delay(1000); // wait a second to see the effect
}
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If your motor controller takes standard RC servo PPM control signals, you might try the below code for testing.

Code:
// zoomkat 10-4-10 serial servo test
// type servo position 0 to 180 in serial monitor
// for writeMicroseconds, use a value like 1500
// for IDE 0019 and later
// Powering a servo from the arduino usually DOES NOT WORK.

String readString;
#include <Servo.h>
Servo myservo;  // create servo object to control a servo

void setup() {
  Serial.begin(9600);
  myservo.attach(7);  //the pin for the servo control
  Serial.println("servo-test-21"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    delay(1); 
    if (Serial.available() >0) {
      char c = Serial.read();  //gets one byte from serial buffer
      readString += c; //makes the string readString
    }
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string
    int n;
    char carray[6]; //converting string to number
    readString.toCharArray(carray, sizeof(carray));
    n = atoi(carray);
    myservo.writeMicroseconds(n); // for microseconds
    //myservo.write(n); //for degees 0-180
    readString="";
  }
}
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

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

My code was initially set up to write a PWM to a PWM output pin with 0 as full reverse, 127 as neutral and 255 as full forward.

Can I somehow set the timer so that it only outputs pulses in a 1ms - 2ms range so that I can use the analogwrite with the PWM value to control the victor

OR

Is there an easy way for me to convert the 0 - 255 values to 1000 - 2000 milisecond values needed for use with the servo write  command (which will require a PWM of 127 to calculate to 1500 microseconds)?

Which is easier and does anyone have any tips on how to do this?

thanks
« Last Edit: April 22, 2011, 10:26:14 am by irethedo » Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 360
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Use the map(x, in_min, in_max, out_min, out_max) function:

Code:
myServo.writeMicroseconds(map(originalPWM, 0, 255, 1000, 2000));
Logged

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

Quote
myServo.writeMicroseconds(map(originalPWM, 0, 255, 1000, 2000));

That is simply brilliant and works very well at scaling my PWM values to what is required for the
victors - Thank you!

« Last Edit: April 23, 2011, 09:27:17 am by irethedo » Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 360
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No problem - I hope your project is successful!
Logged

Pages: [1]   Go Up
Jump to: