From 2874178ca8ffc6024cc2c54fdee2125754165aba Mon Sep 17 00:00:00 2001 From: zbas Date: Mon, 17 Jun 2024 11:04:40 +0100 Subject: [PATCH] Update magnetic_sensor_pwm.md Removing typos and duplicated content. --- .../sensors/magnetic/magnetic_sensor_pwm.md | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/docs/simplefoc_library/code/sensors/magnetic/magnetic_sensor_pwm.md b/docs/simplefoc_library/code/sensors/magnetic/magnetic_sensor_pwm.md index c5fd420..6efae58 100644 --- a/docs/simplefoc_library/code/sensors/magnetic/magnetic_sensor_pwm.md +++ b/docs/simplefoc_library/code/sensors/magnetic/magnetic_sensor_pwm.md @@ -126,7 +126,7 @@ There are two ways to use magnetic sensor implemented within this library: ### Position sensor for FOC algorithm -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: +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: ```cpp motor.linkSensor(&sensor); ``` @@ -146,7 +146,7 @@ class MagneticSensorPWM{

Calling `getVelocity` multiple times

-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: +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: ```cpp sensor.min_elapsed_time = 0.0001; // 100us by default @@ -154,29 +154,6 @@ sensor.min_elapsed_time = 0.0001; // 100us by default
- -
-

Calling `getVelocity` multiple times

-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: - -```cpp -sensor.min_elapsed_time = 0.0001; // 100us by default -``` -
- - - -
-

Calling `getVelocity` multiple times

-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: - -```cpp -sensor.min_elapsed_time = 0.0001; // 100us by default -``` -
- - - Here is a quick example for AS5048A magnetic sensor using its PWM output: ```cpp #include @@ -210,4 +187,4 @@ void loop() { Serial.print("\t"); Serial.println(sensor.getVelocity()); } -``` \ No newline at end of file +```