View unanswered posts | View active topics It is currently Thu Sep 18, 2014 1:52 pm






Reply to topic  [ 2 posts ] 
Curriculum Companion 
Author Message
Rookie

Joined: Thu Apr 17, 2014 4:54 pm
Posts: 2
Post Curriculum Companion
Hello! (First post - new licensee)

Reference YouTube video: https://www.youtube.com/watch?v=_pbVBnNMtMY
I am using the Curriculum Companion with the REMBot virtual robot. When I load the Basic Movement program Point Turns - NXT.c, compile and run, I am expecting the robot to turn right, wait and turn left. It does, but it does not end up back at the starting position. To save you time, this is a copy of the sample code (sans comments):

#pragma config(StandardModel, "RVW REMBOT")

task main()
{
wait1Msec(2000); // Robot waits for 2000 milliseconds before executing program

// Turn Right at full power for 0.75 seconds
motor[rightMotor] = -100; // Motor on motorB is run at full (-100) power reverse
motor[leftMotor] = 100; // Motor on motorC is run at full (100) power forward
wait1Msec(750); // Robot runs previous code for 750 milliseconds before moving on

motor[rightMotor] = 0; // Motor on motorB is turned off
motor[leftMotor] = 0; // Motor on motorC is turned off
wait1Msec(1000); // Robot stops for 1 second

// Turn Left at full power for 0.75 seconds
motor[rightMotor] = 100; // Motor on motorB is run at full (100) power forward
motor[leftMotor] = -100; // Motor on motorC is run at full (-100) power reverse
wait1Msec(750); // Robot runs previous code for 750 milliseconds before moving on
} // Program ends, and the robot stops
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Last edited by DrGame on Wed Apr 23, 2014 4:37 pm, edited 1 time in total.



Wed Apr 23, 2014 4:35 pm
Profile
Online
Site Admin
Site Admin

Joined: Wed Jun 11, 2014 9:59 am
Posts: 26
Post Re: Curriculum Companion
DrGame, the program that you are running is based off time. Waiting for a time period does not always reproduce the same result. One way you can get a better result is to try lowering the speed of your motors. Lowering the speed will reduce drift from the robot when it stops/changes direction. The drift, which is calculated by the physics engine, will vary, so this may be the reason why you are having problems. Another way to have more precise turns/movement is to use sensors (encoders). Encoders indicate the number of encoder ticks you have moved.

For more information on encoders, please visit ROBOTC Wiki page.
http://www.robotc.net/wiki/NXT_Motors_and_Servos_Overview#Encoder_Value


I hope this helped. If you have any more questions feel free to ask.


Thu Jun 26, 2014 11:11 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: JohnWatson and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.