Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   2001 (http://www.chiefdelphi.com/forums/forumdisplay.php?f=40)
-   -   Need help in creating program to use servo's to shift drive (http://www.chiefdelphi.com/forums/showthread.php?t=12605)

archiver 24-06-2002 00:34

Need help in creating program to use servo's to shift drive
 
Posted by Barry Horwitz at 2/9/2001 10:55 PM EST


Coach on team #316, LunaTechs, from Salem County College and DuPont.



My building team developed a drive assembly that has a servo attached to the drive motor shifter. This will assembly will to shift from low to high gears. I am trying to control the shifting only when the joysticks are in dead stick position. I have the drive motors as PWM1 & 2. The servos are PWM 3 & 4. The trigger on joystick one controls the servos. The program now allows shifting all the time. I have tried to put conditional statements in the subroutine section and in the PWM limit switch control area. HELP!!!



archiver 24-06-2002 00:34

Re: Need help in creating program to use servo's to shift drive
 
Posted by Joe Ross at 2/10/2001 3:07 AM EST


Engineer on team #330, Beach Bot, from Hope Chapel Academy and NASA/JPL , J&F Machine, and Raytheon.


In Reply to: Need help in creating program to use servo's to shift drive
Posted by Barry Horwitz on 2/9/2001 10:55 PM EST:



I'm not sure that I understand your question. What is the problem?

archiver 24-06-2002 00:34

Re: Need help in creating program to use servo's to shift drive
 
Posted by Michael "Special K" Krass at 2/10/2001 9:41 AM EST


Other on team #271, Mechanical Marauders, from Bay Shore High School and Verizon.


In Reply to: Re: Need help in creating program to use servo's to shift drive
Posted by Joe Ross on 2/10/2001 3:07 AM EST:



: I'm not sure that I understand your question. What is the problem?

I think what they're trying to do here is use the programming to check whether or not the joysticks are in a dead position (i.e. the 'bot's not moving), and than use that information to allow or disallow shifting gears on the drill motors. This would prevent someone from shifting gears while the drills were spinning, and really messing things up.

I got that much, but I don't know anything about programming, so I can't help much more than that.

Hope this helps,
Michael

archiver 24-06-2002 00:34

Re: Need help in creating program to use servo's to shift dr
 
Posted by Chris Orimoto at 2/10/2001 2:31 PM EST


Student on team #368, Kika Mana, from McKinley High School and Nasa Ames/Hawaiian Electric/Weinberg Foundation.


In Reply to: Re: Need help in creating program to use servo's to shift drive
Posted by Michael on 2/10/2001 9:41 AM EST:



If that is the case, then you COULD program the
operator interface LED's to respond when the
joysticks are in the "dead zone". That's what we
did last year...sorry, but I don't remember the code
off hand.

Just my personal thoughts...

Chris, #368

archiver 24-06-2002 00:34

Try this...
 
Posted by Nate Smith at 2/10/2001 3:07 PM EST


Other on team #66, Frostbite, from Willow Run High School and GM Powertrain.


In Reply to: Re: Need help in creating program to use servo's to shift dr
Posted by Chris Orimoto on 2/10/2001 2:31 PM EST:



: If that is the case, then you COULD program the
: operator interface LED's to respond when the
: joysticks are in the "dead zone". That's what we
: did last year...sorry, but I don't remember the code
: off hand.

: Just my personal thoughts...

: Chris, #368

Here's something that should work...

1. Define a bit variable to keep track of whether or not it is safe to shift.

shiftOK VAR bit

2. After your deadstick routine(if you don't have one, i'd highly recommend it), put in code to check if your PWM outputs are 127(off) and set your shiftOK to 1 if they BOTH are, 0 otherwise...(yes, i know this isn't the best code for doing this, but anyway...)

shiftOK = 0
if PWM1 = 127 then check2
goto cantshift
check2:
if PWM2 = 127 then setshift
goto cantshift
setshift:
shiftOK = 1
cantshift:

3. Then, check the value of shiftOK when determining if you want to shift or not...

Nate

archiver 24-06-2002 00:34

Re: Need help in creating program to use servo's to shift drive
 
Posted by Barry Horwitz at 2/10/2001 11:27 AM EST


Coach on team #316, LunaTechs, from Salem County College and DuPont.


In Reply to: Need help in creating program to use servo's to shift drive
Posted by Barry Horwitz on 2/9/2001 10:55 PM EST:



: My building team developed a drive assembly that has a servo attached to the drive motor shifter. This will assembly will to shift from low to high gears. I am trying to control the shifting only when the joysticks are in dead stick position. I have the drive motors as PWM1 & 2. The servos are PWM 3 & 4. The trigger on joystick one controls the servos. The program now allows shifting all the time. I have tried to put conditional statements in the subroutine section and in the PWM limit switch control area. HELP!!!
: I need to put a statement in the program that will only allow the trigger to move PWM3&4 when the joystick is in dead stick position. Where in the program should this go and what might it look like?
:Barry



archiver 24-06-2002 00:34

Re: Need help in creating program to use servo's to shift drive
 
Posted by Matt Starkey at 2/10/2001 3:12 PM EST


Engineer on team #236, Techno Ticks, from Lyme/Old-Lyme High School and Millstone Power Station.


In Reply to: Re: Need help in creating program to use servo's to shift drive
Posted by Barry Horwitz on 2/10/2001 11:27 AM EST:



: : My building team developed a drive assembly that has a servo attached to the drive motor shifter. This will assembly will to shift from low to high gears. I am trying to control the shifting only when the joysticks are in dead stick position. I have the drive motors as PWM1 & 2. The servos are PWM 3 & 4. The trigger on joystick one controls the servos. The program now allows shifting all the time. I have tried to put conditional statements in the subroutine section and in the PWM limit switch control area. HELP!!!
: : I need to put a statement in the program that will only allow the trigger to move PWM3&4 when the joystick is in dead stick position. Where in the program should this go and what might it look like?
: :Barry


You can put some conditional statements anywhere you want to as long as they are inside the main loop. Try using a series of "IF" statements if you are not too concearned with the loop time changing on you depending on the conditions.
1) is the trigger pulled? (assuming that the trigger is input that changes the position of the servo's). if not skip the rest of the routine.
2) if so, are the drive motors standing still (both equal to 127). If not, skip the rest of the routine.
3) if so, move the servo to the new position.

