Team2168 / 2016_Main_Robot

Code for the 2016 season
0 stars 0 forks source link

Shooter Servo Bounds and Hood With Joystick Command #18

Closed NotInControl closed 8 years ago

NotInControl commented 8 years ago

@Harris-Jilani

We finally got the Servo's in house and played with them over the weekend. We noticed that by default, they didn't work too well out of the box.

It appears the default Sevo class sets up the PWM bounds to be between 0.6 ms and 2.4 ms. This gives about 8 turns on the output of the servo, and getting to 0 was very inaccurate.

However, watching a video on the Servo City website confirmed that if we used that range, we could see such a large output of turns, so it wasn't alarming.

https://www.servocity.com/html/hs-785hb_3_5_rotations.html

We found a setBounds method which allowed us to control the bounds of the Servo to its more tolerable range:

1050 - 1950 us range. However, it appears WPILib deprecated that method and replaced it with another one that they didn't make public. So I guess for now use the deprecated one so we don't have to recompile the WPILib files.

What I'd like you to do is fix the bounds of the Servo. We read the data sheet, and came up with the following line of code

hoodServo.setBounds(1950, 8, 1500, 8, 1050);

This method has the declaration of (Max Pulse, High DeadBand, Center Pulse, Low DeadBand, Min Pulse)

That will need to go in the constructor of the Hood subsystem. Need to confirm 8 is the proper number for deadband.

Also need to write a new command which drives the hood with Joysticks. Use what we have in the branch HoodWithJoystick as an example. Note, in the branch we made, we have the setBounds method in the setAngle method, but it really belongs in the constructor.