|
trathier
Rookie
Joined: Thu Nov 01, 2012 1:59 pm Posts: 1
|
 4 Wheel Omni-drive help
The Setup We are looking at programming a drive system that consists of 4 driven omni wheels. One on each side of the robot. (see attached diagram) This allows forward, backward, left and right slide and rotation left and right.
The Problem When we add the code for rotation the motors do not run smoothly, it seems to stutter as it turns.
The Program #pragma config(Motor, port2, RightMotor, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port3, BackMotor, tmotorServoContinuousRotation, openLoop) #pragma config(Motor, port4, LeftMotor, tmotorServoContinuousRotation, openLoop, reversed) #pragma config(Motor, port5, FrontMotor, tmotorServoContinuousRotation, openLoop, reversed) #pragma config(Motor, port6, RightArmMotor, tmotorVex393, openLoop) #pragma config(Motor, port7, LeftArmMotor, tmotorVex393, openLoop, reversed) #pragma config(Motor, port8, Bucket, tmotorServoContinuousRotation, openLoop)
task usercontrol() { // User control code here, inside the loop
while (true) { { //Move forward and backward { motor[port2] = vexRT [Ch3]; motor[port4] = vexRT [Ch3]; } //Move side to side { if (vexRT [Ch1] == 0) motor[port3] = vexRT [Ch4]; motor[port5] = vexRT [Ch4]; } //Turn left and right { if (vexRT [Ch1] != 0) motor[port3] = -vexRT [Ch1]; motor[port5] = vexRT [Ch1]; } } } }
_________________ Todd Rathier Mentor Leominster High School - CTEi Devil Dawgs Robotics Team
|