Servo position will have to be stored between loops and a statement somewhere in the code (outside of the conditional statements) to set servo position to stored position each loop.

Hope this helps -- Didn't want to give it away, but would be happy to answer any more questions.




archiver 24-06-2002 00:34

here you go
 
Posted by Stephen at 2/10/2001 5:34 PM EST


Other on team #122, NASA Knights, from Grafton High School (Robotics team is at NHGS) and NASA.


In Reply to: Need help in creating program to use servo's to shift drive
Posted by Barry Horwitz on 2/9/2001 10:55 PM EST:



put this directly before you shift your gears
if p1_y 127 then NO_SHIFT:
if p1_x 127 then NO_SHIFT:
after that, you would put your conditional about the button being pressed, then your shift sequence; at the end of all the shifting put
NO_SHIFT:

Hope that helps, if not then e-mail me at Steven3554@yahoo.com

P.S.
if you have a dead band, make sure that this goes AFTER the dead band.



archiver 24-06-2002 00:34

you need more than that...
 
Posted by Joe Johnson at 2/10/2001 11:05 PM EST


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.


In Reply to: here you go
Posted by Stephen on 2/10/2001 5:34 PM EST:



I am not a big fan of shifting the transmissions, but
my understanding of those that do do it successful is
that they do a fairly complex set of instructions to
get it to shift correctly.

Something like: Stop. partial forward, partial backard,
shift, partial forward, partial backward. Continue.

Basically, you have to take the stress out of the
mechanism to get it to shift out of gear and then you
have to wiggle it to get it to fully engage in gear.

I think Andy Baker talked about this in a posting
earlier this season.

Good luck.

Joe J.




archiver 24-06-2002 00:34

Yep, something like that
 
Posted by Andy Baker at 2/10/2001 11:24 PM EST


Engineer on team #45, TechnoKats, from Kokomo High School and Delphi Automotive Systems.


In Reply to: you need more than that...
Posted by Joe Johnson on 2/10/2001 11:05 PM EST:



