Skip to content

Commit 8b61231

Browse files
authored
Merge pull request #28 from zbas/patch-3
Update magnetic_sensor_pwm.md
2 parents 09ff14b + 2874178 commit 8b61231

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

docs/simplefoc_library/code/sensors/magnetic/magnetic_sensor_pwm.md

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ There are two ways to use magnetic sensor implemented within this library:
126126

127127
### Position sensor for FOC algorithm
128128

129-
To use the ensor with the FOC algorithm implemented in this library, once when you have initialized `sensor.init()` (and possibly started the interrupts) you just need to link it to the motor by executing:
129+
To use the sensor with the FOC algorithm implemented in this library, once when you have initialized `sensor.init()` (and possibly started the interrupts) you just need to link it to the motor by executing:
130130
```cpp
131131
motor.linkSensor(&sensor);
132132
```
@@ -146,37 +146,14 @@ class MagneticSensorPWM{
146146
147147
<blockquote markdown="1" class="info">
148148
<p class="heading" markdown="1">Calling `getVelocity` multiple times</p>
149-
When calling `getVelocity` it will only calculate the velocity if the elapsed time from the previous call is longer than the time specified in teh variable `min_elapsed_time` (default 100us). If the elapsed time from the last call is shorter than `min_elapsed_time` the function will return previously calculated value. Variable `min_elapsed_time` can be changed easily if necessary:
149+
When calling `getVelocity` it will only calculate the velocity if the elapsed time from the previous call is longer than the time specified in the variable `min_elapsed_time` (default 100us). If the elapsed time from the last call is shorter than `min_elapsed_time` the function will return previously calculated value. Variable `min_elapsed_time` can be changed easily if necessary:
150150
151151
```cpp
152152
sensor.min_elapsed_time = 0.0001; // 100us by default
153153
```
154154
</blockquote>
155155

156156

157-
158-
<blockquote markdown="1" class="info">
159-
<p class="heading" markdown="1">Calling `getVelocity` multiple times</p>
160-
When calling `getVelocity` it will only calculate the velocity if the elapsed time from the previous call is longer than the time specified in teh variable `min_elapsed_time` (default 100us). If the elapsed time from the last call is shorter than `min_elapsed_time` the function will return previously calculated value. Variable `min_elapsed_time` can be changed easily if necessary:
161-
162-
```cpp
163-
sensor.min_elapsed_time = 0.0001; // 100us by default
164-
```
165-
</blockquote>
166-
167-
168-
169-
<blockquote markdown="1" class="info">
170-
<p class="heading" markdown="1">Calling `getVelocity` multiple times</p>
171-
When calling `getVelocity` it will only calculate the velocity if the elapsed time from the previous call is longer than the time specified in teh variable `min_elapsed_time` (default 100us). If the elapsed time from the last call is shorter than `min_elapsed_time` the function will return previously calculated value. Variable `min_elapsed_time` can be changed easily if necessary:
172-
173-
```cpp
174-
sensor.min_elapsed_time = 0.0001; // 100us by default
175-
```
176-
</blockquote>
177-
178-
179-
180157
Here is a quick example for AS5048A magnetic sensor using its PWM output:
181158
```cpp
182159
#include <SimpleFOC.h>
@@ -210,4 +187,4 @@ void loop() {
210187
Serial.print("\t");
211188
Serial.println(sensor.getVelocity());
212189
}
213-
```
190+
```

0 commit comments

Comments
 (0)