Hello, So im a rookie programmer, and was wondering if there was a good tutorial for learning how to program a Supershifter for 2speed automatic. My team’s head programmer is not here anymore and we are down a creek without a paddle at the moment. Help would be nice. Btw we are using LAbview.
if you want automatic shifting, you should use the gearbox encoders that came with the supershifters to determine when the wheels are at their top speeds. this can be done with some simple testing & probing, or some math (probing would be my recommended course of action).
When you determine the gearboxes are at their max velocity, shift (are you shifting via servo or pneumatics?)
Better than switching at “top speed” would be to determine the speed where the motor power curves at low and high gear intersect.
You actually want to shift before you hit your low gear top speed. From a math standpoint you want to do it at the point that your velocity versus time plots for HG and LG cross over. You may want to adjust it for driving style. I recommend using the FRC Mastery framework and having this variable in a driving typedef in Robot Global Data. This will allow you to do a soft code deployment and iterate in on the ‘right’ value with your driver pretty quickly by adjusting the value in Front Panel.
2011-FRC3096 Robot Code v2.1.zip (1.59 MB)
2011-FRC3096 Robot Code v2.1.zip (1.59 MB)
I did a double take when looking at the title of this post… you should probably check your spelling
Looks fine to me :rolleyes:.
-
First you need manual control. This means control of either the pneumatic piston or servo, and adapting it into a simple form of control for the software (e.g. an enumerated type or boolean, instead of a servo angle)
-
An automated shifter is not an easy thing to program. We are currently working on improving a previous algorithm, and it has lots and lots of logic in place to make it shift as nicely as possible. Our initial algorithm many years ago (it just shifted on the average of the abs of the speed, when it hit the shift point) had several issues and we didn’t like it a whole lot.
-
If you just have a shift point, you will find issues in these cases:
Thrashing at part throttle (shifting up and down fairly fast)
Runaway when you don’t expect it (it upshifts when maintaining a fairly constant low speed)
Decel lurch - If you are coasting to a stop and it shifts down, the shifters can release asynchronously and the robot can twist. This seems like it would be more likely with servos, but even with pneumatics it happens at mid speeds.
I will not tell you how to solve this problem. It is a very complex one, and with some thought, it is possible to design an algorithm to handle it. In my opinion, algorithm design is the best part of programming.
Don’t forget: There is a very very large difference between making it work and making it work well.
You may want to consider giving the driver a way to lock out the high gear so they have an intermediate full throttle spped they can control.
Additionally, what is your system going to do when a wire on the encoders breaks or there is a pneumatic systems leak somewhere?
The way we do super shifters is pneumatics and a high gear/low gear button. So when the button is pressed they are in high gear and when it is not they are in low gear. It’s really easy to program.
Our drivers like this because it gives them total control over the speed and pushing power of the bot. Also I’m no mechanical person but I would imagine their some times when you would want to shift in to high gear before accelerating so you accelerate faster, as opposed to waiting for 1st gear to reach it’s full speed.
As for my personal opinion I would rather be a driver and have manual shifting that I can have now to practice with then to have automatic shifting later. That said even if time wasn’t a factor I would still rather have manual shifting then automatic shifting.
Just out of curiosity, are you sure that you need automatic shifting?
We’ve found that our robot can do everything we need it to do in High Gear (~13fps) without much problem. We use low gear to push and for finite positioning. Our shifting is controlled by one of the joystick triggers.