View Single Post
  #4   Spotlight this post!  
Unread 23-06-2002, 22:46
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: Programing help...

Posted by Rick Berube.

Engineer on team #121, Rhode Warriors, from Middletown H.S..

Posted on 1/22/2000 8:27 PM MST


In Reply to: Programing help... posted by Adam Anderson on 1/22/2000 2:07 PM MST:



: I am a student programer, and i am looking for a way to do a timer in the stamp to fire a motor for a certian amount of time, but i am at a loss of a way to do this, i thought i would create a counter that counts the cycles of the program, but i can not find out how many cycles per second that the controlers CPU can do... anyone have any info on this method or any other methods that could accomplish this task...
: -Adam Anderson-

Adam, the Delta_T variable available to you is about 1/40th of a second granularity at best, so if your talking about having to control something much slower, your probably OK using this method of crude time. I believe Delta_T is defined as a measure of when the Robot Controller (Master processor) receives the data from the Operator Interface. I'm pretty sure that it should always be equal to one, unless one of two things happen. 1) master CPU receives invalid data (noisy/corrupted data likely); 2) your PBasic program has taken too long to loop and one or more Delta_T ticks has elapsed in the process. You should check with Innovation First to ensure my definition of Delta_T here is correct however.

If you are looking to fire a motor for a certain amount of time however, there are several instructions which will allow you to delay your loop for a precise amount of time. The PAUSE statement for example, provides 1mS granularity, the SHIFTOUT on the order of 25 uSec! You have some options here, provided your willing to keep track of your own time within the loop! Hey DOS did it! (but you are probably too young to know about DOS

I also believe there is nothing stopping you from using more than one SEROUT() and or SERIN() statement in your program! Keep in mind you must execute the proper SERIN() statement in your program at least once every 150-170 mS, or the Robot Controller will reset itself thinking your Pbasic program has crashed!! Keep an eye on the Basic Run Err and Basic Run LEDs on your Robot Controller to watch for this condition.

Hope this helps,

Rick Berube



__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.