View Single Post
  #1   Spotlight this post!  
Unread 09-14-2015, 06:42 PM
1024Programming 1024Programming is offline
Registered User
FRC #1024
 
Join Date: Jan 2014
Location: Indiana
Posts: 43
1024Programming is an unknown quantity at this point
Cutting down motor power

I've encountered a problem with reducing the power on motor outputs when slowing the robot down for demos. The original lines of code are:
Lifter.lift1.set(Robot.oi.xBox.getRawAxis(1));
Lifter.lift2.set(-Robot.oi.xBox.getRawAxis(1));
which run the lift at full speed as expected. When I change it to:
Lifter.lift1.set(Robot.oi.xBox.getRawAxis(1)/(5/3));
Lifter.lift2.set(-Robot.oi.xBox.getRawAxis(1)/(5/3));
the lift runs slightly slower, which makes sense. Now where it starts making less sense. When I change it again to:
Lifter.lift1.set(Robot.oi.xBox.getRawAxis(1)*(0.6) );
Lifter.lift2.set(-Robot.oi.xBox.getRawAxis(1)*(0.6));
it runs slower than dividing by 5/3, which it shouldn't. The worst one is:
Lifter.lift1.set(Robot.oi.xBox.getRawAxis(1)*(3/5));
Lifter.lift2.set(-Robot.oi.xBox.getRawAxis(1)*(3/5));
which causes the lift to stop responding to input altogether. Has anyone else encountered this, does anyone know why this happens, and is there a way to make dividing by 5/3, multiplying by 0.6, and multiplying by 3/5 all do the same thing?
Thanks!
Reply With Quote