Slew drive position sensor

Dec 20, 2024

The slew drive for the 10GHz offset dish arrived at the start of December and over the last few days I’ve been testing it on the bench with the KN3G controller I started working on in October.

The slew drive has two-channel Hall effect encoders built into each motor housing, one for azimuth positioning and one for elevation. Each sensor generates 2 pulses per revolution (ppr) on 2 channels but the KN3G controller just needs to use one channel. The motor reducer gear ratio is 575:1 and the slew drive gear ratio is 62:1 so there should be 575 x 62 x 2 ppr = 71300 pulses for a full 360 degree rotation of the slew drive. This is equivalent to 71300 / 360 = 198 pulses per degree, or 360 / 71300 = 0.00505 degrees per pulse.

I configured the pulse input settings in the KN3G software to start testing and soon found out that the pulse count indicated by the DEBUG_POSITION_PULSE_INPUT option was way too high. Several radio amateurs have commented that using incremental encoders to count pulses is unreliable, especially when you want to point a dish accurately, and have changed to using absolute encoders. Others have found that the slew drive pulse generators work for azimuth but not for elevation, or vice versa.

To investigate the source of the problem I used an oscilloscope and wrote some simple Arduino sketches to count pulses. The oscilloscope showed a pulse frequency of around 72Hz, but the Arduino pulse counter was more than double. This was probably caused by noise on the pulse input line generating extra interrupts so I added a RC filter (1k, 22nF) and external pullup but it didn’t make a lot of difference. I then added some debounce logic to the simple pulse counter and by using a debounce period of 10-12ms the Arduino matched the oscilloscope.

The KN3G software has a OPTION_EL_PULSE_DEBOUNCE option and with this on and EL_POSITION_PULSE_DEBOUNCE set to 10ms the slew drive elevation worked fine. There’s no equivalent code for azimuth so I hacked one out quickly and that also worked, but the pulses per degree was slightly different.

For the next test I added a SN74HC14 Schmitt trigger to clean up the pulse input line to the Arduino. Now the simple pulse counting sketch, without the debounce logic, matches the expected output and the Arduino interrupt service routine fires correctly. Going back to the KN3G sofware I removed the debounce options for elevation and azimuth and now the controller works as expected. As noted above there is a slight difference in the pulse per degree between azimuth and elevation but this may be to do with the limitations I have for accurately measuring azimuth angles on my bench setup. I’ll have a much better idea when I start testing outdoors and track the sun or moon.

#define AZ_POSITION_PULSE_DEG_PER_PULSE 0.00598
#define EL_POSITION_PULSE_DEG_PER_PULSE 0.00505

Finally, a RPM calculation shows that the slew drive without any load is rotating at 0.058 RPM, close to the 0.048 RPM specification.

KN3G Controller schematic

KN3G Controller schematic