testing math
This commit is contained in:
parent
a909abbdd1
commit
aa2e898c0b
@ -48,12 +48,14 @@ We can see that in the first movement (positive rotation), the green is out of p
|
|||||||
1. Get the absolute angle within a period
|
1. Get the absolute angle within a period
|
||||||
|
|
||||||
Since the 2 signals correspond to a cos and sin signals, it is possible to compute the angle inside the period using arctan2 function. However, we have more than one period, it is so necessary to increment a position.
|
Since the 2 signals correspond to a cos and sin signals, it is possible to compute the angle inside the period using arctan2 function. However, we have more than one period, it is so necessary to increment a position.
|
||||||
|
|
||||||
$$\theta= atan2(a,b)$$
|
$$\theta= atan2(a,b)$$
|
||||||
|
|
||||||
2. Incremental position
|
2. Incremental position
|
||||||
|
|
||||||
To increment the position, it is necessary to start from 0 at a known postion. For that the motor is moved in open loop to one end and the position is set to 0.
|
To increment the position, it is necessary to start from 0 at a known postion. For that the motor is moved in open loop to one end and the position is set to 0.
|
||||||
Then we need to sum all the delta of movement at each measure sample.
|
Then we need to sum all the delta of movement at each measure sample.
|
||||||
|
|
||||||
$$\phi_t=\phi_{t-1} + (\theta_t - \theta_{t-1})mod(-\pi;\pi)$$
|
$$\phi_t=\phi_{t-1} + (\theta_t - \theta_{t-1})mod(-\pi;\pi)$$
|
||||||
|
|
||||||
## Coding the solution
|
## Coding the solution
|
||||||
|
Loading…
Reference in New Issue
Block a user