|
Re: programing the vex optical shaft encoder
your program assumes that all the motors go exactly the same speed and stop/start immediately.
you need to take inertia of your system into account.
looks like a typo for the compare value of rot_encoder2: rot_encoder2 < 2 should probably be rot_encoder2 < 20 (in several places)
try evaluating each encoder value separately and turn the corresponding motor off when that encoder reaches the desired value.
you may also need to accelerate and decelerate the motors rather than just a hard stop and start to reduce overshoot.
__________________
FRC 623 2003,2004,2005,2006,2007,2008, 2009, 2010, 2011
FRC 1900 2007
FVC 60 and 193 2006
FVC 3271 2007
FTC 226 and 369 2008, 2009, 2010, 2011
FTC 3806 2010
|