Go to Post I guess the freshmen had to learn the hard way, never turn your back on a robot. - Bcahn836 [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 22-03-2013, 19:50
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Automatic 2 Speed Drivetrain Shifting Code

I've been looking into automatic drivetrain shifting code. I've found this thread pretty helpful so far, specifically
apalrd's post. I've basically been looking all over this search. I've also found 254's driving code here and here, but I just don't know enough C++ to understand exactly how it works (or if it even auto-shifts! - I was told that they do but I can't find where it happens). Anyways, I'm just looking for some kind of rundown on how exactly you'd determine whether to shift up or down. So far I've come up with this:

Code:
    if (input > shiftersInputThreshhold && m.encoder.getRate() > shiftersSpeedThreshhold 
        // Make sure not to shift too much
        && (System.currentTimeMillis() - lastShift) > shiftersShiftTimeLimit * 1000) {
        m.gearShifterController.setSecondGear();
        lastShift = System.currentTimeMillis();
    } else {
        m.gearShifterController.setFirstGear();
    }
Although I can't think of them right now, I have a pretty strong feeling that there are a lot of things that this doesn't account for. Just as much, I have no idea what to set "shiftersSpeedThreashhold" or "shiftersInputThreashhold". It seems arbitrary to me. I've been told (and others in old threads have alluded to) that JVN has some kind of way to determine those kinds of threashholds. We're using 2 CIMs and the super shifter gear box (from what I'm told). Is there anywhere you could point to for some ways for algorithms to shift gears?

My goal here is for it to shift when the robot is going fast enough that it needs to, and have enough torque to push others around.

Oh and one last thing, should shifting take turning into account? Right now that's a little bit difficult to do with my code (for implementation reasons). What benefit would something like this
Code:
if(abs(turn) > 0) doNotShiftGears()
give me? Is it really necessary if we aren't using tank drive?
__________________
All opinions are my own.
 


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 10:32.

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