Go to Post I want to wish everyone a Happy Ship Day. - JohnBoucher [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-03-2006, 03:34
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Disabling the Radio Control

Hi,
Im programming the VEX using MPLAB.
I have downloaded the Vex's default code, but in this code the robot can't do anything unless the radio transmitter is switched on. I want to disable this option because I don't want to use it at all (My robot is fully autonomous and is not designed for the FVC)

Does anyone know how can I disable The RC?

Thanks,
Guy
Reply With Quote
  #2   Spotlight this post!  
Unread 06-03-2006, 10:59
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Disabling the Radio Control

You could try loading MasterCode Version 5
Reply With Quote
  #3   Spotlight this post!  
Unread 06-03-2006, 12:05
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Disabling the Radio Control

I tried, but it didn't help.
Do I need to change anything in the code itself to make it work?

Im desperate....
Reply With Quote
  #4   Spotlight this post!  
Unread 06-03-2006, 12:30
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,830
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Disabling the Radio Control

It's pretty simple.
Just add this line to your initialization and the Master processor will ignore the radio.
Do a search, it may already be in there somewhere.
Code:
txdata.user_cmd = 0x02;	 /* Tell master you want to be in auton mode. */
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #5   Spotlight this post!  
Unread 06-03-2006, 12:53
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Disabling the Radio Control

Thanks, it did work, but just when my code was in the "User_Autonomous_code" function.
I want to write it in "User_Routines_fast" in the "Process_Data_From_Local_IO" (It's faster, isn't it?)

What do I need to do in order to write it there?
I tried to do that and it didn't work when the transmitter was switched off, while it did work when the code was in the autonomous function.
Reply With Quote
  #6   Spotlight this post!  
Unread 06-03-2006, 13:25
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,830
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Disabling the Radio Control

Quote:
Originally Posted by Guy_E
I want to write it in "User_Routines_fast" in the "Process_Data_From_Local_IO" (It's faster, isn't it?)
If I understand your question correctly...

You can only update your controls at the (slower) rate the data packets arrive and leave again, no faster. Those are the GetData/PutData calls you can see in the Autonomous loop. You cannot speed them up.

Process_Data_From_Local_IO runs much faster than the autonomous loop so you can do things like sample sensors. The CPU should be much faster than the rate you change your motors and stuff. You should always be able to think much faster than you can act.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #7   Spotlight this post!  
Unread 06-03-2006, 13:33
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Disabling the Radio Control

So I should sample my sensors in "Process_from_local_IO" and change the motors in "User_Autonomous_Code"?

I just need to call "Process_from_local_IO" from the "User_Autonomous_Code"?

But can I do it all in the "Process_from_local_IO" or will it "confuse" the CPU?
Reply With Quote
  #8   Spotlight this post!  
Unread 06-03-2006, 14:32
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,830
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Disabling the Radio Control

Quote:
Originally Posted by Guy_E
So I should sample my sensors in "Process_from_local_IO" and change the motors in "User_Autonomous_Code"?

I just need to call "Process_from_local_IO" from the "User_Autonomous_Code"?

But can I do it all in the "Process_from_local_IO" or will it "confuse" the CPU?
The way the default Vex code is organized you have to add Process_From_Local_IO to the auto loop in User_Autonomous_Code, if you want it to be called while you're running autonomously. Be careful where you place it though. I actually get rid of this autonomous loop altogether and depend instead upon the main loop in main.c, but that's only a personal choice.
Code:
  while (autonomous_mode)   /* DO NOT CHANGE! */
  {
	if (statusflag.NEW_SPI_DATA)	  /* 18.5ms loop area */
	{
	  Getdata(&rxdata);   /* DO NOT DELETE, or you will be stuck here forever! */
	 /* Add your own code here. */
	  printf("%2x : %2x %2x %2x %2x %2x %2x\n",(int)rxdata.rc_receiver_status_byte.allbits,
		(int)PWM_in1,(int)PWM_in2,(int)pwm01,(int)pwm02,(int)pwm03,(int)pwm04);
	  Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
	}
	Process_Data_From_Local_IO();
  }
If you want to you can set the variables used for the motors as fast as you like (in Process_From_Local_IO for instance), just realize only the values in there at the time of the slow loop will be acted upon. If you're constantly setting the motors to the same value then it won't matter to you.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #9   Spotlight this post!  
Unread 06-03-2006, 14:57
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Disabling the Radio Control

You've helped me so much!

Thanks a lot!
Reply With Quote
Reply


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
Concept of PID explained ConKbot of Doom Technical Discussion 11 27-01-2008 00:11
Radio Problem on FRC TuaMater Control System 4 26-01-2006 07:32
2005 RadioShack Innovation In Control Award--What Won? Billfred Control System 8 12-06-2005 01:51
Intermittant control with radio TimeOut Control System 45 15-04-2004 12:00
reworking radio control for joysticks ajlapp Electrical 5 05-12-2003 17:38


All times are GMT -5. The time now is 03: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