Go to Post (This is why Non-Engineering Mentors make the dinner plans for the team...) - KathieK [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 31-01-2005, 19:41
rcubes85 rcubes85 is offline
Registered User
no team (TBD)
Team Role: College Student
 
Join Date: Feb 2003
Rookie Year: 1999
Location: Troy NY
Posts: 39
rcubes85 is on a distinguished road
Send a message via AIM to rcubes85
URgent Programming Help needed

Hi how are you doing i am doing programming for the first time and we are using a F-16 Fighter stick

http://www.surcouf.com/images/catalo...77/g147734.jpg

I was wondering do any one know what we have to do so that we can use one of the buttons on this joystick to do some let say move the robot to a certain position. Like if you push a button on the joy stick the robot arm will move to a certain position. so what the process i have to go through to get this done. like what do we have to change in the code, and what wires do we have to use we are using the globe motors too. thank you

I understand that we have to use the code listen below but in what way or form
thanks


#define p1_sw_trig rxdata.oi_swA_byte.bitselect.bit0 /* Joystick Trigger Button, same as Port4 pin5 */
#define p1_sw_top rxdata.oi_swA_byte.bitselect.bit1 /* Joystick Top Button, same as Port4 pin8 */
#define p1_sw_aux1 rxdata.oi_swA_byte.bitselect.bit2 /* Aux input, same as Port4 pin9 */
#define p1_sw_aux2 rxdata.oi_swA_byte.bitselect.bit3 /* Aux input, same as Port4 pin15*/
__________________
you can run from the past
you can change the present
but you can't outrun the future
becuase what you do in the presents depicts your future
  #2   Spotlight this post!  
Unread 31-01-2005, 19:53
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: URgent Programming Help needed

Quote:
Originally Posted by rcubes85
Hi how are you doing i am doing programming for the first time and we are using a F-16 Fighter stick

http://www.surcouf.com/images/catalo...77/g147734.jpg

I was wondering do any one know what we have to do so that we can use one of the buttons on this joystick to do some let say move the robot to a certain position. Like if you push a button on the joy stick the robot arm will move to a certain position. so what the process i have to go through to get this done. like what do we have to change in the code, and what wires do we have to use we are using the globe motors too. thank you

I understand that we have to use the code listen below but in what way or form
thanks


#define p1_sw_trig rxdata.oi_swA_byte.bitselect.bit0 /* Joystick Trigger Button, same as Port4 pin5 */
#define p1_sw_top rxdata.oi_swA_byte.bitselect.bit1 /* Joystick Top Button, same as Port4 pin8 */
#define p1_sw_aux1 rxdata.oi_swA_byte.bitselect.bit2 /* Aux input, same as Port4 pin9 */
#define p1_sw_aux2 rxdata.oi_swA_byte.bitselect.bit3 /* Aux input, same as Port4 pin15*/
The way the default code is set up, you don't need to modify anything, if you are using pneumatics. Hook up the pneumatic valve (ask me if you don't know how) to a Spike (bi-directional relay, provided in kit), hook up the power cables (positive to circuit breaker, negative to negative on circuit breaker), hook up the PWM cable to the Relay Output #1, and that pneumatic will operate when the trigger of Joystick 1 is pressed. Use Relay Output #2 for Joystick 2, and so on. The code that dictates this operation is not where you found it, it is in user_routines.c and is listed as follows:

relay1_fwd = p1_sw_trig & rc_dig_in01; /* FWD only if switch1 is not closed. */
relay1_rev = p1_sw_top & rc_dig_in02; /* REV only if switch2 is not closed. */
relay2_fwd = p2_sw_trig & rc_dig_in03; /* FWD only if switch3 is not closed. */
relay2_rev = p2_sw_top & rc_dig_in04; /* REV only if switch4 is not closed. */
relay3_fwd = p3_sw_trig;
relay3_rev = p3_sw_top;
relay4_fwd = p4_sw_trig;
relay4_rev = p4_sw_top;

You can change the behavior by changing these. Good luck, and tell me if something isn't working or you don't know how...
__________________
Aren't signatures a bit outdated?
  #3   Spotlight this post!  
Unread 31-01-2005, 21: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: URgent Programming Help needed

Quote:
Originally Posted by rcubes85
I was wondering do any one know what we have to do so that we can use one of the buttons on this joystick to do some let say move the robot to a certain position.
JBotAlan has pointed out how the code can essentially copy the OI switches to RC relay outputs. If you want to do anything fancier than that, you'll have a lot more programming in front of you. There are feedback sensors on robot joints, accelerometers and angular rate sensors, PID controls, etc... Get specific with your questions and we can give you specific help on how to do what you want.

(The section of the code you quoted is just providing "easy" names for the bits of communication from the master CPU that represent the state of the joystick switches.)
  #4   Spotlight this post!  
Unread 15-02-2005, 22:13
Coachmac's Avatar
Coachmac Coachmac is offline
Team Coach
#1670 (The Loose Nuts)
Team Role: Coach
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Manhattan, KS
Posts: 19
Coachmac is an unknown quantity at this point
Exclamation Re: URgent Programming Help needed

So, I was looking for some programming help and I think I found what I was looking for, but would like some reassurance. We are using one cylinder for our manipulator. My question was, "What programming do we need to do in order to activate that cylinder? We plan on using a double sylinoid (sp?)."
From what I read, we don't need to do any additional programming. Part of the default code provides for use of the cylinder via a button or trigger on the joystick. Is this correct?
We are a rookie team and have access to VERY LIMITED programming experience. Any codes or help is GREATLY appreciated.
__________________
"Life isn't about finding yourself... it's about creating yourself."
George Bernard Shaw
  #5   Spotlight this post!  
Unread 15-02-2005, 23:21
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,833
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: URgent Programming Help needed

I couldn't resist. I just posted this code elsewhere for another purpose, but it applies here as well.
Code:
if (p1_sw_trig==1)  // Cylinder one way
{
	relay2_fwd = 1;
	relay2_rev = 0;
}
else if (p1_sw_top==1) // Cylinder the other way
{
	relay2_fwd = 0;
	relay2_rev = 1;
}
else  // Cylinder not moving
{
	relay2_fwd = 0;
	relay2_rev = 0;
}
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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
Programming - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
Help needed for getting started! chantilly_team Programming 4 27-10-2004 08:29
Robot Programming Education phrontist Programming 11 03-05-2004 07:32
Urgent!! (programming question) anupalsingh Programming 6 25-02-2004 10:53


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

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