[ Vfdmod ] An easy VFD control over MODBUS RTU

More
11 Mar 2022 14:42 #236939 by tommylight
Bus voltage = 5830.0 V ??? :)

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

More
07 Dec 2022 07:07 - 07 Dec 2022 07:15 #258790 by akg1904
Hi aekhv,

I am using Delta MS 300 VFD and tried to follow your guide but I was not able to establish connection with my VFD.
I have attached my INI and manual. It would very helpful if you could help me regarding the same.

 

File Attachment:

File Name: my-config-file2.ini
File Size:1 KB
 

This browser does not support PDFs. Please download the PDF to view it: Download PDF

 

This browser does not support PDFs. Please download the PDF to view it: Download PDF

 

This browser does not support PDFs. Please download the PDF to view it: Download PDF

Attachments:
Last edit: 07 Dec 2022 07:15 by akg1904. Reason: To attach files

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

More
07 Dec 2022 17:08 - 07 Dec 2022 17:11 #258818 by RobC
I would suggest first making sure you are communicating with the drive with all the correct modbus settings. You can verify with vfdmod's pyvcp panel or through HAL Config in Axis. Once you know you are connected then you can start adjusting settings for different drive operations.

There appears to be a driver for Delta VFDs written a while back and it looks like the commands / registers are the same as what you show. The excerpt below is from -- github.com/LinuxCNC/linuxcnc/blob/master.../vfdb_vfd/vfdb_vfd.c

// command registers for DELTA VFD-B Inverter
#define REG_COMMAND1 0x2000 // "Communication command" - start/stop, fwd/reverse, DC break, fault reset, panel override
#define REG_FREQUENCY 0x2001 // Set frequency in 0.01Hz steps
#define REG_UPPERLIMIT 0x0100 // limit on output frequency in VFD 

// command bits
#define CMD_FAULT_RESET 0x2000
#define CMD_EMERGENCY_STOP 0x1000
#define CMD_RUN 0x0002
#define CMD_STOP 0x0001
#define CMD_REVERSE 0x0020
#define CMD_FORWARD 0x0010
#define CMD_JOG_RUN 0x0003 

// status registers for DELTA VFD-B Inverter
#define SR_ERROR_CODE 0x2100 //
#define SR_INV_OPSTATUS 0x2101 //
#define SR_OUTPUT_FREQ 0x2103 // 0.01Hz units
#define ST_EMERGENCY_STOPPED 0x0021 // EF1/ESTOP 
#define SR_MOTOR_SPEED 0x210C // RPM
#define SR_TORQUE_RATIO 0x210B // %
#define SR_OUTPUT_CURRENT 0x2104 // output curr
#define SR_OUTPUT_VOLTAGE 0x2106 // %
#define SR_INVERTER_MODEL 0x0000
#define SR_RATED_CURRENT 0x0001 // 0.1A
#define SR_RATED_VOLTAGE 0x0102 // 0.1V
#define SR_EEPROM_VERSION 0x0006
 
Last edit: 07 Dec 2022 17:11 by RobC. Reason: formatting

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

More
09 Dec 2022 09:49 #258981 by akg1904
Hi,
Thanks for the reply,

I have already communicated with the drive with all the correct modbus settings in windows usind MODPOLL and it was working fine.
As I am new to LinuxCNC, I followed the guide posted by AEKHV but I was not able to debug where I have made mistake.

I will attach my HAL and INI file here.

File Attachment:

File Name: spindle.hal
File Size:1 KB

File Attachment:

File Name: my-config-...2-09.ini
File Size:1 KB
Attachments:

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

More
09 Dec 2022 17:47 - 09 Dec 2022 17:48 #259021 by RobC
I am attaching all the files that I used to get vfdmod working correctly with my vfd / spindle. I have a different vfd and specs but you should be able to see what I have changed / added to each of these files to get it all working.

I don't remember exactly which file it is, but in my default linuxcnc install there is a generic spindle-at-speed = 1 setting in one of the files (maybe custom.hal or one of the postgui files). You will have to comment that out or delete it to get proper spindle at speed feedback.

File Attachment:

File Name: 4848router...2-09.ini
File Size:3 KB

File Attachment:

File Name: postgui_ca...2-09.hal
File Size:0 KB

File Attachment:

File Name: custom_2022-12-09.hal
File Size:1 KB

File Attachment:

File Name: vfd_2022-12-09.hal
File Size:1 KB

File Attachment:

File Name: vfd.test_2...2-09.ini
File Size:6 KB

File Attachment:

File Name: vfd.test_2...2-09.xml
File Size:2 KB

File Attachment:

File Name: 4848router...2-09.hal
File Size:4 KB
Attachments:
Last edit: 09 Dec 2022 17:48 by RobC. Reason: files
The following user(s) said Thank You: akg1904

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

More
14 Dec 2022 15:13 #259467 by akg1904
Thanks RobC :) your files helped a tonne, I finally managed to get the spindle up and running but its just not rotating at full RPM.

So the max RPM of the spindle is some 24000 RPM and the max command frequency is 599Hz.

I've attached my VFD config file here.

 

File Attachment:

File Name: vfd-config.ini
File Size:2 KB


When I connected the VFD via usb and read the frequency passed to the VFD when I try to rotate the spindle at full RPM it is only 5.99 HZ instead of 599Hz...

I thought that maybe it had something to do with improper "SpindleRpmIn" configuration so i researched a bit and found this post:


Following the comment I set the multiplier and divider accordingly.

[SpindleRpmIn]
FunctionCode=0x06
Address=0x2001
Multiplier=599 #max frequency
Divider=24000 #max spindle RPM

but its just not working.....

I am breaking my head over here, just dont know what im doing wrong.
Attachments:

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

