View Single Post
  #13   Spotlight this post!  
Unread 26-02-2007, 22:22
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Lowering the voltage on a spike

They rate a Spike at only 6 switches/minute with a load. I would seriously consider a Victor. It's your best option between a lot of high gauge wire or any other options posted here other than the victor idea.

Quote:
Originally Posted by Mr. E View Post
The drives been built. so I can't change the gears on the motors.
Just so I don't look like an absolute ignoramus, I do know how a spike and victor work, I just want to know if its possible.

I know I'm not C savy, so things like
#define DRIVE_SLOW_FWD 155
#define DRIVE_SLOW_REV 99

// other code...

pwm01 = DRIVE_SLOW_FWD;

always seems like an extra step that I don't have to do, especially when I can just say pwm01=155 and put in a comment on the side that reminds me what the line is actually doing.

Okay....
the window turns a motor until it hits a switch. If I use a relay I can use
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. */
in the default code and it will do exactly what I need. (ex. turn right until the switch is hit--rc_dig_in01--, not be able to turn right anymore right, but will be able to turn left until it hits the other switch--rc_dig_in02--)
but of course the motor turns too fast.

If I wire the window to a victor then I have to write new code (thread--Programming a switch) to control the victor in the same fashion. I may have to do it this way, which was a little bit beyond my C skills.
So I decided to go the other route and see if there was a way of just slowing down a victor, but apparently not.
but I might be able to program a victor to work of a joystick button
Okay, I'm not sure if this will help you a lot, but I recently reprogrammed our 2003 robot. This robot uses PBASIC and not C, but this will give you a general idea if you know anything about If Then statements, which I assume you do. All you need to do is set:
pwm1 = 127 'for off'
pwm1 = 0 'for full reverse/forward'
pwm1 = 254 'for full forward/reverse'

Use the If then statements to set the limits for the motor. Once these limit switches are closed, set the pwm1 signal to 127 to stop the motor. You can use anything from 0-126 for one direction or 128-254 for the other direction, and of course the closer you get to 127, the slower the motor turns. I wish I had the code I made last week for our robot, it's an excellent example on what to do. In our application we had a motor controlling a shifter with 2 limit switches on the shifting rod. The robot would set the shifter to 1 or 0 by the use of the joystick and would keep it at 1 or 0 infinitely until the joystick button had been pressed to turn a different direction or if the robot had been turned off.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364

Last edited by RyanN : 26-02-2007 at 22:32.