Go to Post Based on EXTENSIVE analysis of this image, I have concluded that we will have to use wires on our robots. I am certain of it. - theCADguy [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 06-02-2007, 21:22
937Programmers 937Programmers is offline
Registered User
AKA: Phil M - Programming Leader
FRC #0937 (North Stars)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas
Posts: 7
937Programmers is an unknown quantity at this point
PWMs not outputting in Autonomous

Hello! I don't know if this question has been answered yet, but I didn't seem to find an answer anywhere.

When we are trying to run autonomous code, PWMs 1-12 aren't doing anything, and the speed controllers that are hooked up into those PWMs are blinking yellow. We think that the PWMs aren't being enabled, but we're not quite sure how to do that in the autonomous code. We have the drivetrain motors in PWMs 13-16, and those are working fine. Nothing else, however, will work.

// If it might be part of the problem, we're using Kevin's streamlined code as a base.

Please help as soon as possible! Thanks!
  #2   Spotlight this post!  
Unread 06-02-2007, 21:25
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
Re: PWMs not outputting in Autonomous

Perhaps you deleted this line:

Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */

which goes after Generate_Pwms
  #3   Spotlight this post!  
Unread 06-02-2007, 21:28
937Programmers 937Programmers is offline
Registered User
AKA: Phil M - Programming Leader
FRC #0937 (North Stars)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas
Posts: 7
937Programmers is an unknown quantity at this point
Re: PWMs not outputting in Autonomous

Quote:
Originally Posted by meatmanek View Post
Perhaps you deleted this line:

Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */

which goes after Generate_Pwms
No, that's not the issue. I made sure that I didn't delete any lines when I wrote the code. I just double checked, and that line is definitely where it's supposed to be.

Anything else that might be the problem?

Last edited by 937Programmers : 06-02-2007 at 21:32.
  #4   Spotlight this post!  
Unread 06-02-2007, 21:41
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
Re: PWMs not outputting in Autonomous

Mind posting your User_Autonomous_Code?
  #5   Spotlight this post!  
Unread 06-02-2007, 22:10
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: PWMs not outputting in Autonomous

If you leave the robot in autonomous mode do you get a code error light?
__________________
Eric Haskins KC9JVH
  #6   Spotlight this post!  
Unread 06-02-2007, 23:32
937Programmers 937Programmers is offline
Registered User
AKA: Phil M - Programming Leader
FRC #0937 (North Stars)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas
Posts: 7
937Programmers is an unknown quantity at this point
Re: PWMs not outputting in Autonomous

Quote:
Originally Posted by EHaskins View Post
If you leave the robot in autonomous mode do you get a code error light?
Surprisingly, no. It runs like it's supposed to as I watched the terminal window, but nothing from 1-12 actually runs.

As for posting my code, I'll get to that ASAP. I should be able to get it up tomorrow.
  #7   Spotlight this post!  
Unread 07-02-2007, 00:21
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: PWMs not outputting in Autonomous

Blinking yellow speed controllers usually indicate a connectivity problem with the signal...I'm assuming they work under human operation?

Are you calling something that might modify the PWM values before you call PutData()? Try printing out the values RIGHT before you PutData().
  #8   Spotlight this post!  
Unread 07-02-2007, 13:27
Inverted Inverted is offline
Registered User
AKA: Eric P.
FRC #1228 (Robo Tribe)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Rahway, NJ
Posts: 25
Inverted is an unknown quantity at this point
Send a message via AIM to Inverted
Re: PWMs not outputting in Autonomous

I had the same problem with my motor output during autonomous. I changed the "Generate Pwms" function to his "PWM" function and everything worked. Hope the problem is as simple as that.
  #9   Spotlight this post!  
Unread 07-02-2007, 13:56
Aaron_H Aaron_H is offline
Registered User
FRC #1033
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Virginia
Posts: 9
Aaron_H is on a distinguished road
Re: PWMs not outputting in Autonomous

Make sure that your PWM outputs are not 127 by default. At the top of the autonomous loop, all the PWMs are set to 127 by default, this may have something to do with it.
  #10   Spotlight this post!  
Unread 08-02-2007, 19:12
937Programmers 937Programmers is offline
Registered User
AKA: Phil M - Programming Leader
FRC #0937 (North Stars)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas
Posts: 7
937Programmers is an unknown quantity at this point
Re: PWMs not outputting in Autonomous

Well, all the motors work under human operation, and I haven't gotten around to messing with it yet today (I just got here )

Anyways, here's my autonomous function before modification today:

Code:
void User_Autonomous_Code(void)
{
  /* Initialize all PWMs and Relays when entering Autonomous mode, or else it
     will be stuck with the last values mapped from the joysticks.  Remember, 
     even when Disabled it is reading inputs from the Operator Interface. 
  */
  pwm01 = pwm02 = pwm03 = pwm04 = pwm05 = pwm06 = pwm07 = pwm08 = 127;
  pwm09 = pwm10 = pwm11 = pwm12 = pwm13 = pwm14 = pwm15 = pwm16 = 127;
  relay1_fwd = relay1_rev = relay2_fwd = relay2_rev = 0;
  relay3_fwd = relay3_rev = relay4_fwd = relay4_rev = 0;
  relay5_fwd = relay5_rev = relay6_fwd = relay6_rev = 0;
  relay7_fwd = relay7_rev = relay8_fwd = relay8_rev = 0;

  while (autonomous_mode)   /* DO NOT CHANGE! */
  {
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {
        Getdata(&rxdata);   /* DO NOT DELETE, or you will be stuck here forever! */

        /* Add your own autonomous code here. */
		// STEP 1 - Initialize the Camera
		Tracking_Info_Terminal();
		Camera_Handler();
		Servo_Track();

		if(Get_Tracking_State() >= TARGET_IN_VIEW)
		{
			// STEP 2 - Make Robot Face the Light
			if((((int)PAN_SERVO-124)*65)/124 < 0)
			{
				pwm13 = pwm14 = 62;
				pwm15 = pwm16 = 192;
				centered = 0;
			}
			else if((((int)PAN_SERVO-124)*65)/124 > 0) 
			{
				pwm13 = pwm14 = 192;
				pwm15 = pwm16 = 62;
				centered = 0;
			}
			else
			{
				pwm13 = pwm14 = pwm15 = pwm16 = 127;
				centered = 1;
			}
		
			// STEP 3 - Drive Robot forward until 4 feet in front of Rack

			if((((int)TILT_SERVO-144)*25)/50 < 67 && centered == 1)
			{
				pwm13 = pwm14 = pwm15 = pwm16 = 192;
			}
			
			if(centered == 1 && (((int)TILT_SERVO-144)*25)/50 >= 67)
			{
				pwm13 = pwm14 = pwm15 = pwm16 = 127;
				
				// STEP 4 - Move the arm to the center position
				if(counter < 624 && arminpos == 0)
				{
					pwm08 = 254;
					counter++;
					if(counter == 624)
					{
						arminpos = 1;
					}
				}	
			}
			counter = 0;

			// STEP 5 - Place the tube on the leg
			if(arminpos == 1)
			{
				pwm13 = pwm14 = pwm15 = pwm16 = 192;
				counter++;
				if(counter == 26) 
				{
					overdisk = 1;
					pwm13 = pwm14 = pwm15 = pwm16 = 127;
				}		
			
				if(counter < 208 && clawopen == 0)
				{
					pwm05 = 192;
					if(overdisk == 1)
					{
						counter++;
					}
				}

				if(counter == 208)
				{
					clawopen = 1;  counter = 0;  pwm05 = 127;
				}
			}

			if(clawopen == 1)
			{
				pwm13 = pwm14 = pwm15 = pwm16 = 62;
			}
			// END AUTONOMOUS CODE
		}

	    PWM(pwm13,pwm14,pwm15,pwm16);

        Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
    }
  }
}
Thanks for the help. Hopefully this gets fixed today.
  #11   Spotlight this post!  
Unread 08-02-2007, 19:49
wingnut1705's Avatar
wingnut1705 wingnut1705 is offline
Registered User
AKA: Kevin
FRC #0453 (Gears)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Michigan
Posts: 53
wingnut1705 is an unknown quantity at this point
Send a message via AIM to wingnut1705
Re: PWMs not outputting in Autonomous

[quote=937Programmers;574561]

PWM(pwm13,pwm14,pwm15,pwm16);

In the line when you generate the pwm's, make sure that any pwm that you are using is included in that list. That should solve your problem
  #12   Spotlight this post!  
Unread 08-02-2007, 20:10
937Programmers 937Programmers is offline
Registered User
AKA: Phil M - Programming Leader
FRC #0937 (North Stars)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas
Posts: 7
937Programmers is an unknown quantity at this point
Re: PWMs not outputting in Autonomous

You mean like this?
Code:
PWM(pwm01,pwm02,pwm05,pwm08,pwm13,pwm14,pwm15,pwm16);
Or this?
Code:
PWM(pwm01,pwm02,pwm05,pwm08);
PWM(pwm13,pwm14,pwm15,pwm16);
If we do the first one, then there's an error saying there's too many calls in the argument. The second one doesn't work either because apparently the PWM() function only affects 13-16. I think I have an idea, though, and I'll see if it works.

Edit: Yeah, I didn't think it would. I thought the problem may have been PWM vs. Generate_Pwms, but that's not the issue.

Last edited by 937Programmers : 08-02-2007 at 20:14.
  #13   Spotlight this post!  
Unread 08-02-2007, 20:35
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Re: PWMs not outputting in Autonomous

No, the PWM() only deals with 13-16. Try setting all your PWMs to 254 (disconnect any motors first!) and then power up and go into autonomous. Take the PWM cable coming from your Victor and move it up from 1 through 12, and see if the light on the Victor stays blinking orange or if it changes to green or red. If so, then one of your outputs may be bad. If not, switch cables and repeat. I have encountered several bad cables this year. If none of your cables working, switch Victors. The connection from the cable to the Victor is commonly loose on our 'bot this year too.

If none of these work, use the dashboard program (either IFI's or Sean Witte (sp?)) and see if they read 254 or not.

I take it that the PWMs work fine in Teleoperated mode?

Good luck,
Robinson
  #14   Spotlight this post!  
Unread 08-02-2007, 20:54
937Programmers 937Programmers is offline
Registered User
AKA: Phil M - Programming Leader
FRC #0937 (North Stars)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas
Posts: 7
937Programmers is an unknown quantity at this point
Re: PWMs not outputting in Autonomous

Quote:
Originally Posted by gnirts View Post
No, the PWM() only deals with 13-16. Try setting all your PWMs to 254 (disconnect any motors first!) and then power up and go into autonomous. Take the PWM cable coming from your Victor and move it up from 1 through 12, and see if the light on the Victor stays blinking orange or if it changes to green or red. If so, then one of your outputs may be bad. If not, switch cables and repeat. I have encountered several bad cables this year. If none of your cables working, switch Victors. The connection from the cable to the Victor is commonly loose on our 'bot this year too.

If none of these work, use the dashboard program (either IFI's or Sean Witte (sp?)) and see if they read 254 or not.

I take it that the PWMs work fine in Teleoperated mode?

Good luck,
Robinson
Yes, the PWMs work fine in Teleoperated mode.

Anyway, using that test, the Victor was blinking yellow from PWMs 1 - 12, but it was green from PWMs 13 - 16, and yet all 16 of them were reading 254, so we think it has to be initialization or something to that effect. Thanks for the suggestion.
  #15   Spotlight this post!  
Unread 08-02-2007, 21:08
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Re: PWMs not outputting in Autonomous

Quote:
Originally Posted by 937Programmers View Post
Yes, the PWMs work fine in Teleoperated mode.

Anyway, using that test, the Victor was blinking yellow from PWMs 1 - 12, but it was green from PWMs 13 - 16, and yet all 16 of them were reading 254, so we think it has to be initialization or something to that effect. Thanks for the suggestion.
If they read 254 on the Dashboard then I would hazard that it is an electrical problem, not strictly software. Did you use this Dashboard, plugged into your OI, to test?

On last possible test I can think of would be to try this year's FRC plugged into some of the Victors on last year's 'bot. I am assuming at this point that everything else about autonomous work? (eg. analog inputs, digital in/outputs, etc.)

If you happen to be in charge of electrical as well, I'm sorry, but I can't really tell you how to proceed from here, other than maybe trying this year's speed controllers on last year's bot.

Good luck again (it's starting to sound like you need it),
Robinson
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 not working in autonomous Roger Programming 9 09-03-2006 07:38
Gyro not working in Autonomous? kaszeta Programming 7 11-02-2006 01:28
printf statements do not display in autonomous mode PVC Pirates Programming 3 22-02-2005 15:41
New to C but not to basic, need help on autonomous cdennisxlx2 Programming 4 02-02-2005 03:38
pwms 13 and 15 in autonomous mode Chris Bright Programming 1 24-02-2004 22:25


All times are GMT -5. The time now is 12:39.

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