Go to Post NOOOOOOOOOOOOooooooo!!!!! I hate regolith. - apalrd [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 27-12-2012, 12:36
Adam.garcia Adam.garcia is offline
Design Mentor
FRC #0004 (Team 4 Element)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 1997
Location: High Tech LA
Posts: 133
Adam.garcia is just really niceAdam.garcia is just really niceAdam.garcia is just really niceAdam.garcia is just really nice
Programming for a Shifting Gearbox

While looking at Andrew Palardy's spreadsheet, something occurred to me which I had not thought about before. In a two speed shifting gearbox, the "low gear" will have a higher acceleration for a small time frame than the "high gear" would. And this led me to a few questions:

1) Do some teams have logic built into their code to "auto-shift" according to where the acceleration is the greatest?

2) Is there some sort of logic through the use of sensors (or other means) that can be developed so that the robot will know when it is either pushing into a stationary object (whether it be a wall or other robot) so that it can automatically shift into Low Gear to provide the extra torque needed?

If other teams have used this method, can you please explain how you developed this logic?

Thanks!
__________________
“The object of education is to teach us to love what is beautiful.”

“Never discourage anyone who continually makes progress, no matter how slow.”
  #2   Spotlight this post!  
Unread 27-12-2012, 12:52
fsgond's Avatar
fsgond fsgond is offline
Why aren't you throwing balls?!
AKA: Anthony
FRC #5484 (Memento Vitam)
Team Role: Coach
 
Join Date: Oct 2007
Rookie Year: 2007
Location: South Bend
Posts: 106
fsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant futurefsgond has a brilliant future
Re: Programming for a Shifting Gearbox

We have not used shifters in a few years, but when we did it was a manual shift. Mainly we had problems when we would shift under stress, such as driving at high speeds or in a pushing match. We started to round the gears down. Basically we had to do what you would do in a manual transmission car if you shift without a clutch. As long as everything was moving at about the same speed everything would shift great, but if we were really on the sticks and shifted, it would make a horrible sound due to the grinding gears.

If you are set on doing it though, it should not be too hard. You would need to figure out at what speed you want to shift. Then you would need to have an encoder on the wheels determine when you reach that speed. As for pushing, you may look at monitoring how fast you are going VS current pull. If you have high current an little acceleration, you can think that you are pushing someone or some thing. This is all of course if you are on a flat floor.
__________________
Anthony Rubio
Co-Coach, Memento Vitam Team 5484, 2015-????
Mentor, Black Knights Team 135, 2009-2015
Student, Black Knights Team 135, 2007-2008
  #3   Spotlight this post!  
Unread 27-12-2012, 12:54
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Programming for a Shifting Gearbox

1. That's John V-Neun's spreadsheet. I added a few columns and a graph, but the majority of it is JVN's.

2. Yes, we have done this. Our 2011 code release includes such functionality. It's in drivetrain/autotrans.vi. Upshift is enabled and was used frequently, downshift was disabled. The driver wanted the robot to stay in high while placing a tube unless he commanded a shift, because a shift would change the turning behavior. We also never calibrated the downshifts as well as the upshift, mostly due to testing time. Since that robot had a 2-speed the logic only calculates upshift when in low and downshift while in high, if we had a multi-speed the architecture would be different but the logic would be the same.

The logic works basically in three ways: power-on upshift, kickdown, and coastdown. Upshift occurs based on robot acceleration, vehicle speed, and throttle positions. Kickdown (downshift for power) occurs when the robot is decelerating, is below a vehicle speed threshold (~8fps), and the driver is not requesting slow down (sticks > 0.85). Coastdown (downshift at very low speed) occurs when the driver is not requesting power, and the vehicle speed is very low (~2fps). We never autoshift while turning, and we prevent autoshifts 500ms after any shift.

We based the 2011 algorithm off our previous algorithms originating in 2004, which were developed from automatic transmission algorithms for cars. The logic is basically a bunch of thresholds on acceleration, speed, and driver input, and when they are all true it shifts.

