Huanyang FC01 modbus

More
11 months 1 week ago - 11 months 1 week ago #339219 by Lpkkk
Replied by Lpkkk on topic Huanyang FC01 modbus
How use MB2HAL with Huanyang FC01 :
1) Install userspace component if you don't have it:sudo apt install linuxcnc-uspace linuxcnc-uspace-dev 
2) create fc01_vfd.ini
Code:
[MB2HAL]  # === Serial Port Settings === TYPE=rtu DEVICE=/dev/ttyUSB0 BAUD=9600 PARITY=E STOPBITS=1 DATABITS=8 SLAVE=1  POLL_RATE=100 ; ms  #========================================================= # WRITE REGISTERS # =========================================================  # HAL pin: hy.fc01.control → Modbus register 0x2000 # Example values: # 0x0001 = Forward Run # 0x0002 = Reverse Run # 0x0005 = Stop # 0x0006 = E-Stop # 0x0007 = Reset Fault  [WR_REG_1] MBREG=0x2000 HALPIN=hy.fc01.control TYPE=u16  # HAL pin: hy.fc01.freq_set → FC01 expects freq ×100 # Write float in Hz, MB2HAL will convert via SCALE [WR_REG_2] MBREG=0x2001 HALPIN=hy.fc01.freq_set TYPE=float SCALE=100 ; multiply when writing  # ========================================================= # READ REGISTERS # =========================================================  # Output frequency (×100) [RD_REG_1] MBREG=0x3001 HALPIN=hy.fc01.freq TYPE=float SCALE=0.01 ; divide when reading  # Bus Voltage [RD_REG_2] MBREG=0x3002 HALPIN=hy.fc01.busvolt TYPE=float  # Output Voltage [RD_REG_3] MBREG=0x3003 HALPIN=hy.fc01.outvolt TYPE=float  # Current [RD_REG_4] MBREG=0x3004 HALPIN=hy.fc01.current TYPE=float  # Speed (RPM) [RD_REG_5] MBREG=0x3005 HALPIN=hy.fc01.speed TYPE=float  # ========================================================= # ERROR HANDLING # =========================================================  # Create a HAL bit pin that becomes TRUE if MB2HAL detects a Modbus exception [ERROR_BIT] HALPIN=hy.fc01.fault
3) create vfd.hal
Code:
loadusr -W mb2hal fc01_vfd.ini net spindle-enable => hy.fc01.control loadrt mux2 count=1 addf mux2.0 servo-thread  # select direction code setp mux2.0.in0 1 # forward setp mux2.0.in1 2 # reverse net spindle-reverse mux2.0.sel net spindle-code mux2.0.out => hy.fc01.control net spindle-speed-cmd => hy.fc01.freq_set
​​​​​​​4) add vfd.hal to your machine ini file
 
Last edit: 11 months 1 week ago by Lpkkk. Reason: Codes updated

Please Log in or Create an account to join the conversation.

More
11 months 4 days ago - 11 months 4 days ago #339391 by Lpkkk
Replied by Lpkkk on topic Huanyang FC01 modbus
Mb2hal version didn't work great. I'm working on python hal component currently.
Meanwhile I made python app to drive FC01 inverter.
Available : github.com/dangervoid12/VFD-FC01-Monitor/tree/main
Last edit: 11 months 4 days ago by Lpkkk.

Please Log in or Create an account to join the conversation.

More
9 months 1 week ago #341739 by bruce_d
Replied by bruce_d on topic Huanyang FC01 modbus
Greetings,

I too have a fc01 and have just started to try rs485. I have had no luck using the python code supplied from the manufacturer. One inconsistency that i noticed in their code as well as the code in this thread is:

The parameter is set P14.02 = 0 , from the manual p64 this is "0: No check (N,8,1)for RTU" but in the code above parity is specified as E.

Sorry if I have missed something. Thanks bruce

I will to get your python working on my pi5 or my desktop.

Please Log in or Create an account to join the conversation.

Time to create page: 0.266 seconds
Powered by Kunena Forum