Go to Post Never leave future engineers alone, especially with something like gravity. - Alex Pelan [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 21-03-2006, 16:00
Jackel148's Avatar
Jackel148 Jackel148 is offline
Registered User
FTC #0160 (Impulse)
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Waterbury
Posts: 4
Jackel148 is an unknown quantity at this point
Question Ultrasonic will not work with another Ultrasonic plz help

Let me first say that I am working with Vex programing for teh FVC compatition. I have tried several times to get my ultrasonics working together. I have tried putting a print to screen for each and they work individually, however, when I try to put them both together they will not work. Can anyone help me with my problem?
  #2   Spotlight this post!  
Unread 21-03-2006, 17:10
Alex698's Avatar
Alex698 Alex698 is offline
Sparky
FRC #2449 (Out of Orbit Robotics)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Arizona
Posts: 114
Alex698 is a jewel in the roughAlex698 is a jewel in the roughAlex698 is a jewel in the rough
Send a message via AIM to Alex698
Re: Ultrasonic will not work with another Ultrasonic plz help

how are you setting them up? ie pointing at each other or straight forward towards a target?
__________________
Eat, Sleep, Build Robots
  #3   Spotlight this post!  
Unread 21-03-2006, 18:07
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: Ultrasonic will not work with another Ultrasonic plz help

Jackel,

Each sensor must be on its own interrupt line and digital output line. Also, you must stagger the output pulse so that both will not transmit a pulse at the same time.

I can give you code fragments on how to so it in C but not EasyC.

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...
  #4   Spotlight this post!  
Unread 21-03-2006, 18:08
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,370
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: Ultrasonic will not work with another Ultrasonic plz help

Your are probable having the 2 sonars interfere with each other both physically and in the timing subroutines. Don't know how you have them set up and what your measuring, but you could mount one sonar on a servo. Point in 1 direction read it , move to another direction and read it.
  #5   Spotlight this post!  
Unread 21-03-2006, 18:13
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
Re: Ultrasonic will not work with another Ultrasonic plz help

Quote:
Originally Posted by Mike Betts
Also, you must stagger the output pulse so that both will not transmit a pulse at the same time.
And you might want to think about how to handle when another robot is also sending out sonar pulses.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #6   Spotlight this post!  
Unread 21-03-2006, 21:57
Jackel148's Avatar
Jackel148 Jackel148 is offline
Registered User
FTC #0160 (Impulse)
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Waterbury
Posts: 4
Jackel148 is an unknown quantity at this point
Re: Ultrasonic will not work with another Ultrasonic plz help

Quote:
Originally Posted by Alex698
how are you setting them up? ie pointing at each other or straight forward towards a target?
I have them set up so that the two of them are facing forward and I am trying to get them to both line up the bot so that it is straight...I tried putting a boared in the middle so that they could not interfere with each other however when I did a print to screen I got nothing which is what happened the rest of the times.

If it is them interfering with each other how would i fix that?
  #7   Spotlight this post!  
Unread 21-03-2006, 22:36
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: Ultrasonic will not work with another Ultrasonic plz help

Here is a code fragment for managing 3 ultrasonic sensors:

Code:
int Service_Ultrasonic_Sensors (void)
{

  ultra_counter++;
  switch (ultra_counter)		// Process Ultrasonic Transducer
	{
	case 1:
	  for (pulsecount = 0 ; pulsecount < PULSE_WIDTH ; pulsecount++)
		{
		rc_dig_out10 = 1;		//	Make another pulse
		};
	  rc_dig_out10 = 0;			//	The pulse is over
	  break;
	case 2:
	  for (pulsecount = 0 ; pulsecount < PULSE_WIDTH ; pulsecount++)
		{
		rc_dig_out11 = 1;		//	Make another pulse
		};
	  rc_dig_out11 = 0;			//	The pulse is over
	  break;
	case 3:
	  for (pulsecount = 0 ; pulsecount < PULSE_WIDTH ; pulsecount++)
		{
		rc_dig_out12 = 1;		//	Make another pulse
		};
	  rc_dig_out12 = 0;			//	The pulse is over
	  break;
	case 4:
	  if (ultra_left_flag == TRUE)
		{
		INTCONbits.GIEL = 0;		//	Disable Low Priority Interrupts
		ultra_left_time = ultra_left_stop - ultra_left_start;
		INTCONbits.GIEL = 1;		//	Enable Low Priority Interrupts
		ultra_good_count++;
		}
	  else
		{
		ultra_left_time = -1;
		ultra_bad_count++;
		};
	  if (ultra_front_flag == TRUE)
		{
		INTCONbits.GIEL = 0;		//	Disable Low Priority Interrupts
		ultra_front_time = ultra_front_stop - ultra_front_start;
		INTCONbits.GIEL = 1;		//	Enable Low Priority Interrupts
		ultra_good_count++;
		}
	  else
		{
		ultra_front_time = -1;
		ultra_bad_count++;
		};
	  if (ultra_right_flag == TRUE)
		{
		INTCONbits.GIEL = 0;		//	Disable Low Priority Interrupts
		ultra_right_time = ultra_right_stop - ultra_right_start;
		INTCONbits.GIEL = 1;		//	Enable Low Priority Interrupts
		ultra_good_count++;
		}
	  else
		{
		ultra_right_time = -1;
		ultra_bad_count++;
		};
	  ultra_left_flag = FALSE;
	  ultra_front_flag = FALSE;
	  ultra_right_flag = FALSE;
	  ultra_counter = 0;
	  break;
	default:							// for any unexpected result
	  ultra_left_flag = FALSE;
	  ultra_front_flag = FALSE;
	  ultra_right_flag = FALSE;
	  ultra_counter = 0;
	  break;
	};
   
}
The code above can be called once per communications loop or via a timer interrupt, et cetera...

the variables ultra_bad_count and ultra_good_count were used during development and can be deleted.

An example interrupt routine is:

Code:
void Service_DIO4_Interrupt(unsigned char state)
{
	if (state == 1)						 // rising-edge interrupt
	{
	ultra_front_start = Read_Timer_3 ();	 // Read Start Time.
	}
	else									// falling-edge interrupt
	{
	ultra_front_flag = TRUE;
	ultra_front_stop = Read_Timer_3 ();	  // Read Stop Time
	}
}
The user routine has only to test for the time to be greater than zero to know that it is valid data.

Hopefully, this helps.


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 21-03-2006, 22:44
Jackel148's Avatar
Jackel148 Jackel148 is offline
Registered User
FTC #0160 (Impulse)
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Waterbury
Posts: 4
Jackel148 is an unknown quantity at this point
Re: Ultrasonic will not work with another Ultrasonic plz help

I will try to convert this please check back tommorow and see if it worked thanks for the help.

Jackel
  #9   Spotlight this post!  
Unread 08-05-2006, 00:13
Steve0100's Avatar
Steve0100 Steve0100 is offline
Steve0100
no team
 
Join Date: Apr 2006
Location: PDX
Posts: 11
Steve0100 is on a distinguished road
Re: Ultrasonic will not work with another Ultrasonic plz help

Quote:
Originally Posted by Mike Betts
Jackel,

Each sensor must be on its own interrupt line and digital output line. Also, you must stagger the output pulse so that both will not transmit a pulse at the same time.

I can give you code fragments on how to so it in C but not EasyC.

Mike
This is the same problem that I just encountered, in trying to use 4 Ultrasonic sensors on a 4- wheel holonomic robot. Very very frustrating.

Does anyone have an EasyC solution to using multiple sonar sensors? I've tried using waits in between Ultrasonic sensor readings to try and avoid timing loop interference, but that has not worked. Each sensor works individually but not when more than one is used at a time. Is there too much latency in Starting and Stopping each individual Ultrasonics sensor in turn?

Thanks!
  #10   Spotlight this post!  
Unread 09-05-2006, 14:03
Ctx32 Ctx32 is offline
Registered User
no team
 
Join Date: Apr 2006
Location: Florida
Posts: 10
Ctx32 is an unknown quantity at this point
Re: Ultrasonic will not work with another Ultrasonic plz help

Quote:
Originally Posted by Steve0100
This is the same problem that I just encountered, in trying to use 4 Ultrasonic sensors on a 4- wheel holonomic robot. Very very frustrating.

Does anyone have an EasyC solution to using multiple sonar sensors? I've tried using waits in between Ultrasonic sensor readings to try and avoid timing loop interference, but that has not worked. Each sensor works individually but not when more than one is used at a time. Is there too much latency in Starting and Stopping each individual Ultrasonics sensor in turn?

Thanks!
I have 4 working using EasyC, But i need help with the encoders
I was going to send a pic, But don't know how on this forum.
My email is ctx3201@comcast.net
Let me know and I'll send it to you or tell me how to send a pic to this forum.
Calvin
  #11   Spotlight this post!  
Unread 10-05-2006, 15:31
Ctx32 Ctx32 is offline
Registered User
no team
 
Join Date: Apr 2006
Location: Florida
Posts: 10
Ctx32 is an unknown quantity at this point
Re: Ultrasonic will not work with another Ultrasonic plz help

Quote:
Originally Posted by Ctx32
I have 4 working using EasyC, But i need help with the encoders
I was going to send a pic, But don't know how on this forum.
My email is ctx3201@comcast.net
Let me know and I'll send it to you or tell me how to send a pic to this forum.
Calvin
Heres the pic link:
http://i71.photobucket.com/albums/i1...01/4Ultras.jpg
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
3D Studio Max won't work David the bomb 3D Animation and Competition 3 03-03-2004 17:12
Problems of the mind... effecting work Gadget470 Chit-Chat 20 18-11-2003 11:56
Edit doesn't work on original title posts??? Elgin Clock CD Forum Support 6 12-03-2003 17:30
Who knows how the motors [I]really[/I] work? Wetzel Chit-Chat 5 13-02-2002 21:50
Does anyone on this board work at home depot? mnkysp6353 General Forum 2 30-12-2001 13:27


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

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