How did you zero your turret?

Hello! This past year we attempted to use hall effect sensors to zero our turret, we had 3 sensors in total, one at 0 degrees, one at -90 degrees, and one at +90 degrees. We attempted using these during testing but found that when we set our turret to go towards something near one of those sensors like 0.2 degrees, 91 degrees etc, that the sensor would have a huge actuation range and cause the PID to flip out, could this be because our hall effect sensors were mounted improperly? Is it common practice to just zero your turret once prior to a match and consider drift a non issue?


1 Like

For 2020 and 2022 we just let the turret get it’s 0 point from the initialization position.

We never got on the fly shooting going in 2022 so we never needed a precise measurement of turret angle relative to the robot. If we had gotten to that point I think the plan was just to put a precise pointer and mark on the robot and line it up manually before the match.

You mentioned drift in your turret position, how are you driving the turret and what encoder are you using? I wouldn’t expect any drift in that measurement at all.

If you want to use hall effect sensors (or really any kind of switch at all) you really have to run a proper homing routine to get a precise 0 point. If you don’t, the actuation range of the switch and polling rate of the controller will affect the 0 point a lot. Generally the sequence is:

  1. Go towards the switch at a medium speed until the switch is made
  2. Stop and reverse direction until the switch turns off
  3. Stop and go forward again at a VERY slow speed until the switch is made again
  4. Stop and read sensor value/reset encoder

I wouldn’t recommend resetting zero every time you actuate the switch because of reasons Orion listed. What you can do is check that you’re within an acceptable range (maybe +/- 1 degree?) when the switch trips and as long as that’s true there is no reason to reset zero, but I don’t think that’s worth doing either since in my mind it’s more likely your hall effect sensor or mounting of it fails than your turret driving mechanism slips.

On 3538 we zeroed using the rev mag limit switch but did not monitor that limit switch during the match / do anything with it past initial zero. It was only used in case we lost turret zero for whatever reason which as far as I know never happened. On 8332 (mostly the same robot) we never used that sensor and just set soft limits based on starting position. Turns out you don’t actually need to know where a turret is in an absolute context as long as your soft limits are sufficiently far from a mechanical limit. We never attempted shooting while moving.


We zeroed the turret on boot / with a button on Shuffleboard. Lined up 2 sharpie marks on the ring bearing prior to the match. Used the falcon’s internal encoder for positioning, with no additional sensors (besides the Limelight).


At start-up we ran it at low voltage until it hit a physical stop, we monitored the current, when the current exceeded an empirically determined value, it was at the stop and set the zero there. It worked well.
Its one drawback was it took a bit of time, but as long as the turret wasn’t too far from the stop to start with it did not hinder our auto.

1 Like

Thank you! I was just wondering if drift was an issue, we didn’t encounter any, we were using a versaplanetary gearbox encoder. We ended up doing what many of the other posters said just using a mark on the turret and it’s mounting plate to manually align the turret prior to a match.

We used an initial position as well, but we did have a button the operator could press to zero if needed. (It was mostly just used for practice when they’d forget to set turret position on battery changes)

We ran a neo 550 on a VP and used the baby neo’s encoder. Our closed loop targeting was vision/limelight based anyway, so the encoder was mostly just used for rough autonomous positioning before we locked the vision on.

We used an absolute encoder so that we never had to worry about zeroing the turret. Details here: Team 5406 2022 Robot Reveal - #27 by nuclearnerd

For all of our servo motor subsystems, we rely on one of the following techniques:

  1. Gently (1-2V of power) push into a hard stop for an amount of time known to reach the hard stop and stall. This is often the highest precision method, but isn’t appropriate for all subsystems.
  2. Gently (1-2V of power) move towards a hall effect sensor and look for a rising edge event to zero. Useful for when hard stops are not present, not designed to take a stall load, or the mechanism needs to zero far from ends of travel (i.e. turret).
  3. Use sharpie marks or other visual marks to start the robot at zero. Great for when the tolerance of +/- a sharpie line width is acceptable (i.e. almost always in FRC).
  4. Same as (3), but also use a hall effect sensor to verify the zero.

My favorite method is (4), which can then notify the driver station if the robot is disabled in an off-zero state and hopefully the drive team can correct it.

Even when we rely on manual zeroing for match start, we then code up one of (1) or (2) for these subsystems for off nominal cases (robot reboot, breaker trip, belt skipped, etc.), usually initiated by a button press from our operator. But in normal circumstances, these are not used by those subsystems.


Another trick is using the falcons internal absolute encoder to increase the accuracy of most of Jared’s methods. Our ratio left us with +/-3.5 deg of absolute sensor reading which was a good amount larger than what seemed to be a +/-.5deg setup variance when using the sharpie mark method.

Our ideal system looks something like: Set up with sharpie mark, verify with hall, zero using absolute encoder, rezero using hall + absolute for mid match emergency.

1 Like

Ooooh, that’s slick.

1 Like

I just fell in love with #4 as a best practice. Thank you!

We used a US Digital Absolute encoder retrofitted to the Armabot Turret 240. This was good, but I was always nervous about it becoming unplugged, fortunately if never got flaky on us at comp but could have done serious damage to our turret wire management.

Ideally we wanted to redesign the turret gearbox for faster speed but never got around to it before Houston because it was working quite well and we still had many things we were still working on up until the day before we left. However now that it is the offseason one of our students wanted to take a shot at designing his own gearbox, after looking back at some data and designs from other teams he put together a design using a NEO, 15t 32DP pinion, 80T 32DP Gear and we just make use of the internal encoding feature of the sparkmax. This has pros and cons.

Pros - 58:1 gear ratio overall gives us a turret that is roughly 2x the speed of before, can use smart motion directly on the sparkmax and set softlimits that make it not possible for the motor to drive the turret outside of the wiring management’s useable zone. If the encoder/motor gets unplugged the motor wont work therefore can not damage the wire management. Maybe slightly better power efficiency due to the brushless motor.

Cons - If someone forgets to make sure the turret is facing at the correct starting configuration when the code starts, the turret may have an incorrect reference and could wrap too far one direction.

We might put a button to reset on the driverstation in case the turret is facing forwards but the code does not report the value we expect. In testing this has not been an issue but there is always concern. Overall happy with the results, will be sharing CAD for this soon. Will work for any teams that have this turret and the design is made to accommodate NEO, Falcon, NEO 550 (NEO 550 gearing is setup 97:1 overall, not great for accel/decel in testing but a way to save 0.6lbs)

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.