Quote:
|
Originally Posted by ForgottenSalad
By that I mean what I would have to add to the pwm01 = p1_y;
|
You need to provide a "transfer function" which will convert the joystick setting to PWM output for the Victor speed controller. It could look something like the following:
pwm01 = PctSpeedToPWM(p1_y);
Be advised that the response of the Victor speed controllers is HIGHLY nonlinear with respect to the PWM input values. From my tests, it's essentially exponential, that is, linear when plotted on semilog paper. The actual curve is dependent on robot weight, wheel friction, drive train friction, etc, so your mileage may vary. On our robot we get about 90% of speed at 44% of PWM range. I've attached a picture of the measured data.
On our robot, we use table of points forming a piecewise linear function that is interpolated. This allows much greater sensitivity under joystick control than using the straight IFI default code method you currently have. By playing with the transfer function, you can make the robot speed linear (or very nearly) with respect to the joystick. Biased so that it's less sensitive at low speed, for instance doing fine aiming in this year's game or tweaking putting a tetra on the goal in last year's game. Or it could be twitchy at low speed and have more sensitivity at high speed if you need it.