Go to Post The Championship, The Championship Event, The World Championship, The international Championship, Internationals, Champs, Nationals, Nat's, ATL... I just call it the best time of my life. - Kyle [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-02-2007, 13:05
Tz0m Tz0m is offline
Registered User
FRC #0333
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: New York
Posts: 17
Tz0m is an unknown quantity at this point
Motor and camera pwms

Our motors are mapped to pwms 13, 14, 15, and 16. Our pan and tilt servos for the camera are mapped to pwms 1, and 2. For some reason, when we upload the camera code with Default_Routine();, appearing in user_routines.c, commented out, the camera works fine but we are not able to drive the robot and get no output from our joysticks. With Default_Routine(); uncommented, the camera does not work but we are able to drive the robot and get output from the joystick. A few times our joystick wound up controlling the camera's servos, but I don't remember how we had our code setup that time. Any help is greatly appreciated.
  #2   Spotlight this post!  
Unread 19-02-2007, 13:32
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Motor and camera pwms

Read Default_Routine() and look at what it does. You'll have to modify it to avoid messing with the pwm outputs the camera tracking code is using. The easiest way to do that in your specific case is probably to comment out the two lines that set pwm01 and pwm02.
  #3   Spotlight this post!  
Unread 19-02-2007, 16:51
Tz0m Tz0m is offline
Registered User
FRC #0333
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: New York
Posts: 17
Tz0m is an unknown quantity at this point
Re: Motor and camera pwms

Thank you, this fixed our problem. However, we have the trigger on the joystick set to initiate autonomous mode, just for testing. When we press the trigger, though, the camera resets to the default position and then retracks the target.
  #4   Spotlight this post!  
Unread 19-02-2007, 22:39
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Motor and camera pwms

Notice how User_Autonomous_Code() sets all the pwm outputs to 127 when it starts, including pwm01 and pwm02? You'll have to fix that if you want it not to interfere with the camera servos.
  #5   Spotlight this post!  
Unread 20-02-2007, 12:48
Tz0m Tz0m is offline
Registered User
FRC #0333
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: New York
Posts: 17
Tz0m is an unknown quantity at this point
Re: Motor and camera pwms

Thank you, this fixed our problem.
Closed Thread


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
Camera to motor setup Windward Programming 24 18-02-2006 20:29
Direct Control of PWMs and OI in WPILib CyberWolf_22 Programming 7 06-02-2006 19:06
pwms 13 and 15 in autonomous mode Chris Bright Programming 1 24-02-2004 22:25
External metal jacket on the Drill motor and FP motor, WHY? archiver 2001 3 24-06-2002 04:22
External metal jacket on the Drill motor and FP motor, WHY? Dennis Hughes Technical Discussion 1 04-06-2001 11:59


All times are GMT -5. The time now is 04:49.

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