I am trying something that has not been done with vex iq. THIS IS NOT FOR COMPETION USE. I am doing a 4 motor drivetrain with mecanum wheels. That I would like to be able to strafe. Along with a 110 rpm pitching machine and ball intake. I need some help coding it. I did FTC in high school and I am trying to do what I did there but with the vex iq kit to see if it is even possible. I am using 7 motors.
Here is the layout of it:
Left Motor drivetrain ports- port 5 and 6
Right Motor drivetrain ports- port 11 and 12
Pitching Machine ports- ports 6 and 10
Intake port- port 2
If I could get some help with these that would be amazing. I am in college now and I know my mechanical stuff really well but I don’t know very much about coding. If I could get some help coding I would greatly appreciate it. I know this may not be possible but I would really love to see my FTC experiences finally come to life with vex iq to be able to share how FTC ideas can be accomplished with the vex iq kit.
Exactly how you set it up is down to personal preference, but let’s assume that A is forwards/backwards. B is strafe and C is rotate left and right (axis as they appear on the IQ controller labels)
The basics of each motor speed would be:
Front right motor = A - C - B
Back right motor = A - C + B
Front left motor = A + C + B
Back left motor = A + C - B
I am planning on using vexcode iq just because I don’t have much coding experience. My thoughts for controlling would be using A for forwards and backwards. B for left and Right. C for strafing.
OK. Try making a start using the logic above then let us know how you get on. The program logic in blocks will be something like:
spin frontLeft motor forward
spin frontRight motor forward
spin rearLeft motor forward
spin rearRight motor forward
forever{
set frontLeft velocity to (A + B + C)
//will let you work out the others
}
So outside your loop, you’ll set all motors to go forward. Sounds illogical initially, but when your code gets inside the loop you’ll see that with the joysticks neutral, all motors will have a velocity of 0 so won’t move. As you move the joysticks, some will get positive values and some will get negative.
You need to be careful though, before you jump in trying holonomic code, write some code for a basic tank drive just to sanity check that all your motors go in the right direction. Use the sliders under each motor in the device menu if you need to reverse any.
My bad, I didn’t see that. But pretty much, to strafe left, you have the front left and bottom right motors moving reverse, and the front right and bottom left motors moving forward, and vice versa to strafe right.