Go to Post Disclaimer: I am not an electrical engineer nor an electrician. I occasionally play one on CD. And when inspecting robots, sort of... - jvriezen [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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
  #14   Spotlight this post!  
Unread 01-02-2013, 15:30
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Gyro Angle Problems

First, don't print useless "I'm here" messages at the maximum loop rate! The first one conveys information all the rest consume bandwidth. (check your logs for when the spinning slows I would not be surprised if your prints are gradually backing up and consuming all your CPU and/or bandwidth)

Second, If your code stays in a while loop forever it means you are not meeting the exit criterea. Period. In this case that almost certainly means your spinning in the wrong direction, or +/- .75 degrees is smaller than the distance covered at 25% power in 6 tenths of a second. (how did you come up with .6 as the magic amount of time between checks?)

Third, never create a loop that can run forever! Create a counter or timer that guarantees you'll exit after, say, 5 seconds, or 10 iterations, or something. If your gyro gets unplugged or damaged you will sit and spin. (been there)
Reply With Quote
 


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 11:40.

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