-
Notifications
You must be signed in to change notification settings - Fork 42
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
HY Spindle + ESP32 + RS485 converter: RS485_DIR_ENABLE #3
Comments
No, it should not be so since your board has auto direction sensing. The timeout is due to the VFD not responding to a request in time. Does it get it? Wiring is ok? Baud rate ok? VFD setup ok? Have I somehow messed up the code? Which board are you compiling for? |
This code is ok as there is a outer #ifdef around it. It is set to 1 if RS485_DIR_OUT is defined and SPINDLE_HUANYANG is > 0, if not it is set to 0 as enabling the dir output does not make sense otherwise. I have tested the code with my spindle simulator and it works as it should. Note that there are two incompatible variants of the Huanyang spindle protocol, CMakeLists.txt is set up for v1:
|
You are absolutely right. I missed the outer #ifdef RS485_DIR_ENABLE. I will double-check connection and settings. Is there any helpful debugging I can enable? |
Not out of the box. I added these lines at line 168 in modbus.c to see if any response came back before the timeout:
Since transmission is half duplex it is not possible to test with loopback (shorting TX and RX pins). |
Actually, this is what I did to get rid of the alarm: shorting TX and RX on the ESP side, with only RX connected to the RS485 converter. I can now at least switch on/off the spindle (using bCNC), setting rpm does not yet work (despite PD002 set to 2), spindle runs full speed only. So the VFD is receiving commands, but does not talk back. But this looks like a hardware or settings issue. Comm Params (PD163=1 164=1 165=3 with $374=2) seem to be ok. Thanks a lot! |
Yes, on every real-time report request the RPM register is read in
|
I'm stuck setting up my machine because I always get a spindle speed timeout alarm with this setup. I have a 3.3V capable TTL<->RS485 converter that only has TX/RX pins, no direction pin.
I found in driver.h:
#if SPINDLE_HUANYANG
#define RS485_DIR_ENABLE 1
which means that regardless of my setting in CMakeLists.txt
OPTION(RS485_DIR_OUT "Compile with RS485 direction pin enabled" OFF)
it's always set to ON (=have direction pin), correct?
I assume the timeout error is because of the direction pin missing?
Thanks!
The text was updated successfully, but these errors were encountered: