View unanswered posts | View active topics It is currently Thu Jul 24, 2014 10:40 am






Reply to topic  [ 4 posts ] 
Encoder Target and time 
Author Message
Rookie

Joined: Tue Jun 18, 2013 6:04 pm
Posts: 29
Post Encoder Target and time
I'm at the first movement in Palm Island. The program I've written only gets me to the target if I nail the time factor in addition to the Encoder Target number. With the physical bots we simply allow more than ample time to reach the encoder target. With the VW bot, the bot will over shoot the target if I program too much time. Why is timing factoring in?

Code:
task main()
{
nSyncedMotors = synchBC;
nSyncedTurnRatio =100;

nMotorEncoder[motorB] =0;


nMotorEncoderTarget[motorB] = 1236;

motor[motorB] = 50;
motor[motorC] = 50;
wait1Msec(3500);



}


Fri Sep 20, 2013 8:25 am
Profile
Site Admin
Site Admin
User avatar

Joined: Tue Oct 09, 2012 10:34 am
Posts: 192
Post Re: Encoder Target and time
Hi Chris,
nMotorEncoderTarget is not currently implemented in RVW.

You can make your own version of this functionality by checking nMotorEncoder in a while loop:

Code:
nMotorEncoder[motorB] =0;

while(nMotorEncoder[motorB] < 1236)
{
    motor[motorB] = 50;
    motor[motorC] = 50;
}

motor[motorB] = 0;
motor[motorC] = 0;


--Ryan

_________________
Ryan Cahoon
CMU Robotics Academy
RVW Software Developer

Robot Potato Head; Virtual NXT


Fri Sep 20, 2013 12:27 pm
Profile
Rookie

Joined: Tue Jun 18, 2013 6:04 pm
Posts: 29
Post Re: Encoder Target and time
Will the while loop encoder program work with the RVW or does RVW only work with time and speed?
Thanks for your help.
Chris


Sat Sep 21, 2013 5:05 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 172
Post Re: Encoder Target and time
Yes, the while loop encoder will work in RVW.


Sun Sep 22, 2013 11:22 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users 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.