Go to Post I am proud whenever I turn to a team during inspections and say "OK I just need two signatures here and I will go get your sticker, you passed!" - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 04-02-2005, 08:48
Terry Sherman's Avatar
Terry Sherman Terry Sherman is offline
Mentor -- Software
FRC #0093 (NEW Apple Corps.)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2003
Location: Wisconsin
Posts: 25
Terry Sherman is an unknown quantity at this point
Combined Camera and PID/Encoder Code

I've been trying to get quadrature encoder code and the provided camera code working together. What I am experiecing is that the PID code that is called on every 26.2ms loop is not always occuring. It seems that this is happening because the camera code sits and waits alot for the serial port. In particular there is a function called: wait_for_data(). This function will sit and spin for quite some time and probably alone causes us to miss out 26.2ms deadline.

If that alone isn't enough this function is called eveytime a camera command is done (camera_track_update(), camera_getACK() [which is called by camera_const_cmd(), camera_buffer_cmd(), camera_stop(), & camera_reset()]).

I think the equivalent to a event driven system needs to be thought out to be able to let the camera code send out serial data and wait for responses but not hold up the rest of the system while it is waiting. If the camera code is needed to be run then it doesn't seem that the normal 26.2ms timing is maintained and all code that depends on that timing (PID, command script timing, etc) is unreliable at best.

Has anyone else encountered this, and if so have you come up with a good way to handle it? I'd like to talk over some ideas with some of you if possible.

Thanks!
 


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 On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 00:34.

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