Go to Post Remember to ALWAYS use physics in engineering discussions. There is really no room for "feelings" in this sort of thing. - JVN [more]
Home
Go Back   Chief Delphi > Old Forum Archives > 2001
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-06-2002, 00:44
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
Counter loop

Posted by Eric at 2/12/2001 5:24 PM EST


Coach on team FEDS from RHS sponsored by Visteon.



If you want to time a motor out (say run it for 1 second and stop) and you wanted to do it more accuratly than simply counting loops (presumably bad data could thow this method off) what would the progam code look like? (I'm trying to get a handle on the delta_t kind of thing.)



__________________
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.
  #2   Spotlight this post!  
Unread 24-06-2002, 00:44
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: Counter loop

Posted by Joe Ross at 2/12/2001 7:14 PM EST


Engineer on team #330, Beach Bot, from Hope Chapel Academy and NASA/JPL , J&F Machine, and Raytheon.


In Reply to: Counter loop
Posted by Eric on 2/12/2001 5:24 PM EST:



: If you want to time a motor out (say run it for 1 second and stop) and you wanted to do it more accuratly than simply counting loops (presumably bad data could thow this method off) what would the progam code look like? (I'm trying to get a handle on the delta_t kind of thing.)

delta_t is the number of data packets that you missed.

to be able to time things you should use the following idea:

counter = couter + 1 + delta_t

If delta_t is 0 then no data was lost and your program loop is less than 1/40th of a second. If delta_t is not zero, then you missed that many packets.

using this code, when the counter reaches 40 then 1 second has passed.


__________________
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.
  #3   Spotlight this post!  
Unread 24-06-2002, 00:44
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: Counter loop

Posted by Rick Berube at 2/16/2001 12:16 AM EST


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


In Reply to: Re: Counter loop
Posted by Joe Ross on 2/12/2001 7:14 PM EST:



Actually, I observed the loop time between consecutive cylces vary between alternate cycles even with a stripped down version of the default program. We were transferring no more than 8-10 bytes (I don't remember exactly how many) between the player station & robot at the time. We measured 20-30 mS periods by simply toggling the state of the PWM signal at a relay channel every time through the main loop. We attached a scope to the channel and observed the period of PWM signal change from 20mS to 30 mS and continuously repeat. We also monitored delta_t during this time, using a debug statement to print a message whenever delta_t was not equal to zero, and never once saw the message!
I didn't dig into it any more, I just made note of it. I wonder if one were to monitor the serial stream between the receiver and RF modem, if they would see the same delay in the data stream or if the delay is incurred inside the receiver.

Rick



__________________
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.
  #4   Spotlight this post!  
Unread 24-06-2002, 00:44
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
FYI: re. OI/RC Communications

Posted by Nate Smith at 2/16/2001 11:07 AM EST


Other on team #66, Frostbite, from Willow Run High School and GM Powertrain.


In Reply to: Re: Counter loop
Posted by Rick Berube on 2/16/2001 12:16 AM EST:



: Actually, I observed the loop time between consecutive cylces vary between alternate cycles even with a stripped down version of the default program. We were transferring no more than 8-10 bytes (I don't remember exactly how many) between the player station & robot at the time. We measured 20-30 mS periods by simply toggling the state of the PWM signal at a relay channel every time through the main loop. We attached a scope to the channel and observed the period of PWM signal change from 20mS to 30 mS and continuously repeat. We also monitored delta_t during this time, using a debug statement to print a message whenever delta_t was not equal to zero, and never once saw the message!
: I didn't dig into it any more, I just made note of it. I wonder if one were to monitor the serial stream between the receiver and RF modem, if they would see the same delay in the data stream or if the delay is incurred inside the receiver.

: Rick


One thing to keep in mind...even if you aren't getting them in your serin statement, or not using the inputs on the RC or OI, all of the data is still sent both ways...I know its 26 bytes(same as the dashboard output) for the data from RC to OI, but I dunno about the other way around...

Nate
__________________
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.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Counter Strike Gadget470 Chit-Chat 20 11-07-2005 14:03
Actual execution time measurement Dan Technical Discussion 5 24-03-2003 11:36
How long is one stamp loop yangotang Programming 3 23-01-2003 20:36
Autonomous code PBoss Programming 7 14-01-2003 15:29
NEED HELP with Delay loop for compressor relay switch archiver 2001 10 24-06-2002 02:11


All times are GMT -5. The time now is 15:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi