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

Added "M4" for spindles #1476

Closed
wants to merge 1 commit into from

Conversation

bdmfab
Copy link

@bdmfab bdmfab commented Jul 23, 2020

First pull request so I apologize for mistakes.

I have added M4 (spindle reverse) functionality for CNC spindles. This will set an output when calling M4 for drives that use this.

Added optional config parameter spindle.reverse_dir_pin to PWM and Analog modules. Can be defined as any output capable pin and "!" inverted if necessary.

Cloned the PWMSpindleControl module into EncoderSpindleControl adding the following config parameters:

Added type - encoder
spindle.reverse_dir_pin (Optional default=nc) Pin to reverse direction of spindle
spindle.switch_on_pin (Optional default=nc ) Pin to "Enable" drive when M3 or M4 is called
spindle.default_rpm (Optional default=10% of max) Min starting rpm to overcome friction
spindle.max_rpm (default=10000) Max rpm of spindle when PWM is 100%

This is for ongoing development as I will make considerable changes to this module.

@arthurwolf
Copy link
Contributor

arthurwolf commented Jul 23, 2020

I do not know if the code is worth merging ( I just mean I haven't looked at it so I don't know if it matches the defined standard ), but I wanted to chime in to say this is a frequently requested feature, and one i need for work / was planning on implementing soon.

@wolfmanjm
Copy link
Contributor

FYI I won't be considering this for merging until it is complete and has been fully tested by existing users of the spindle module.

Thank you.

@arthurwolf
Copy link
Contributor

arthurwolf commented Jul 23, 2020 via email

@bdmfab
Copy link
Author

bdmfab commented Jul 23, 2020 via email

@bdmfab
Copy link
Author

bdmfab commented Jul 23, 2020 via email

@wolfmanjm
Copy link
Contributor

You said you will be making "considerable changes" to the module. This creates a huge amount of work for me having to check every time you check in a change, which I am not prepared to do at the moment. So once you have finsihed making the considerable changes we will then consider the final result.
As for the encoder module if it is only used by the spindle then put it under the spindle and don't add yet another module that just makes things too complex.

@arthurwolf
Copy link
Contributor

arthurwolf commented Jul 23, 2020 via email

@wolfmanjm
Copy link
Contributor

Be aware that If you modify the makefile it will almost certainly make it impossible to merge later.

@bdmfab
Copy link
Author

bdmfab commented Jul 23, 2020 via email

@wolfmanjm
Copy link
Contributor

The problem is the two will rely on each other and you cannot have two outstanding PRs that rely on each other.

Also if something is needed by the core robot code then it cannot be a module.

@wolfmanjm wolfmanjm marked this pull request as draft May 27, 2022 22:01
@wolfmanjm
Copy link
Contributor

FWIW this can also be simply done with a switch module that sets a pin on the M5 command. On my VFD for instance it would just set the pin for reverse.
As this has been dormant for 3 years now I am closing it. I will reopen if any further progress is made.

@wolfmanjm wolfmanjm closed this Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants