– Changed how the VFD code works. New features:
– Automatic retries of incorrect responses
– Possible initialization of VFD’s
– Abstract VFD class; should make it much, much easier to implement new VFD’s
– Checking of CRC16 and address; that makes it possible for multiple modbus devices to exist.
– Regular polling of state changed
– Added H2A VFD
– Moved Huanyang VFD to a VFD specialization
– Changed vcxproj generator to include the ESP32 include paths, for better intellisense support
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.
评论 (7)
#2 – atlaste 于 2020-08-14
– Fixed bug in VFDDEBUGMODE that gave the incorrect output for CRC validation failure.
– Fixed bug in RX length of set_speed in Huanyang spindle
#3 – atlaste 于 2020-08-14
– Fixed a bug in the spindle code with states. As a result, the VFD didn’t update ? state correctly.
– Updated TODO/FIXME. Some of these should eventually be implemented (but it’s really just “extra’s”)
#4 – atlaste 于 2020-08-15
Fixed a few small bugs in reporting of spindle speed. This works.
#5 – atlaste 于 2020-08-16
Updated as per review by Mitch (thanks).
#6 – Harvie 于 2020-11-26
Have you tested this? We have some issues with huanyang VFD in grblHAL:
https://github.com/terjeio/grblHAL/issues/68
When i do M3 S8000 the VFD shows 7999 RPM rather than 8000. Is this the same case with grbl_esp32 code in this PR? Perhaps you can kindly give us some insight regarding this rounding problem…
#7 – atlaste 于 2020-11-27
> Have you tested this? We have some issues with huanyang VFD in grblHAL:
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.
#1 – atlaste 于 2020-08-14
Moved some code around to ensure that the rs485 task is created after the uart setup.