Setting Individual Motors
Page 1 of 1

Author:  skip_thurm [ Wed Sep 30, 2015 4:25 pm ]
Post subject:  Setting Individual Motors

Hey everyone! I am working with a class using Vex Cortex controllers and we are running into trouble with programming the motors. We have one motor running directly into the cortex and one connected with a motor controller. When we try to simply program the robot with the `forward` command, the motors run at a different power and it veers off. We tried setting each motor's power with the `setMotor` command, but it didn't work. We are rather new to the programming aspect of robotics, so I am sorry if this problem is simple. I would appreciate any help!

Author:  JohnWatson [ Thu Oct 01, 2015 9:19 am ]
Post subject:  Re: Setting Individual Motors

Would you be able to post your code (including the #pragma statements at the top of the code) using the [code] tags for us to take a look at? We'll need this information to help debug what this problem could be.

Thank you in advance!

Author:  CARBOT [ Thu Oct 01, 2015 12:50 pm ]
Post subject:  Re: Setting Individual Motors

Any chance one has the high speed internal gear and the other does not?

Author:  skip_thurm [ Thu Oct 01, 2015 3:53 pm ]
Post subject:  Re: Setting Individual Motors

Here is the code:

#pragma config(Motor, port4, rightMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, leftMotor, tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard

task main()
        setMotor(port4, 50);
        setMotor(port10, 100);
        forward(10, seconds, 100);

Our thinking was that we could set different motor speeds and that would balance them out and prevent the robot from veering, but they both just run at the same speed. We also began messing around with the Natural Language PLT commands. Either way, all of this is being done in the graphical interface.

None of our motors have the high speed internal gears.

Author:  Tabor473 [ Sat Nov 07, 2015 7:38 pm ]
Post subject:  Re: Setting Individual Motors

Okay so the forward command runs the motors attached to the drive train at the same power. What you are effectively saying is
Run at different power values.
Then roughly 1 tenth thousand of a second later telling the motors to run at the same power for 10 seconds.

setMotor(port4, 50);
        setMotor(port10, 100);

This code happens and the motor is set BUT the next line of code happens almost immediately. Try adding a wait block after setting the power instead of the forward block
setMotor(port4, 50);
setMotor(port10, 100);
wait(10, seconds);

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group