-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Changed workings of VFD code, added H2A VFD #544
Conversation
Fixed includes in vcxproj generator
…t within GRBL (`init()`).
Removed it from the test machine config
…ning the rs485 task.
Moved some code around to ensure that the rs485 task is created after the uart setup. |
…ed command for Huanyang VFD.
|
…state correctly. Updated TODO/FIXME
|
…poses. Fixed report compatibility with vanilla grbl. Some values were reported in a slightly different format.
Fixed a few small bugs in reporting of spindle speed. This works. |
Updated as per review by Mitch (thanks). |
* Renamed Huanyang to VFD for H2A work * Fixed Huanyang spindle implementation again. Fixed includes in vcxproj generator * Changed the VFD implementation. Implemented H2A along the way. UNTESTED! * Fixed retry loop in VFD. Added SettingsDefinition. Fixed name conflict within GRBL (`init()`). * Added VFD_DEBUG_MODE. * Fixed usability of VFD_DEBUG_MODE. Added a TODO in the H2ASpindle code. Removed it from the test machine config * Fixed bug in VFD spindle: the uart should be set up first, before running the rs485 task. * Fixed bug in VFD_DEBUG_MODE output. Fixed bug in RX length of set_speed command for Huanyang VFD. * Fixed a bug in the spindle code with states. Also, VFD didn't update state correctly. Updated TODO/FIXME * Added some more functionality to the Null spindle, to aid testing purposes. Fixed report compatibility with vanilla grbl. Some values were reported in a slightly different format. * Fixed commands.h * Fixed review by Mitch Co-authored-by: Stefan de Bruijn <stefan@nubilosoft.com>
Have you tested this? We have some issues with huanyang VFD in grblHAL: When i do |
Yes, I've done extensive testing on my H2A (Huanyang 2A) VFD after and while implementing it and bart has done extensive testing on a normal Huanyang VFD. Very noteworthy is that H2A reports the real RPM value, while Huanyang reports the register value (and not the real RPM value!). The reason it shows 7999 RPM probably has to do with the conversion from frequency to RPM. You have to realize that a VFD works internally with a frequency, so even if you query the RPM value, it will translate the frequency to RPM. For Huanyang, modbus works with the frequencies (integer values), for H2A modbus actually works with RPM values (also integer values). In other words, there will be a difference in what you request and what you get, even if it's running at full speed. Regardless, one of the registers gives you the spindle frequency value. So using that, you can determine the rounding error. F.ex. if you have 400Hz (common), and a 24k RPM spindle, the error will be +/- 1 Hz, or: +/- 60 RPM. While query'ing the H2A spindle during the first testing, I've actually seen differences of up to 2 Hz. Some details are described in the H2A MD file that's in the Spindle folder in the repo. |
NOTE: I added my machine config, to have a working config with an H2A. We should eventually get rid of this.
NOTE: This PR includes the previously fixed
grbl_init()
call.