View unanswered posts | View active topics It is currently Sun Jul 31, 2016 5:45 am

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Is there a formula for this?
Author Message
Rookie

Joined: Fri Nov 18, 2011 1:59 pm
Posts: 6
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)

{
{
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
Novice

Joined: Thu Apr 17, 2008 6:04 am
Posts: 70
Location: Plymouth, Indiana, USA
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

_________________

Sun Dec 18, 2011 6:45 am
Rookie

Joined: Fri Nov 18, 2011 1:59 pm
Posts: 6
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
Moderator

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
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

Joined: Thu Jul 05, 2007 12:45 pm
Posts: 35
Location: Carnegie Mellon
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
Display posts from previous:  Sort by
 Page 1 of 1 [ 5 posts ]

Who is online

Users browsing this forum: No registered users and 1 guest

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

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning