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

Code for AS5600 #9

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

Code for AS5600 #9

wants to merge 6 commits into from

Conversation

sanchosk
Copy link
Contributor

I had to slightly adjust the code for AS5600.
It's still dirty (e.g. no protection, the overturn is VERY rough, ...) but it works already and could be a good starting point for others.
For now I removed the step/dir code as I am still testing it.
I'm not looking to merge it with your codebase, I'm more interested in your comments to be honest ;)

@sanchosk
Copy link
Contributor Author

Well, I finalized my fixes for the code of ATtiny85. It works great now on all 3 axes. And is tested with TB6612 and A4953, works OK with both.
I added the minSearch code. What this does is it searches for the minimum position therefore eliminating the need of min switch. I tested it on all 3 axes, works OK. I added a "safety zone" - as the minPoint is found, the code sets it as -75 - to avoid push to the axis wall or end whenever there is Gcode pointing to 0 value on the axis. On my printer this means the real 0 position will be ~2mm from the actual minimum, which works OK for me.
Another add-on is the introduction of stepKoef - as my Z axis has VERY high resolution, it was painful for both RAMPS and the Tiny to process so many steps - so I divided the steps in RAMPS config and introduced the multiplier here.
I used your hint for DIRECT/REVERSE pid calculation to avoid unnecessary calculations.
So now everything works:

  • determining the motor direction and compensating for it
  • finding minimum movement speed
  • using the minimum speed to find the minimum value of the axis

All the variables now use LONG instead of INT, so no more problems with overflow :)
Hope at least parts of this code will help you.

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.

1 participant