-
Notifications
You must be signed in to change notification settings - Fork 245
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
alexanderbenfox
wants to merge
34
commits into
PaulStoffregen:master
Choose a base branch
from
QuentinTorg:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
dfasd #6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Fix compilation errors
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
Velocity extrapolated position
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.
# Conflicts: # EncoderMod.h
…ition Acceleration extrapolated position
could be. However the interrupt is extremely tight
Velocity optimized
Delete unneeded variable.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.