I have made an omnidrive.
*6 motors total
*4 motors on the corners to go from side to side
*1 motor to go forward and backward between the two wheels on the left side and another on the right side.
*The drive can go side to side, up and down, diagonally and also rotate with my code.
*The code is designed so that the robot can move any direction you move the left thumb stick in. And rotate clockwise or counterclockwise when moving the left thumb stick either right or left.
I am using this code. The code theoretically should work and it does, but for some reason the motors start jerking as the drive moves. Now the first set of codes u will see are the original programing. With this set all functions of the drive work but the motors jerk. The second set of codes (once i comment out[or delete] the set of codes that allow the bot to rotate) allow the drive to move freely with no jerk. The only problem is that the drive can not rotate.
ANY HELP/SUGGESTION IS WELCOMED. THANK YOU
***Code Legend:
The code is colored so it looks exactly like it should on easyC
Blue is Code
Green is Comment
CODE SET 1 (Jerks, Rotation Enabled)
#include “Main.h”
void OperatorControl ( unsigned long ulTime )
{
while ( 1==1 )
{
// Lift
MotorRcControl ( 0 , 6 , 7 , 0 ) ;
// Intake
MotorRcControl ( 0 , 5 , 8 , 0 ) ;
// Forward/Back
MotorRcControl ( 0 , 3 , 2 , 1 ) ;
MotorRcControl ( 0 , 3 , 5 , 0 ) ;
// Left/Right
MotorRcControl ( 0 , 4 , 1 , 1 ) ;
MotorRcControl ( 0 , 4 , 3 , 0 ) ;
MotorRcControl ( 0 , 4 , 4 , 1 ) ;
MotorRcControl ( 0 , 4 , 6 , 0 ) ;
// Rotate
MotorRcControl ( 2 , 6 , 1 , 1 ) ;
MotorRcControl ( 2 , 6 , 2 , 1 ) ;
MotorRcControl ( 2 , 6 , 3 , 1 ) ;
MotorRcControl ( 2 , 6 , 4 , 1 ) ;
MotorRcControl ( 2 , 6 , 5 , 1 ) ;
MotorRcControl ( 2 , 6 , 6 , 1 ) ;
}
}
CODE SET 2 (Does NOT Jerk, Rotation Disabled)
#include “Main.h”
void OperatorControl ( unsigned long ulTime )
{
while ( 1==1 )
{
// Lift
MotorRcControl ( 0 , 6 , 7 , 0 ) ;
// Intake
MotorRcControl ( 0 , 5 , 8 , 0 ) ;
// Forward/Back
MotorRcControl ( 0 , 3 , 2 , 1 ) ;
MotorRcControl ( 0 , 3 , 5 , 0 ) ;
// Left/Right
MotorRcControl ( 0 , 4 , 1 , 1 ) ;
MotorRcControl ( 0 , 4 , 3 , 0 ) ;
MotorRcControl ( 0 , 4 , 4 , 1 ) ;
MotorRcControl ( 0 , 4 , 6 , 0 ) ;
// Rotate
//MotorRcControl ( 2 , 6 , 1 , 1 ) ;
//MotorRcControl ( 2 , 6 , 2 , 1 ) ;
//MotorRcControl ( 2 , 6 , 3 , 1 ) ;
//MotorRcControl ( 2 , 6 , 4 , 1 ) ;
//MotorRcControl ( 2 , 6 , 5 , 1 ) ;
//MotorRcControl ( 2 , 6 , 6 , 1 ) ;
}
}