Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dfasd #6

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

dfasd #6

wants to merge 34 commits into from

Conversation

alexanderbenfox
Copy link

No description provided.

QuentinTorg and others added 30 commits November 27, 2015 20:31
Variables and math have been added to output steps/microsecond, but the
syntax is incorrect.  An error shows up on compile with the Encoder
library saying “Invalid use of member (varialbe_name) in static member
function” for the variables I’ve added.
Replacement of last commit
fixed link to github so that the proper repository is accessed when
arduino checks for updates.

Added the static type in front of the elapsed micros and rate variables
Updated stepRate() function for accuracy.  Now accounts for out of
phase encoder signals by always averaging the latest two readings.

Fixed compile errors

Added proper keywords so arduino recognizes functions
Negative movements now work on the opposite rate calculation of positive
movements.  When the encoder goes from 0-1 it has the same phase shift
as going from 1-0.  This means both should work on the same rate
calculation

Negative movements now calculate to negative rates
Part of changing the library name to EncoderMod
Converting library from Encoder to EncoderMod
examples now call EncoderMod.h instead of Encoder.h
the extrapolation is calculated with the velocity until a distance of 1
step offset from the actual is reached, at which point it will be the
maximum
The step rate function now uses the extrapolate function to calculate
velocity.  previously the step rate would only be updated when steps
were taken, therefore when the encoder stopped moving, it would always
return the last recorded step rate.  Now, the step rate will
deteriorate towards if steps aren’t recorded
New step rate function now uses the last recorded step rate until the
predicted position is more than one step away, then it uses a
position/time calculation to calculate a new velocity assuming the
position is 1 step away.  A position/time calculation doesn’t work when
the elapsed time is below a certain value because it introduces
inaccuracy, so the last step rate value is used
If a rate timer is double counted (during a direction change) then the
new additions will now set the unchanged timer back to 0, giving more
accurate positions
Position extrapolation is now based on an acceleration calculated using
the last two step rate measurements.  This gives a much smoother
extrapolation line.  The stepRate() function now extrapolates based on
the amount of time since last step rate calculation, and the previous
acceleration.
I only modified one line in EncoderMod.h to get it to compile. I
renamed a couple instances of the word "Encoder" to the word
"EncoderMod" so that the library shows up as EncoderMod in the
Arduino IDE.
Fix a compilation error, rename the library to EncoderMod
I added a lot of comments about how and why things work.  Its not fully
commented yet, but the missing comments are mostly repeats of the first
ones.
…ition

Acceleration extrapolated position
could be. However the interrupt is extremely tight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants