Go to Post The strength of an alliance is not defined strictly by the sum of its parts. - Jared Russell [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 15-03-2004, 11:00
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
SW bug has ME stumped!!!

We have a telescoping arm that extends buy pushing a plastic E-chain up its center with a globe motor

to tell when we are at the limits we put white paint on both ends of the black plastic chain, and use a banner sensor to see the white spots.

We have a variable that we use to remember whether we were going up or down the last time the chain was moved, so when we see the paint we know whether to restrict it from going up or down.

it all works fine except for one thing - we initialize that variable on powerup to say we were going down - and we power up the bot with the chain down, so the sensor is on

but after powerup the SW thinks the arm is all the way up instead - it wont let it go up, only down

if we power the bot up with the chain between the white spots, everything works fine. (this is what we have been doing)

I totally stumped by this one, and so are the SW students on our team - we cant see anything wrong with the code

is it possible the RC puts out invalid OI signals on powerup? on the first few loops of the SW could it be getting active switch inputs for OI switches that are open? Thats the only thing I can think of that would throw our code off and make it think it was going up after power on?

the code is below - if you draw a flowchart its easier to understand:

Code:
/*578 telescope control */
/*banner sensor is on rc_dig_in04 - 0=end of chain*/
	pwm04=127;			/*default to off*/ 
	if(p4_sw_aux1)			/*if up switch is on*/
	{
		if (rc_dig_in04)	/*if not end of chain*/
		{
			pwm04= 150;  	/*move up 1/4 speed*/
			teleDirection = 1;  /*last direction is up*/
		}
		else if (teleDirection==0) pwm04= 150; /*was going down, ok to move up*/ 
	}
	if(p4_sw_aux2)			/*if down switch is on*/
	{
		if (rc_dig_in04)	/*if not end of chain*/
		{
			pwm04= 104;	/*move down 1/4 speed*/
			teleDirection = 0;	/*last direction is down*/
		}
		else if (teleDirection==1) pwm04= 104; /*was going up, ok to move down*/ 
	}
teleDirection is initialzed to 0 = down and the only way it could get to be 1 is if the inputs read that the up switch is on and the banner sensor is off - neither of which are true when the bot is powered up with the chain all the way down.

Im totally stumped by this one!

BTW- the chain does not move on power up, no glitches or anything, and we can use it the way it is by pulling the arm slightly off the paint spot

but it bugs me that its not doing what it should be - the code is doing something we dont understand or its doing something unpredictable, which leaves you with a sick feeling that something is not right with the system.

Last edited by KenWittlief : 15-03-2004 at 11:04.
 


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
printf bug - beware! WizardOfAz Programming 8 10-03-2004 09:50
i-Sprocket Bug Notice Ed Sparks Inventor 0 21-01-2004 22:36
New boards: Bug in thread-subscription e-mail DanL CD Forum Support 1 02-12-2003 16:24
Last Call for bug reports rbayer Programming 0 08-01-2003 02:48
Small bug Jay Lundy CD Forum Support 1 18-06-2001 17:03


All times are GMT -5. The time now is 22:26.

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