Go to Post All this community stuff is actually pretty fun! :) - JBotAlan [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 12-02-2006, 03:28
anifinder anifinder is offline
Registered User
AKA: Richard Otis
FRC #1913
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Covington, LA
Posts: 2
anifinder is an unknown quantity at this point
Send a message via AIM to anifinder Send a message via MSN to anifinder Send a message via Yahoo to anifinder
Camera shows no love to drive motors

I have had the dubious pleasure of working with the CMUCam2 and making it useful for my team's purposes. I've mostly managed to succeed, and now the camera follows the green target just fine. However, there appears to be a problem with initializing the camera. The problem is not with the actual initializing, since it does work, but there is a delay of several seconds. During this delay, the drive motors, connected on PWMs 1 and 2, begin spinning in opposite directions. They will continue to run until I shut the FRC off or turn Disable on. This happens whether it's in OI or Autonomous mode. I should note that this is not an issue with the camera not being connected (explained here) since I do eventually talk to the camera, but rather an issue during initialization.

I went ahead and put the camera into debug mode (articulated here) and noticed that during the delay in which the camera is initializing, the camera shows an exchange like this:

Quote:
->
<-
->
<-
->
<-
->
This is how it goes for several seconds until it finally starts exchanging real data. Even when it starts exchanging real data, sometimes it will do so without ever receiving any ACKs from the camera (the same as the issue here) and the control loop will just hang once it gets to the camera Capture function (a known issue). Resetting the FRC usually fixes the problem, though.

Through some careful debugging I discovered that the drive motors started acting crazy only once the InitCamera() function was called. This explains why they act crazy in either Competition State, since InitCamera() is in the Initialize block. At first I suspected that perhaps there was something weirdly hardcoded about PWMs 1 and 2 that made the code expect those to be the camera servo outputs (I have them on 3 and 4, not directly on the camera board, and they work fine), but switching the drive motors to other PWMs (I tried 6 and 7 *without* changing the OI code to reflect the change) seems to have no effect; they go crazy still. I noticed the servos themselves don't seem to be affected, though. Is it possible that there is a wiring issue with the Victor 884s that is causing the drive motors to be uniquely affected? The driving functions appear to be functioning perfectly normally once the motors stop spinning out of control.

Obviously this issue is a showstopper for the camera. The random spinning at initialization throws the robot into an unknown state and makes autonomous programming for the competition 1000 times more difficult. I noticed that moving the InitCamera() function into the Autonomous block makes the issue go away for OI mode while still allowing for camera function, but it doesn't fix the problem with the motors in Autonomous mode. I'm hoping that the issue merely amounts to ignorance on my part and that someone else out there has had the same issue and knows the solution. Thanks.

Last edited by anifinder : 12-02-2006 at 03:32.
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems Combining Camera Code and Driving Code cmurdoch Programming 20 10-02-2007 16:34
Camera Is Spazzing Out! BrittanyV Programming 15 04-02-2006 13:39
Moving robot while tracking with camera questions... Steve Orr Programming 6 02-02-2006 22:24
"Motors and Drive train edition" of Fresh From the Forum Ken Leung CD Forum Support 6 29-01-2002 12:32
Swerve Drive Jeff Waegelin Technical Discussion 14 17-09-2001 08:06


All times are GMT -5. The time now is 17:52.

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