Our software is compatible, baby.
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 22-02-2005, 19:45
amateurrobotguy's Avatar
amateurrobotguy amateurrobotguy is offline
Lead Programmer/Senior Engineer
no team
 
Join Date: Feb 2005
Rookie Year: 2000
Location: ****
Posts: 136
amateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these parts
General Q's

Can I hook up PWM cables to digital output to a victor?
Is relayx_fwd mean that the value will be 1 (On)?
Likewise is relayx_rev make the value if the button on a stick is pushed =-1(Inverted On)?
What is the point of digital input?
Is there any way to fry the bot using programming?

If you want to know what I am doing, I have 2 joysticks. I want the left trigger to make the motor go down, and I want the right trigger to make the motor go up. In the program, I made all digital relays set to output(Default is only #17(which is crazy in my opinion)) and said p1_sw_trigger=relay1_rev and p2_sw_trigger=relay1_fwd(Or something along those lines). I also added in some clever code to make the motor continue what it is doing if the opposite trigger is already down. I haven't hooked up the motor yet, but I am going to hook the pwm cable from Digital I/O 1 to my victor 884. Then go from the victor to the motor. Will my plan work? The robot is shipped, so I can't physically test it for a month.

I ask if you can programically fry a bot, because I have been considering doing some pretty crazy stuff in the code. However, it appears that there is a load of build in safeguards to prevent the self-destruction of the robot. That doesn't say anything about the morons who want to 'physically' hook up five 12-volt batteries to a motor.
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).
  #2   Spotlight this post!  
Unread 22-02-2005, 20:05
Goobergunch Goobergunch is offline
Registered User
FRC #1168 (Malvern Robotics)
Team Role: Alumni
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Paoli, PA
Posts: 246
Goobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to all
Re: General Q's

Since a digital output will either return 1 or 0, I don't think it's a good idea to hook it up to a Victor - that'll send the Victor in question into full reverse. If the motor is small enough that you can hook it to a Spike, then your plan might work a bit better.

Also, wouldn't you want to hook the PWM in question to a relay output rather than a digital I/O? That's what it seems that you're doing in the code.

(Disclaimer, worn-out programmer who doesn't necessarily know what he's talking about.)
  #3   Spotlight this post!  
Unread 22-02-2005, 20:52
amateurrobotguy's Avatar
amateurrobotguy amateurrobotguy is offline
Lead Programmer/Senior Engineer
no team
 
Join Date: Feb 2005
Rookie Year: 2000
Location: ****
Posts: 136
amateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these parts
Re: General Q's

A relay is a digital output. Can anyone give me an example of when digital in would be used? Can a victor be used as a substitute for a spike(I don't need variable speeede)? I think that a realy has to give 2 1/2 values: 0, 1, and -1. The negative 1 come in when you want the motor to go reverse. The trigger on ly returns 0 or 1, but when it is processed through relay1_rev, it must somehow be inverted to allow the motor to go backwards. Is a PWM cable legal for digital i/o? Shouldn't it just be called a data cable then?
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).
  #4   Spotlight this post!  
Unread 22-02-2005, 21:03
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,769
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: General Q's

The Digital Ins can be used for any number of things. Most commonly, they are used for two things, limit switches and shaft encoders.

A limit switch is a microswitch attached to some part of the robot such that it closes or opens whenever the part reaches some point in its travel where you want it to stop. for instance, when a telescoping arm reaches maximum extension. Then you watch the value of the digital in and disable the motor in one direction when it changes.

Shaft encoders are small opto-electric devices that send n pulses everytime its shaft turns one revolution. This is useful for determining the distance your robot has traveled or its speed.

There's tons of other uses out there as well.

Also, you can easily use a victor like a spike. Write your program to set the particular PWM to 0, 128, or 255 for reverse, off, and forward, respectively.

Edit: also, also, you could use a digital out as a sort of PWM by pulsing it in the program. however, the current PWMs already have all that code taken care of for you, so you might as well use them.

Finally, the PWM cable is just a name. It could also be called a servo cable, etc. Most all the I/Os on the robot have +5(?)V, Ground, and Data pins of various sorts. The only thing that changes is the use of the data pin, so it's convenient to make them all standardized to the 3-pin PWM cable connectors.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter

Last edited by Kevin Sevcik : 22-02-2005 at 21:12.
  #5   Spotlight this post!  
Unread 22-02-2005, 21:24
amateurrobotguy's Avatar
amateurrobotguy amateurrobotguy is offline
Lead Programmer/Senior Engineer
no team
 
Join Date: Feb 2005
Rookie Year: 2000
Location: ****
Posts: 136
amateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these parts
Re: General Q's

In order to be able to use a victor to control my motor, wouldn't I have to recallibrate it so it can go negative and be on a -1->1 scale as compared to 0->255?
If I decide to hook up a spike, I am assuming that it will be hooked up in a similar fashion to the victor.
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).
  #6   Spotlight this post!  
Unread 22-02-2005, 22:53
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,769
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: General Q's

as I said, vics can already go in reverse. the mapping is approximately: 0,64,128,192,255 = -100%,-50%,0%,50%,100% this is ignoring a deadband in there.

recalibrating is faaaaar from necessary. you just need to ad the code in the program to set a PWM to 255 when you want full forward, or 0 when you want full reverse. or 128 when you want stop.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #7   Spotlight this post!  
Unread 23-02-2005, 01:10
thoughtful's Avatar
thoughtful thoughtful is offline
Registered User
FRC #1219 (Emery Iron Eagle)
Team Role: Alumni
 
