View Single Post
  #8   Spotlight this post!  
Unread 12-03-2008, 11:27
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Inverting the direction of a Motor

Quote:
Originally Posted by GRS View Post
pwm01 = 255 - pwm01
That should be 254, not 255. The valid range of pwm values is 0-254, and the "neutral" value is 127.

Quote:
Originally Posted by Tom Bottiglieri View Post
PHP Code:
pwm01 p2_y;
pwm02 = ~p2_y
This flips all of the bits, so realistically it does the same as (255-pwm01).
True, but that's not the desired function.

Quote:
Originally Posted by SlimBoJones View Post
These might seem unrelated, but be sure to calibrate your speed controllers when you do this.

The reason is, the Victors don't seem to behave exactly the same backwards and forwards out of the box. We've noticed that setting a PWM to 178 and 78 don't produce close to the same speeds in opposite directions... until you calibrate the Victor.
Your example numbers aren't quite right. 178 is neutral plus 51, and 78 is neutral minus 49.

But you're right about the problem -- the Victor factory calibration is a little off from the IFI pwm outputs, with its actual neutral point at more like 132. That makes your forward value at plus 46, and your reverse value at minus 54...until you calibrate the Victor.