Go to Post Rules from prior years DO NOT APPLY to this year! - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-12-2006, 02:28 AM
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 : 02-12-2006 at 02:32 AM.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-12-2006, 10:57 AM
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,161
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Camera shows no love to drive motors

Have you calibrated the victors?
Reply With Quote
  #3   Spotlight this post!  
Unread 02-12-2006, 11:28 AM
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
Re: Camera shows no love to drive motors

Yes, and it does cause the drive motors to act normally as soon as I depress the buttons on them. The problem is as soon as there's another FRC reset, the motors start acting crazy again.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-13-2006, 08:45 AM
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 858
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Camera shows no love to drive motors

We have used the camera for quite a few different tasks and have never had this issue. The PWM 1 & 2 do not get called while the camera initializes. You should try using Tutorial 7 to see if you continue to have this problem. I have a feeling something might be conflicting in your code. You could also post your code and we could take a look at it.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-13-2006, 09:31 AM
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 537
BradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud ofBradAMiller has much to be proud of
Re: Camera shows no love to drive motors

The camera waits a few seconds after the robot controller is started before initializing. The idea was to make sure that the camera had finished its own initialization before sending commands. The debug output you saw was the camera code in EasyC trying to initialize the camera and it not responding. You should see a bunch of commands followed by ACK messages (acknowledgment). If you only see commands being sent to the camera and no ACKs then it isn't getting your commands or it is in some strange state. I've occasionally seen a similar problem, and recycling the power seems to always fix it. I think the camera gets into some state where it doesn't accept commands.

There is no code in the EasyC runtime that does anything with the drive motors while the camera is initializing. I might suggest doing all the initialization in the Initialize() function if you're not already doing that. The IFI master code will prevent any PWM outputs from happening until the match actually starts (either autonomous or operator control). That way all the initialization (camera, gyros, etc.) is completed while the robot is sitting on the field waiting for autonomous period to start.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
Reply


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 02-10-2007 03:34 PM
Camera Is Spazzing Out! BrittanyV Programming 15 02-04-2006 12:39 PM
Moving robot while tracking with camera questions... Steve Orr Programming 6 02-02-2006 09:24 PM
"Motors and Drive train edition" of Fresh From the Forum Ken Leung CD Forum Support 6 01-29-2002 11:32 AM
Swerve Drive Jeff Waegelin Technical Discussion 14 09-17-2001 07:06 AM


All times are GMT -5. The time now is 03:42 AM.

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


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