Go to Post The purpose of this forum is for us to communicate our ideas, so that we can collectively strengthen our ability to inspire others. - Jaine Perotti [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 02-02-2007, 15:09
Horohoroboarder Horohoroboarder is offline
Registered User
AKA: Ryan Hirrlinger
FRC #1820 (HAVOC)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Derwood
Posts: 10
Horohoroboarder is on a distinguished road
Send a message via AIM to Horohoroboarder
Camera code completely turning off all PWM's

So, I went and downloaded Kevin Watson's "bells and whistles" version of the camera code. I made sure I got the most updated version.

I have not changed anything within the code besides changing the pwm's for the drive motors to 08 and 09 (because the camera utilizes 01 and 02 I believe).

However, once uploading the code, absolutely none of our PWM's are receiving any output or input. The PWM lights are not showing on the operator controller and the terminal window says "searching...", but the pan/tilt servo motors will not move.

I tried making revisions by adding pwm.h, but I realized that library should only affect PWM's 13-16. Any ideas?
  #2   Spotlight this post!  
Unread 02-02-2007, 15:18
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Camera code completely turning off all PWM's

Make sure that you are actually getting to your default routine. In at least one version of Kevin's code it was commented out.
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #3   Spotlight this post!  
Unread 02-02-2007, 15:43
Horohoroboarder Horohoroboarder is offline
Registered User
AKA: Ryan Hirrlinger
FRC #1820 (HAVOC)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Derwood
Posts: 10
Horohoroboarder is on a distinguished road
Send a message via AIM to Horohoroboarder
Re: Camera code completely turning off all PWM's

I've scanned through the code, it's the most recent on Kevin's website, and I haven't found any large sections of code commented out. Is anyone else experiencing this? I'm pretty sure that I haven't augmented anything that would completely disable the PWM outputs.

**Edit**

Also, I did add in one line of code to power the camera. I'm pretty sure that this should be no problem. It's in the User_Initialization() under User_Routines.c, right after all of the pwm's and digital i/o's are set:

digital_io_17 = 1;


The camera is getting the green light and receiving data, but the servo's are not. Is it ok to set this variable to power the camera?

Last edited by Horohoroboarder : 02-02-2007 at 15:54.
  #4   Spotlight this post!  
Unread 02-02-2007, 16:10
Horohoroboarder Horohoroboarder is offline
Registered User
AKA: Ryan Hirrlinger
FRC #1820 (HAVOC)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Derwood
Posts: 10
Horohoroboarder is on a distinguished road
Send a message via AIM to Horohoroboarder
Question Re: Camera code completely turning off all PWM's

Ok, my apologies for the series of stupid questions, but I think I'm making progress.

After tracking down a commented out Default_Routines(); and uncommenting it, I made a step forward. Now, when running, the Operator Interface LED's will light up when I move the joysticks accordingly. However, the camera servo motors (in addition to the drive motors) are still not responding at all.
  #5   Spotlight this post!  
Unread 02-02-2007, 16:26
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: Camera code completely turning off all PWM's

Quote:
Originally Posted by Horohoroboarder View Post
Also, I did add in one line of code to power the camera. I'm pretty sure that this should be no problem. It's in the User_Initialization() under User_Routines.c, right after all of the pwm's and digital i/o's are set:

digital_io_17 = 1;


The camera is getting the green light and receiving data, but the servo's are not. Is it ok to set this variable to power the camera?
I don't understand what you are trying to do here. The camera is supposed to get its power from the backup battery through a pwm connection. Digital I/O pin 1 is already set to be an input by the initialization code, so setting its direction control to 1 a second time will have no effect. Even if it did have an effect, it wouldn't change anything having to do with powering the camera.

If your servos and motor speed controllers are not responding, that sounds like the pwm outputs are disabled. What are the lights on the Victors doing? A steady yellow means the code is setting the outputs to neutral. A blinking yellow means the robot has been disabled and there is no pwm signal at all.
  #6   Spotlight this post!  
Unread 02-02-2007, 16:30
Horohoroboarder Horohoroboarder is offline
Registered User
AKA: Ryan Hirrlinger
FRC #1820 (HAVOC)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Derwood
Posts: 10
Horohoroboarder is on a distinguished road
Send a message via AIM to Horohoroboarder
Re: Camera code completely turning off all PWM's

I am changing the value of digital i/o pin 17, which is the only one designated as an output. I wasn't getting any power at all when I plugged the camera power into a PWM slot.

Also, when I move the joystick, the victors are still blinking and not receiving any setting at all. I'm trying to scan for anywhere where the PWM's might be disabled, but so far I haven't had any luck.
  #7   Spotlight this post!  
Unread 02-02-2007, 16:37
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Camera code completely turning off all PWM's

Ryan,

Back up a bit. It sounds like you do not have a backup battery installed.

Let's set the camera aside for a bit. Disconnect the camera and download and run the IFI default code. Do you have PWMs?

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #8   Spotlight this post!  
Unread 02-02-2007, 16:40
Horohoroboarder Horohoroboarder is offline
Registered User
AKA: Ryan Hirrlinger
FRC #1820 (HAVOC)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Derwood
Posts: 10
Horohoroboarder is on a distinguished road
Send a message via AIM to Horohoroboarder
Re: Camera code completely turning off all PWM's

Yes, we initially took the default IRC code and uploaded it to the robot with no problem at all. The PWM's worked perfectly, but after uploading Kevin Watson's code we ran into a problem.
  #9   Spotlight this post!  
Unread 02-02-2007, 17:58
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: Camera code completely turning off all PWM's

Quote:
Originally Posted by Horohoroboarder View Post
I am changing the value of digital i/o pin 17,...
No, you're not. You're setting Digital I/O pin 17 to be an input. But let's ignore that for now, as it still has absolutely nothing to do with powering the camera.

Quote:
Also, when I move the joystick, the victors are still blinking and not receiving any setting at all.
That means the robot is disabled. Are you using the tether or the radio link? Do you have anything connected to the OI's competition port?

Quote:
Yes, we initially took the default IRC code and uploaded it to the robot with no problem at all. The PWM's worked perfectly, but after uploading Kevin Watson's code we ran into a problem.
The first problem you ran into is probably the fact that Kevin's code does not control motors. He commented out the call to Default_Routine() so it would not interfere with the control of the pan and tilt servos. You're going to have to replace the mapping of joystick to pwm output with something that matches how you have your Victors connected.

And you didn't respond to Mike's important comment about having a backup battery connected. That's what supplies the 7.2 volt output which powers the servos.

Last edited by Alan Anderson : 02-02-2007 at 18:01.
  #10   Spotlight this post!  
Unread 02-02-2007, 18:13
Horohoroboarder Horohoroboarder is offline
Registered User
AKA: Ryan Hirrlinger
FRC #1820 (HAVOC)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Derwood
Posts: 10
Horohoroboarder is on a distinguished road
Send a message via AIM to Horohoroboarder
Re: Camera code completely turning off all PWM's

Ok, well as funny as it is, we found the problem.

Our PWM cords were totally fried >.<


I replaced them and commented the Default_Routine() back in and it works like a charm.

With that out of the way, hopefully 1820 will be a serious competitor during autonomous


Oh, and I looked into the digital_io_17 declaration, and you were completely right. My apologies. We fixed our back-up battery connection and now the camera is powered from a PWM slot as expected.

Last edited by Horohoroboarder : 02-02-2007 at 18:15.
  #11   Spotlight this post!  
Unread 10-02-2007, 19:16
ForbinOne ForbinOne is offline
Rookie UK Team's - Teacher
no team (British Buldogs)
Team Role: Teacher
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Huddersfield, UK
Posts: 1
ForbinOne is an unknown quantity at this point
Re: Camera code completely turning off all PWM's

Hey Guys,

Thanks for the post, We are a rookie team from the UK and the "c" code has been driving me and my students mad. If we got the motors running on the default code then when we loaded the camera code with the same mods, it was dead. Then your post made me look at the default routine being remarked out. Ok so that got the pwm back on line, but now the camera was dead, remarked out the two lines calling pwm1 and pwm2 and hey presto the whole thing works.

It seems so simple now but having spent all my life programming Basic - including my robonova1, "c" still kills my confidence. But less and less each day.

This is the only site that has had any help whatsoever including first themselves.

Keep up the good work guys.

ForbinOne
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 for turning DustinB_3 Programming 18 17-02-2007 21:00
Does the camera code suits to all versions of MPLAB and C18? razer Programming 3 04-01-2007 14:50
Turning motors on and off in the KitGearbox? Andrew Blair Kit & Additional Hardware 4 31-12-2005 10:33
Slowing down Camera drive turning Zalumaskov Programming 1 27-02-2005 10:11
Victor turning off zeep25 Electrical 10 23-02-2004 18:35


All times are GMT -5. The time now is 15:35.

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