They take your average run-of-the-mill pwm input... but I have no clue on how to
create code for my arduino that will control the speed of my motor with a victor.
If you have any idea on what I should do to generate this pwm signal (based on
the reading of a potentiometer) or just any pwm driving code, that would be awesome
i Use the victor 884's a lot in my robotics team (WildStang - Team 111). Sending 0 to about 120 should make it go in reverse, and 127 will keep the motor from moving. over about 134 to 255 is forward. Sorry i am not sure about the exact numbers for the deadzone around 127. Additionally i would recommend plugging in the fan to the input side of the speed controller, this way you can see if the victor is getting power just by looking at the fan. A signal driver may be needed.
Ohh a fellow national chairmans wining team :). I don't know what it does, but it said it might be needed for non-ifi controllers. If you already have it working, you don't need the signal driver. I will find out what it does tomorrow at robotics and post.
Well, I finally got the victor hooked up and my motor spinning!
The only problem is that I am using a linear pot to controll the thing...
so the pot only outputs 100 something to 800 something.
I am currently writing some code to scale my values down and
to have the motor stop in the linear pot's "idle" position (it is a
rotational yet linear pot, from an electric scooter throttle)
here's my code...
int scalepulse = 0;
void setup() {
digitalWrite(13, HIGH); //both for led "ready" indicator and victor +5v
Serial.begin(9600);
pinMode(11, OUTPUT); //signal pin
}
void loop() {
int pulse = analogRead(0); //reads my pot
if (pulse > 190) { // if motor should be driving forwards (# is bigger than lowest pot resistance)
scalepulse = pulse / 2 ; // or something to scale it down to around 234
analogWrite(11, scalepulse);
}
if (pulse < 190) { //my pot's lowest resistance
scalepulse = 127 ; //idle victor
analogWrite(11, scalepulse);
}
// Serial.print("Potvalue =");
//Serial.print(pulse);
//Serial.print("\n");
//Serial.print(scalepulse);
//delay(500);
//Serial.print("\n");
//Serial.print("\n");
//Serial.print("\n");
}