: Something like: Stop. partial forward, partial backard,
: shift, partial forward, partial backward. Continue.

: Basically, you have to take the stress out of the
: mechanism to get it to shift out of gear and then you
: have to wiggle it to get it to fully engage in gear.

Yes, I believe that's how we do it.

BUT, I do not know the code. Our software guys don't let me near the keyboard.

We've refined it down to the point where it takes under two seconds.

Andy B.



archiver 24-06-2002 00:34

Re: Yep, something like that
 
Posted by Travis Covington at 2/11/2001 6:24 PM EST


Student on team #115, MV ROBOTICS, from Monta Vista High School and Hitachi Data Systems - 3com - NASA Ames.


In Reply to: Yep, something like that
Posted by Andy Baker on 2/10/2001 11:24 PM EST:



what is the need for the forward and backward motion?

do the gearbox gears get ruined by not engaging?

how much damage occurs? or is it more for reliability purposes?

thx

-TC



archiver 24-06-2002 00:35

Re: Yep, something like that
 
Posted by Jay Lundy at 2/11/2001 6:36 PM EST


Student on team #254, The Cheesy Poofs, from Bellarmine College Preparatory.


In Reply to: Re: Yep, something like that
Posted by Travis Covington on 2/11/2001 6:24 PM EST:



: what is the need for the forward and backward motion?

: do the gearbox gears get ruined by not engaging?

: how much damage occurs? or is it more for reliability purposes?

: thx

: -TC

If you try to shift gear while the motors are running they get damaged. I'm not exactly sure how much damage they take or what happens to them but I dont think I want to find out. All I know is that they make a nasty sound.



archiver 24-06-2002 00:35

Re: Yep, something like that
 
Posted by Travis Covington at 2/11/2001 9:06 PM EST


Student on team #115, MV ROBOTICS, from Monta Vista High School and Hitachi Data Systems - 3com - NASA Ames.


In Reply to: Re: Yep, something like that
Posted by Jay Lundy on 2/11/2001 6:36 PM EST:



i know about not shifting while moving...im just curious about the disengament problems that occur such as the gear not meshing properly after you have shifted the servo position. how big of a problem is this?



archiver 24-06-2002 00:35

rotating robots syndrome
 
Posted by Joe Johnson at 2/11/2001 9:53 PM EST


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.


In Reply to: Re: Yep, something like that
Posted by Travis Covington on 2/11/2001 9:06 PM EST:



Depending on how excited your drivers are during a
shift (or rather during a partial shift), your
transmission may be just fine, or it may never shift
again, or it may end up in no-man's-land between high
and low -- resulting in rotating robots syndrome, a
sickness where your robot just goes in circles, forward
and back, as your fans scratch their heads, beat their
chests, and watch the clock tick down to 0:00 in
disbelief ;-)

It can be hideous.

Joe J.




archiver 24-06-2002 00:35

Re: rotating robots syndrome
 
Posted by Matt Leese at 2/11/2001 10:05 PM EST


Other on team #73, Tigerbolt, from Edison Technical HS and Alstom & Fiber Technologies & RIT.


In Reply to: rotating robots syndrome
Posted by Joe Johnson on 2/11/2001 9:53 PM EST:



: Depending on how excited your drivers are during a
: shift (or rather during a partial shift), your
: transmission may be just fine, or it may never shift
: again, or it may end up in no-man's-land between high
: and low -- resulting in rotating robots syndrome, a
: sickness where your robot just goes in circles, forward
: and back, as your fans scratch their heads, beat their
: chests, and watch the clock tick down to 0:00 in
: disbelief ;-)

: It can be hideous.

: Joe J.
Well, if you're driving in circles i'd HOPE you'd hit the stop button....

Matt



archiver 24-06-2002 00:35

Re: rotating robots syndrome
 
Posted by Travis Covington at 2/12/2001 2:18 AM EST


Student on team #115, MV ROBOTICS, from Monta Vista High School and Hitachi Data Systems - 3com - NASA Ames.


In Reply to: rotating robots syndrome
Posted by Joe Johnson on 2/11/2001 9:53 PM EST:



so no serious damage could be done? just that it might not fully engage and your bot would be dead or spinning in its tracks?

thanks again






archiver 24-06-2002 00:35

it gets worse
 
