Skip to content

Commit c50f2f7

Browse files
committed
finish readme
1 parent c0b5372 commit c50f2f7

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
# Using the AS5145B magnetic encoder to get the absolute position of a shaft via PWM filtered thorough a low-pass filter taken as Analog input with the WPILIB
1+
### Using the AS5145B magnetic encoder to get the absolute position of a shaft via PWM filtered thorough a low-pass filter taken as Analog input with the WPILIB
22

33
(may be useful for other magnetic encoders)
44

5-
The determined angle is persistent through powering on and off the encoder
5+
The determined angle is persistent through powering on and off the encoder. The pwm output outputs a square wave porportional to the degree of angle of the shaft. The low pass filter is so one can use the pwm output as analog output, where the voltage is porportional to the angle of the shaft. Note, this will introduce some noise; I've been getting around plus or minus 3 degrees of inaccuracy due to noise.
66

77
See the [datasheet](http://www.ams.com/eng/content/download/50206/533867/34237)([source](http://www.ams.com/eng/Products/Magnetic-Position-Sensors/Magnetic-Rotary-Position-Sensors/AS5145B)) for additional guidance(creating a low-pass filter):
8+
9+
### Requirements
10+
11+
* CRIO & Sidecar
12+
* SmartDashboard
13+
* Wiring
14+
* A calibrated magnet mounted on a shaft and aligned to an encoder
15+
16+
The shaft needs to move less than 1 full revolution during its movement.
17+
The maximum voltage(what I labeled as HEURISTIC_VOLTAGE can be determined by trying to adjust your magnet to near 360 degrees. This will be around 5v. Make sure the ground and the power source are form the same place(Analog breakout)
818

919

1020
### Wiring

0 commit comments

Comments
 (0)