TUR-03: Servo turret - two measured points and its start angle
- Your robot needs: Turret.
- Starter bots that fit: none (it needs parts the starter bots do not have).
- Library version: v0.17.0 or newer.
- The docs it tests: Setting up a turret, Finding your numbers (the finders), Hardware module.
Why
A turret on a standard servo has no encoder and no PID: the library turns an angle into a servo position from two measured points. A servo cannot say where it is, so at START it is sent to its start angle. A small, cheap turret is common on new teams' robots; we have only tried it in the simulator.
Safety
- The servo moves at START. Fingers and wires away from it.
- Listen for a humming servo at the ends: that is a servo pushing on a stop. Back off at once.
Setup
Turret.servo("turret")inRobot.java(add.follows(camera)to test the aim too).Tunables.Turret:posA,angleA,posB,angleBfrom the Servo Finder and a phone angle app, andtravelSec(time a move from posA to posB).- Optional:
.fullRange()on the line for the servo's whole turn (MEC-02). Measure posA and posB after turning it on.
Steps
- INIT. Nothing moves. Read the turret's INIT lines.
- START. The turret goes to its
startAngle(or the middle of its range if you wrote none). - Turn it with the stick (gamepad 2 right stick X) to 0, then to each end. Measure the real angle each time with the phone app.
- Turn it to 4 angles between the ends (by stick, or with
robot.turret.aimAt(degrees)on a button). Measure each. - With
.follows(camera): let it follow the goal. It reads AIMED only aftertravelSechas passed since its last move.
Pass rule
At each of the 6 angles in steps 3 and 4 the real angle is within 3 degrees of the Driver Station's, and the servo never hums at an end (0 times).
Record
Write these down while you test. The report form has them as a list to fill in.
- servo model, gears, and whether you used
.fullRange() posA,angleA,posB,angleB,travelSec- each angle: Driver Station vs measured
- how long AIMED took after a move (about)
If your robot is different
A servo turret on a linkage (not straight gears) turns unevenly between the ends: say how far off the middle angles were. A continuous-rotation servo with an encoder is a different kind: Turret.crServo(...), see the turret setup guide.
Report your result
Pass, fail, or could not run: every result helps. The form opens on GitHub with this test filled in (a free GitHub account is needed). No student names, please.
Report resultNo reports for this test yet: yours would be the first. Every test's reports.
All tests · Next: AIM-04 Aim Tuner - find the camera offset from real shots
Something wrong on this page? Tell us with a short GitHub form.