Posted by Ken Patton at 2/12/2001 12:20 PM EST


Engineer on team #65, The Huskie Brigade, from Pontiac Northern High School and GM Powertrain.


In Reply to: Re: rotating robots syndrome
Posted by Travis Covington on 2/12/2001 2:18 AM EST:



Serious damage could be done. Once you "miss a shift," the likelihood that the gear selector will slip out of gear the next time is increased. Its dependent on how long you grind away during that missed shift.

So, if it does happen, don't let it grind away. And have some spare gearboxes if you are at risk to this happening.

I'll bet that Technokats went through a few gearboxes during the development of their system to its current reliable state.

Ken



archiver 24-06-2002 00:35

Gearboxes and emotions
 
Posted by Andy Baker at 2/12/2001 1:40 PM EST


Engineer on team #45, TechnoKats, from Kokomo High School and Delphi Automotive Systems.


In Reply to: it gets worse
Posted by Ken Patton on 2/12/2001 12:20 PM EST:



Yes, we went through a few gearboxes, but not too many. I cannot remember more than two. I credit Jeff Burch for a conservatively-written piece of software that did not take any risks.

On the other hand, during the initial stages of this design, many people on our team were passionately emotional about whether or not we should do this. It was a big risk, we argued about it for a long time. The '99 Motorola Regional was tough for us. We blew a gearbox and some of us were ready to pitch the gear switching mechanism.

We stuck to it and finally got it to work consistently. This design is paying off for us and many other teams. I have not kept count of the number of teams who have contacted me about this design, but I expect to see more than 15 different teams using our gear shifting design from '00.

Sure, we are "giving away" this design. Seeing teams succeed with it will be a definite reward for us, sure, but also for FIRST in general. Upping the level of competition is good for us all. I think that we all enjoy seeing what each other come up with and there is a lot of informal "sharing" of ideas.

I think that this should happen more. It would be nice for teams who have minimal resources to be able to use other teams' past year's designs.

As for this year, we've got some trade secrets... but don't we all?

Andy B.




archiver 24-06-2002 00:35

Re: Yep, something like that
 
Posted by Jay Lundy at 2/11/2001 6:44 PM EST


Student on team #254, The Cheesy Poofs, from Bellarmine College Preparatory.


In Reply to: Yep, something like that
Posted by Andy Baker on 2/10/2001 11:24 PM EST:



: : Something like: Stop. partial forward, partial backard,
: : shift, partial forward, partial backward. Continue.

: : Basically, you have to take the stress out of the
: : mechanism to get it to shift out of gear and then you
: : have to wiggle it to get it to fully engage in gear.

: Yes, I believe that's how we do it.

: BUT, I do not know the code. Our software guys don't let me near the keyboard.

: We've refined it down to the point where it takes under two seconds.

: Andy B.

I don't quite understand the partial foreward, partial backwards and all that stuff. We have a simple gear shifting system that works everytime, takes about half a second to shift, and works with the press of a button. I wont go into much detail, but the code is only about 10 lines long and easy to read. It is really helpful because we can use high gear for speed, but when going up the ramp we lose traction so we go into low gear and keep going.



archiver 24-06-2002 00:35

Re: Need help in creating program to use servo's to shift drive
 
Posted by Jay Lundy at 2/11/2001 2:37 AM EST


Student on team #254, The Cheesy Poofs, from Bellarmine College Preparatory.


In Reply to: Need help in creating program to use servo's to shift drive
Posted by Barry Horwitz on 2/9/2001 10:55 PM EST:



Stephen's program is correct, it's just that it is better if you give it some leeway. I forget exactly what range I let the joysticks be, but because the calibration on the joystick could be off by 1,2, or even 3 and the speed controllers still stay inactive, I used a slightly different IF statement:

if p1_y > 131 or p1_y 131 or p2_y

noShift:

I found that this works better. I think the range in my program is actually a little bigger than 123-131 and it still never stalls, but do whatever you want. I also suggest (if you haven't already done this) to use the LEDs on the operator interface to tell you what gear you are in. Also, assuming you are using servos to shift gears, make sure you wait about a second after shifting gears to move again or you risk stalling. Better safe than sorry.





All times are GMT -5. The time now is 04:35.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi