Setting up a Victor 888 with an arduino

We are building a second shooter from spare parts, and we are using an arduino microcontroller.

The box on our arduino says that we have Digital I/O pins, and 7 of them have PWM.

We are using a Victor 888 motor controller.
We would like some advice/suggestions/guidance on the wiring for this setup.

I am using that the PWM cable has a + (red), a - (black) and a signal wire (the other color).

So I’ve got it setup for 5v, ground, and a digital i/o pin with PWM on it.

We know that we have to calibrate the Victor to the appropriate max, min, and neutral values from our microcontroller.

Our idea right now is to use the builtin Servo library in the arduino, because that uses PWM.
So we want to calibrate the victor to recognize 0 as full reverse, 90 as stop, and 180 as full forward (the range for an arduino servo is 0 to 180).
I read the user guide for the victor, and it says to hold down the CAL button to calibrate, and that we should see red and green alternating lights. We did that, and we didn’t see any lights, but we tried to calibrate it anyways.

We’ve set it up so our arduino sends a signal (0 to 180) that is proportional to the values from a potentiometer that we’ve got set up.

Either way, our motors are not moving with our setup and we have no idea what to do.

Any ideas?

Also, I wasn’t sure whether to put this in Electrical or Programming, because there is a lot of overlap.
Should I also post this in programming?
I think I need help from someone who is knowledgeable with arduino, and someone who is knowledgeable with electronics.

Also, I found someone who was trying to do something similar, and they took a similar approach
Hopefully this helps (the bottom page comment):

( The last comment on that thread shows that they did the exact same thing I did, but mine didn’t work.

I setup something similar this year for basic open loop shooter and mechanism testing. Ours consisted of a Teensy, a potentiometer hooked to an analog input, and a PWM output using one of the pwm libraries. To help identify center on the pot (for calibration, and for setting neutral output), I set the integrated LED to light when the potentiometer is within 2% of mid-range. We successfully used this to run both jaguars and victor 884’s, there’s no reason it shouldn’t work for 888’s as well.

Could you post your code, and maybe a photo showing how you have it connected?

For the victor, you shouldn’t need the +5 wire, just signal and ground.

I found the best way to test and troubleshoot my arduino sketch was by driving a hobby servo (a vex servo would work too). Once you get that working correctly then it should work with a victor once you complete the calibration sequence

I don’t have my sketch readily available, but I may be able to pull it up tonight for reference.

I actually did this for our driverstation this year, only used a Jaguar. We had tried a Victor 884 (Which never worked with our cRIO fully; the victor is very silly, we got it to work a few times… otherwise it does weird things.) to no success except one instance of calibration.
A few things:

  1. Check that your wiring is correct. There is a skematic on this page which is full of doing somewhat what you want right now (Jag instead of victor; but they work the same(ish)), verify that it is the same:

  2. Check the victor indicator light. Is it blinking orange as if it is unsignaled? Is it solid orange, as if there is a signal, but not a signal to move? Knowing this would help us more.

  3. The 5V pin running to the victor/jaguar is unneeded. Save yourself a little wiring chaos (Shorts from pins being close) and don’t wire it up.

  4. What is your code? You sure you’re doing everything right?

Hopefully this is only for testing; if you are planning on using this on your robot please read R55 and the blue box beneath it. You didn’t say you are planning on using this on your robot, but you didn’t say you weren’t, either. So forgive me if you already know, but I don’t want you to be surprised. And I don’t want anyone else to be, either, if they decide to do something like this on their bot.

I am a newbie when it comes to arduino programming, or any programming for that matter, but I was able to make a Victor work somewhat. It actually ran a small motor in both directions with sort of jerky speed control.

I used "include <servo.h> which pulls in the servo function from the library.
I used “myservo.attach(9)” so set the output on a PWM pin.
I also used the “map” function to convert joystick values to the 0 to 180 that the Victor needs. This is key.
I used myservo.write(val) to send the value to the Victor.

I hesitate to upload the whole code because I have included a lot of junk to overcome a very noisy and non-linear joystick.

Hope this helps.

Also consider the output rate of the Servo algorithm. A typical hobby servo wants a new pulse every 20ms, but I think the victors want a new pulse every 5ms. You may need to tweak some timing to get it to work.

I believe the WPILib code for the Victors has a default of 10ms. It can be made faster or slower if you want.