Join Date: Nov 2003
Location: Toronto,Canada
Posts: 291
thoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to behold
Re: General Q's

Quote:
Originally Posted by amateurrobotguy
In order to be able to use a victor to control my motor, wouldn't I have to recallibrate it so it can go negative and be on a -1->1 scale as compared to 0->255?
If I decide to hook up a spike, I am assuming that it will be hooked up in a similar fashion to the victor.

You were talking about digital inputs before, a digital input is just anything tht return 0 or 1 (not -1). I know the relays has three states tht because u can actually have 3 states by having no signal, positive signal and negative signal. However, for you purpose lets think about the joystick button as a digital input since its 1 when its pressed and 0 when its reverse. Your code should be something like this:

Code:
If p1_sw_aux1==1
{ 
pwmX=255;
}
else if p1_sw_aux2==1
{
pwmX=0;
}
else
{

}
Note*: My syntax might not be correct, this program will not work properly is you press both buttons and the same time.
__________________
.:Bringling Brains to Life:.

03,04,05-Team 1219 Captain
2003 Rookie all Start @ GTR
2005 Galileo Semi-Finalist & Alliance captain
06-Team 1219 Mentor
2006 Radio Shack Innovation in control @ Waterloo
  #8   Spotlight this post!  
Unread 23-02-2005, 01:25
Ryan Cumings's Avatar
Ryan Cumings Ryan Cumings is offline
Programmer and University Rejected
#0134 (Team Discovery)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Pembroke, NH
Posts: 65
Ryan Cumings is an unknown quantity at this point
Send a message via AIM to Ryan Cumings
Re: General Q's

Quote:
Originally Posted by Kevin Sevcik
The Digital Ins can be used for any number of things. Most commonly, they are used for two things, limit switches and shaft encoders.

A limit switch is a microswitch attached to some part of the robot such that it closes or opens whenever the part reaches some point in its travel where you want it to stop. for instance, when a telescoping arm reaches maximum extension. Then you watch the value of the digital in and disable the motor in one direction when it changes.

Shaft encoders are small opto-electric devices that send n pulses everytime its shaft turns one revolution. This is useful for determining the distance your robot has traveled or its speed.

There's tons of other uses out there as well.

Also, you can easily use a victor like a spike. Write your program to set the particular PWM to 0, 128, or 255 for reverse, off, and forward, respectively.

Edit: also, also, you could use a digital out as a sort of PWM by pulsing it in the program. however, the current PWMs already have all that code taken care of for you, so you might as well use them.

Finally, the PWM cable is just a name. It could also be called a servo cable, etc. Most all the I/Os on the robot have +5(?)V, Ground, and Data pins of various sorts. The only thing that changes is the use of the data pin, so it's convenient to make them all standardized to the 3-pin PWM cable connectors.
The spikes are really two relays. When in the off state both outputs are tied to ground. If you ONLY set relay1_fwd then M+ is tied to the positive voltage (12 v anyone?) and M- is still tied to ground. If you ONLY set relay1_rev then M- is tied to 12v and M+ is still tied to ground. If you set both relay1_fwd and relay1_rev then M+ and M- are both tied to 12v. Taking advantage of this you can run a double solenoid using only one spike.
__________________
Suddenly being rejected from college feels right during the build season. Now I am a mentor.
  #9   Spotlight this post!  
Unread 23-02-2005, 16:59
amateurrobotguy's Avatar
amateurrobotguy amateurrobotguy is offline
Lead Programmer/Senior Engineer
no team
 
Join Date: Feb 2005
Rookie Year: 2000
Location: ****
Posts: 136
amateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these parts
Re: General Q's

I am going to be non-secretive(As most teams are) and share my code in the UserRoutines.c . I am going to just hook up a spike instead of a speed controller. I figure hardware editing is quicker than software editing in this case. This snippet comes from the Buttons to Relay mapping part. Enjoy!

/*---------- Buttons to Relays----------------------------------------------
*--------------------------------------------------------------------------
* This default code maps the joystick buttons to specific relay outputs.
* Relays 1 and 2 use lim it switches to stop the movement in one direction.
* The & used below is the C symbol for AND
*/
if (p2_sw_trig<>0) /*If the opposites trigger is down. */
{
} /*Do nothing.*/
else
{
relay1_rev = p1_sw_trig & rc_dig_in01; /* REV only if switch1 is not closed. */
}
relay1_rev = p1_sw_top & rc_dig_in02; /* REV only if switch2 is not closed. */
if (p1_sw_trig<>0) /*Same as above. */
{
}
else
{
relay1_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;
relay5_fwd = p1_sw_aux1;
relay5_rev = p1_sw_aux2;
relay6_fwd = p3_sw_aux1;
relay6_rev = p3_sw_aux2;
relay7_fwd = p4_sw_aux1;
relay7_rev = p4_sw_aux2;
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
relay8_rev = 0;

All it does is wire Port 1 joystick trigger to reverse on our arm and port 2 trigger to forward. If a trigger is already down then ingnore the new command. I have very little C experience, so I hope this code is valid.
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).
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
General Dynamics? Mike Rush General Forum 1 31-01-2003 17:04
General Forum congestion archiver 2001 7 24-06-2002 03:32
general forum threads archiver 2001 8 23-06-2002 22:47
2 Useful Websites - And general tips and Ideas Robby O 3D Animation and Competition 0 13-01-2002 02:03


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

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