PWMin for MAE absolute encoder in C

Warning message

The Propeller Object Exchange system is decommissioned and replaced with a GitHub repository to house the same existing and future Propeller objects. As of 12/5/2019, this site is read-only. You can continue to browse and download objects from here for a limited time; however, please begin using the Parallax Propeller repository for future reference.
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Request group membership
By: created: 2015-03-29 | updated: 2015-03-29

The MAE3 is a small magnetic absolute encoder of US digital. We have been using it in various robot projects. So far is was only available in Spin. We made a C-version available derived from the standard Pulsein code in the C simple libraries.

The MAE creates a 4 kHz PWM signal with a duty cycle of 0% to 100% and 12 bit resolution. As we wamt to use this device to commutate brushless motors of control steering robot wheels, the sensor passes through the 100%->0% transition at some point. None of the standard PWM in routines in the OBEX seem to be able  to detect such transitions without errors or a very long measuring time. The introduction of the state engine in the modigied routine helps to detect 0% and 100% within a reasonable time.

If you have comments or suggestions, let us know.

Henk Kiela Opteq Mechatronics BV


Original File Upload
Package icon PWMinTest3 lib.zip4.84 KB