View unanswered posts | View active topics It is currently Tue Sep 02, 2014 12:16 am






Reply to topic  [ 5 posts ] 
Is there a formula for this? 
Author Message
Rookie

Joined: Fri Nov 18, 2011 1:59 pm
Posts: 6
Post Is there a formula for this?
So, I finnally got the RobotC virtual Worlds up and running properly on a computer. I like the way it works. I can see it being a major tool in the future for programing for competition.

But, one thing seems to be the problem. The amount of seconds I have to plug in for the Robot to move across the board seem unrealistic. they also seem incredibly unrealistic for someone doing an auntonomous program (some of the motions of are way over 30 seconds).

What do you all thing I can do about this? Is it something wrong with my code? My code is below!

Merry Christmas too all! and thanx for all the help!!

#pragma config(Hubs, S1, HTMotor, none, none, none)
#pragma config(Sensor, S1, , sensorI2CMuxController)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, openLoop, reversed)

task main()
{
{
motor[motorD] = 50; // Motor D is run at a power level of 50.
motor[motorE] = 50; // Motor E is run at a power level of 50.
wait1Msec(26000); // The program waits 26000 milliseconds (26 seconds) before running further code.
}
{
motor[motorD] = 50; // Motor D is run at a power level of 50.
motor[motorE] = 0; // Motor E is run at a power level of 50.
wait1Msec(25000); // The program waits 25000 milliseconds (25 seconds) before running further code.
}
{
motor[motorD] = 50; // Motor D is run at a power level of 50.
motor[motorE] = 50; // Motor E is run at a power level of 50.
wait1Msec(88000); // The program waits 88000 milliseconds (88 seconds) before running further code.
}
}


Sat Dec 17, 2011 10:47 pm
Profile
Novice

Joined: Thu Apr 17, 2008 6:04 am
Posts: 70
Location: Plymouth, Indiana, USA
Post Re: Is there a formula for this?
Hello,
I am a novice programmer, but have one suggestion.
The limit for wait1Msec is 32767 (2 to the 15th power, starting to count with zero the first element). If the limit is exceeded no warning is given when compiling (at least in RobotC for the real world), but an out of range number may do unpredicable things. The last wait1MSec of 88000 may be causing a problem. Suggest using wait10Msec -which gives 10 times the duration of wait1Msec. -So 88000 would become 8800 (well within the 32767 allowed).

Merry Christmas,
Dave

_________________
Dad (Dave) and Adam


Sun Dec 18, 2011 6:45 am
Profile
Rookie

Joined: Fri Nov 18, 2011 1:59 pm
Posts: 6
Post Re: Is there a formula for this?
Thank you so much for a responce! I actually didn't know that.

But, during the auntonomous part of the game, all of it must be done in thirty seconds. This doesn't seem to change the amount of tame it takes to do what I am asking. (which isn't much).

It still takes 90 seconds to move across the field, which is in no way realistic.

Any other suggestions?


Sun Dec 18, 2011 6:39 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Is there a formula for this?
Well, you are running your motors at half power, but it still shouldn't be taking that long. Try running your motors at full power and see what happens.

_________________
sudo rm -rf /


Sun Dec 18, 2011 6:53 pm
Profile
Site Admin
Site Admin

Joined: Thu Jul 05, 2007 12:45 pm
Posts: 35
Location: Carnegie Mellon
Post Re: Is there a formula for this?
Hi Folks,

We found the bug in our code and will be posting a new build that addresses the problem with programming using timing as a control function. Luckily you do get much better results using feedback from sensors. Sorry.

There are multiple improvements with the "Operation Reset" programming game that can be downloaded at the www.rvw.robotc.net page. I expect that we will have a new release that takes care of the timing in February.


Mon Dec 19, 2011 6:19 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.