At our school, we call this piece of code a stillspeed. Using a potentiometer (you can use an encoder, but you’ll need a reset button to ensure accuracy) your codes says if the potentiometer returns a value greater than, say, 800 and you are not controlling the lift then the motors lift up with power set to 10. If the potentiometer is returning a value less than 800 and you are not controlling the lift then the motors lift down with a power set to -10. The piece of code I’m including is pulled directly from my own program and works well. It makes the code for your driver control short and simple. We’ve set some rules in programming including that stillspeeds should not be above (abs) 15.
Something I noticed at the last competition is that you need more braces and still need to stretch the rubber bands more. You are not using the full potential energy stored in those rubber bands until you stretch them just before the breaking point. You can always replace rubber bands. It should be slightly harder for your lift to pull down than to lift up so that when you pick up objects the lift is relatively balanced. Also make sure the bands are lifting with the same force on both sides of your lift. Balancing the rubber bands makes a big difference. For braces, any space that you don’t need for object manipulators should go towards braces on your lift. With as high as you are going, you will need them.
In short, more rubber bands and braces with simpler programming.
Lift Sample Program.txt (718 Bytes)