A Neat Victor Fix

I posted this at the end of the “Bizarre driving issue” thread, but so far only one person replied and I thought a lot of teams may be interested in this:

Everyone has been talking about these “asymmetrical” deadzones, where one victor picks up speed more slowly in one direction, but not the other, but no one has ever found a good solution outside of lookup tables, or complicated sensors.

Has anyone ever tried recalibration of the Victors? It seems like the factory default position for the victors is not quite perfect for the ifi controller. We set up this simple code like so:


void Process_Data_From_Master_uP(void)
{
	Getdata(&rxdata);
		if(p1_sw_trig == 1)
			pwm01=pwm02=pwm03=pwm04=254; // note: change these pwms to match the pwms connected to victors
		else if(p1_sw_top == 1)
			pwm01=pwm02=pwm03=pwm04=0; // note: change these pwms to match the pwms connected to victors
		else
			pwm01=pwm02=pwm03=pwm04=127; // note: change these pwms to match the pwms connected to victors
	Putdata(&txdata);
}

And then ran the Victor calibration like this:

A quick warning that you should either calibrate all of the victors on your robot at once (because the victors don’t send any signals to the motors while calibrating), or disconnect all your motors.

Originally Posted by IFIRobotics 884 Users Manual
The Victor is pre-calibrated to values compatible with an
IFI Control System and re-calibration is not needed.
You can re-calibrate to achieve ‘full forward/reverse’
from your joystick movement if necessary.
NOTE: While in calibration mode, the Victor will
record the max PWM value detected as ‘full forward’,
the min PWM value as ‘full reverse’, and ‘neutral’ will
be the PWM value recorded at the release of the Cal
button. The following steps will guide.
User Calibration:

  1. Power ON the speed controller.
  2. Press and hold the Cal button. After a moment, the
    LED indicator on the Victor will begin alternating
    between RED and GREEN to indicate a cal mode.
  3. While continuing to hold the Cal button, move the
    joystick to the maximum and minimum positions.
    This can be done in any order and as many times as
    desired.
  4. While continuing to hold the Cal button, return the
    joystick to center (neutral position).
  5. Release the Cal button.
  6. A flashing GREEN indicator confirms a successful
    calibration.
  7. A flashing RED indicator denotes an unsuccessful
    calibration.
    An unsuccessful calibration occurs when either:
    a) Insufficient joystick travel was detected in forward
    and/or reverse.
    b) The trim tab is too far from center.
    Resetting Calibration to Factory Pre-calibration:
  8. Power OFF the speed controller.
  9. Press and hold the Cal button.
  10. While continuing to hold the Cal button, Power ON
    the speed controller.
  11. A flashing GREEN indicator denotes calibration is
    reset. Release the Cal button.

Make sure that you use the provided code (or something similar) and whatever you do don’t recalibrate directly from a joystick axis because any imperfections in the joystick (like being slightly off-center, or not reaching 254 and/or 0) will ruin the calibration and make your deadzones worse, not better.

The wheels now seem to have none of the strange speed difference between forwards and backwards. Anyone else want to give it a try and report results?

[LEFT]Hmmm…

This reminds me a lot of THIS white paper… Nonetheless, that is an awesome Idea, and your code seems really simple.
[/LEFT]

Well you don’t need to run through ALL the values, calibration just involves hitting a maximum and a minimum as many times as you please, and then when you’re finished, you simply stop at 127, and let go of the cal button.

That’s another side-note, make sure that you aren’t pressing ANY buttons when you stop calibrating. That way 127 is the center, not anything else.