# Drive Function in EasyCPro, anyone?

Hello everyone! Our programming team is moving along progressively, but we still can’t figure out what the numbers on speed and direction in the Drive Function exactly do.

We understand that making speed 20, and direction 0 will make the robot go forward… and we’ve also read over the tutorial on “USING LIBRARIES,” but we’re not quite sure how to effectively control the speed and direction of the robot… if you have any knowledge on these two factors, please share! It will be greatly appreciated by our team.

Thank you!~JustineSHA

Speed = How fast to go
Direction = Which way to go

Drive ( 0 , 20) ; Speed is 0 (no forward movement) , Direction is 20 Turn
Driver ( -40 , 0 ) Drive Backward 40 , Direction is 0 (no turning)

Speed and direction range are 127 to -127
0 = Neutral

Thank you! We were also thinking along those lines… however, we also don’t understand why at (20,0) one motor is faster than the other, and we move backwards. We’ve double checked the PWM assignments and everything seems to be functioning properly- except the drive function.

We were also wondering what numbers exactly signify a left turn and right turn.

The proper direction of motor control depends on which way you’ve wired your motors. The code can’t know that unless you tell it. Isn’t there a check box or two in the Drive setup block to select “reverse direction” on the output motors? One of them is probably checked. It sounds like you need to uncheck that one and check the other.

There are two common reasons for one motor to be faster than another with the same pwm control value. Some motors have a direction bias, and turn “forward” faster than they turn “backward”. You probably have the motors mounted so one has to turn in the other direction from the other in order for both sides of the robot to go the same way, right? But you also probably are using the CIM

motors for your main drivetrain, and those don’t have a significant bias.

The other likely reason is that the Victor calibration thinks that neutral is a little bit higher than the 127 value the Robot Controller is putting out. If you go just a small amount away from neutral on the RC, and you’ve told the software that “forward” is one way on one motor and the other way on the other motor, one Victor sees a smaller “plus” control and the other sees a larger “minus” control. You can probably fix this by calibrating the Victors; the procedure is in the Victor 884 Users Guide on the IFI

web site.