More
14 Dec 2022 16:33 #259473 by RobC
My vfd / spindle run at 400hz, 24000 rpm max so I use 1 & 6 for the multiiplier / divider. vfdmod sends 80.0hz as 800, 300.0hz as 3000 where the display on the vfd just shows 80.0, 300.0, and so on. I believe your multiplier / divider should probably be 1 & 4, then 4 & 1. They can be tweaked from there if it's off by a factor of 10 or whatever. It seems like you're getting the right number, just with the decimal in the wrong place.

[SpindleRpmIn]
# An address of the command speed (or frequency) register.
Address=0x0201
Multiplier=1
Divider=6

[SpindleRpmOut]
# An address of the output speed (or frequency) register.
Address=0x0220
Multiplier=6
Divider=1
The following user(s) said Thank You: akg1904

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

More
07 Feb 2023 23:05 #263989 by SkyMoCo
Has anyone gotten this to work with a Inexpensive Vevor H100 series VFD?     Vevor H100 VFD

I started to slog through it, but since this a simple and pretty inexpensive unit I am hoping I am not the first.  The manual was only slightly bigger than a postage stamp so I scanned the modbus sections and attached them here in a readable format.  I've worked with other modbus devices so I am not entirely new.  I have a modbus adapter and have it talking to the unit at least.

Happy to share once I have it working.
 
Attachments:

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

More
08 Feb 2023 15:48 #264060 by RobC
All of the files / settings I have posted in the previous posts are for an H100 VFD (also known as V70 from other vendors), so they should all work as a reference (file names may be different). The PDF version of the manual is too large to attach to the forum, but here is a link to the stepperonline V70 manual. www.omc-stepperonline.com/download/VFD%20manual%20datasheet.pdf

The vfd settings that are related to control via rs-485 dongle are:
F001=2
F002=2
F163=1
F164=3
F165=3
F169=0

Then the settings needed for vfdmod ini are:
[RS485]
# VFD slave address.
SlaveAddress=1
# Serial device system path.
SerialDevice=/dev/ttyUSB0
# Communication speed.
BaudRate=38400
# Data bits: always 8.
DataBits=8
# Parity: 'N' for none (default), 'E' for even, 'O' for odd.
Parity=N
# Stop bits: 1 (default) or 2.
StopBits=1
# Loop delay in milliseconds, default value is 200 ms.
# Range: 0 ... 10000.
LoopDelay=200
# Delay in characters at front of every MODBUS request.
# MODBUS specification recommends at least 3.5 characters,
# so default value must be 4. 
# Increase this value if communication errors happen.
# Range: 0 ... 100.
ProtocolDelay=4
# A minimum count of successfull requests to set HAL 'is-connected' output
# to TRUE. Default value is 10. Range: 1 ... 100.
IsConnectedDelay=10
# Comma separated critical errors that call reconnection event.
# For example: error code 5 occures when SerialDevice has been
# physically disconnected.
ConnectionErrorList=5
# Delay in milliseconds between reconnection attempts, this parameter
# is active when ConnectionErrorList is not empty. Default value is 1000 ms.
# Range: 0 ... 10000.
ConnectionDelay=1000
[Control]
# Function code:
# 0x06 - write single register (default).
# 0x10 - write multiple registers.
# 0x05 - write single coil.
# 0x0F - write multiple coils.
;FunctionCode=0x06
# **********************************************************
# Values below are active when FunctionCode is 0x06 or 0x10.
# **********************************************************
# An address of the control register.
Address=0x0200
# A value to run spindle forward.
RunForwardValue=0x0001
# A value to run spindle reverse.
RunReverseValue=0x0002
# A value to reset a fault state.
# If this parameter is commented then fault reset feature will be disabled.
;FaultResetValue=0x?????
# A value to stop spindle.
StopValue=0x0000
# **********************************************************
# Values below are active when FunctionCode is 0x05 or 0x0F.
# **********************************************************
# An address of the coil that turns spindle on.
;RunCoil=0x????
# An address of the coil that sets spindle direction.
;DirectionCoil=0x????
# An address of the coil that resets a fault state.
# If this parameter is commented then fault reset feature will be disabled.
;FaultResetCoil=0x????
[SpindleRpmIn]
# Function code:
# 0x06 - write single register (default).
# 0x10 - write multiple registers.
;FunctionCode=0x06
# An address of the command speed (or frequency) register.
Address=0x0201
# Multiplier and Divider are integer values to correct command speed value
# before it will be written to command speed register.
# Corrected command speed = (command speed) x Multiplier / Divider.
# Use both (Multiplier & Divider) to reach float coefficient.
Multiplier=1
Divider=6
[SpindleRpmOut]
# An address of the output speed (or frequency) register.
Address=0x0220
# Multiplier and Divider are integer values to correct output speed value
# after it has been read from output speed register.
# Corrected output speed = (output speed) x Multiplier / Divider.
# Use both (Multiplier & Divider) to reach float coefficient.
Multiplier=6
Divider=1

There are more settings that you can change / tweak, but this should be all you need to get your VFD working with linuxcnc.

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

More
09 Feb 2023 04:06 #264097 by SkyMoCo
Perfect, thanks very very much.   I tired searching for H100 and didn't find anything that matched on the forum.    I think I get how you gleaned some of this from the manual.   For example, the Address for the spindle rpm out  (0x0220).  From the manual, that appears to be mapped to the input registers 0000H (pg71) which is the Output frequency.   Could you not use function 04 and read it from there as well?    Excuse any newbie ignorance when it comes to modbus.   I just know enough to be dangerous.

Kevin

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

Time to create page: 0.406 seconds
Powered by Kunena Forum