This algorithm is most useful in high-speed full field games. It is much less useful in short games where the high gear acceleration is higher (due to lower top speed), and it basically requires the shifters to shift synchronously (no servo shifting) or the robot will randomly twist during an unexpected shift, which the driver will not like.

Edit:
I never had any issue shifting under load with the pneumatically-shifted AndyMark transmissions. The servo transmissions wouldn't shift under load period, but the pneumatic ones seemed fine. The life cycle of an FRC robot is measured in hours, so properly greased gearboxes don't usually wear like cars. Some motorcycle transmissions shift without using the clutch, and they live.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

Last edited by apalrd : 27-12-2012 at 12:58.
  #4   Spotlight this post!  
Unread 27-12-2012, 13:06
Adam.garcia Adam.garcia is offline
Design Mentor
FRC #0004 (Team 4 Element)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 1997
Location: High Tech LA
Posts: 133
Adam.garcia is just really niceAdam.garcia is just really niceAdam.garcia is just really niceAdam.garcia is just really nice
Re: Programming for a Shifting Gearbox

Quote:
Originally Posted by apalrd View Post
1. That's John V-Neun's spreadsheet. I added a few columns and a graph, but the majority of it is JVN's.
Aahh yes, I should give credit where credit is due.


Quote:
Originally Posted by apalrd View Post
2. Yes, we have done this. Our 2011 code release includes such functionality.
Thank you very much. I will show this to my team's programmers.
__________________
“The object of education is to teach us to love what is beautiful.”

“Never discourage anyone who continually makes progress, no matter how slow.”
  #5   Spotlight this post!  
Unread 30-12-2012, 11:46
Secretspy97 Secretspy97 is offline
Registered User
FRC #1126
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2009
Location: New York
Posts: 25
Secretspy97 is an unknown quantity at this point
Re: Programming for a Shifting Gearbox

We used shifting on our 2011 robot. Our drive train was a 6 wheel tank drive with omni-wheels in front. We mounted encoders on each-side which told us the speed of each side of the robot. If our encoders were saying that both side of the robot were above a certain speed (can't be turning) than we would shift up. If the encoders were going slower then another desired speed then we would shift down. One problem with shifting and using encoders is that shifting causes the robot to slow down briefly. This could cause the robot to isolate between low and high gear. To fix this problem you need two separate "if statements" to shift. (For example you shift up when going faster then 6 ft/second and shift down when going slower then 5 ft/second). Our second problem with shifting was that the gears didn't want to mesh when shifting at high speeds. We fixed this problem by setting both motors to 0 for 0.1 second before shifting.

Hope this helps!
__________________
WHAT TIME IS IT?
1126
  #6   Spotlight this post!  
Unread 30-12-2012, 14:39
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Programming for a Shifting Gearbox

Since it's in the code release anyway, I guess I'll write out the shift conditions we used. Assume that we Abs all of the inputs first so there's no directionality differences.

Any shift auto shift:
-No shift in last 500ms
-Stick differential threshold limit to prevent shifting while turning (for tank drive skid steer). This is pre-Abs of throttles.

Upshift (power-on upshift):
-Throttles min (already in ft/sec) 20% greater than shift point FPS
-Acceleration of throttles not negative (with some deadband for noise)
-Wheel acceleration rate greater than constant
-Output speed greater than shift point

Downshift (kickdown):
-Gearbox output speed < 8fps or so (slightly higher than or equal to our peak speed in the lower gear)
-Throttles > 80%
-Wheel acceleration rate is negative and below a constant (vehicle is rapidly decelerating)

Downshift (coastdown):
-Gearbox output speed < 2fps

We don't do any special execution of the shift. Once we have decided to shift, we set the pneumatic solenoids and are done for at least 500ms.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
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


All times are GMT -5. The time now is 20:44.

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