Am I using RotationNavigator properly?

This is where you talk about the RCX software itself, installation issues, and programming talk.

Moderator: roger

Am I using RotationNavigator properly?

Postby dankoc » Sun Feb 04, 2007 11:52 pm

Hi!

I am trying to use build a robot using the RotationNavigator class. I'm sure I'm just doing something stupid ... It requires one motor connected to a wheel on each side, no?

Running the following commands:
RotationNavigator Nav = new RotationNavigator(2f, 10.23f, 1.5f, Motor.A, Motor.C, Sensor.S1, Sensor.S3);
Nav.travel(15);

The robot SHOULD travel forward ~15cm and stop. Instead, the robot turns on, goes forward for a fraction of a second, and then either the right, or left motor continues running forward, but the other motor stops running (which motor stops seems to be a random event).

Alternatively, this code runs the bot forward with panache!
Motor.A.forward();
Motor.C.forward();
try{ Thread.sleep (100000);} catch(InterruptedException e) {}

The robot is similar to trilobot (plans: http://www.phptr.com/articles/article.a ... Num=4&rl=1), except he uses the rotation sensors instead of touch sensors, and the gears are different.

Robot Gearing:
Each motor is connected to the largest gear (32 tooth?). This gear turns a 24 tooth gear that turns each wheel (separately). The rotation sensor is connected to the motor gear by a 16 tooth gear. Like Trilobot, the robot can turn in its foot print if one motor is turned forward, and the other one is turned reverse.

I've tried turning the leads on the rotation sensors (to make certain they are recording forward as the car goes forwards) and the same problem occurs with all combinations of rotation sensor leads.

Any suggestions? Thanks in advance!
dankoc
New User
 
Posts: 2
Joined: Sun Feb 04, 2007 11:15 pm

Postby bbagnall » Mon Feb 05, 2007 8:36 pm

You've probably got your wires connected to the motors in a strange way (it matters - e.g. rotate 90 degrees and try again) or the motors are pointed in strange directions.

What's happening is the Navigator class starts rotating the motors, sees that one motor rotation count is less than the other and stops one motor while waiting for the other motor to catch up. Since it is going in the opposite direction it will never catch up, hence one motor spins forever.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Working!

Postby dankoc » Wed Feb 14, 2007 8:41 pm

Hi!

Switched wires both motors around and it's working backwards! I will do some more playing with it later and see if I can get get myself to understand fully, but for now I am just writing the program using -distance.

Thanks so much for the help!
Charles
dankoc
New User
 
Posts: 2
Joined: Sun Feb 04, 2007 11:15 pm


Return to RCX Software

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff