hi all, I am having an issue trying to use a folinn (fuling) BD600 VFD via RS485 with vfdmod, I copied the configuration given in this
thread
and it helped me to get it going to run the spindle CW, CCW and stopping, but I am having an issue with the set RPM, the spindle I am using is 800Hz 24000 RPM, everytime I execute Linuxcnc, the speed defaults to the maximum 800hz and it can not be modulated using the +- buttons (the bar moves but the speed is the same) and when I send a command like M03 S1000 or S10 the spindle will go to the maximum velocity and the VFD also to 800hz, lastly the feedback_bar and at_speed_led are not working not sure why, I am using 2.8.0 version on a raspberry pi 4.
vfd.hal
Code:
loadusr -W vfdmod BD600.ini --debug
net spindle-vel-cmd-rpm => vfdmod.spindle.rpm-in
net spindle-at-speed <= vfdmod.spindle.at-speed
net spindle-cw => vfdmod.control.run-forward
net spindle-ccw => vfdmod.control.run-reverse
BD600.ini
Code:
[Common]
MaxSpeedRPM=24000
MinSpeedRPM=100
AtSpeedThreshold=0.05
[RS485]
SlaveAddress=1
SerialDevice=/dev/ttyUSB0
BaudRate=9600
LoopDelay=500
ProtocolDelay=6
IsConnectedDelay=10
ConnectionErrorList=110
ConnectionDelay=500
[Control]
Address=0x1000
RunForwardValue=0x0001
RunReverseValue=0x0002
FaultResetValue=0x0007
StopValue=0x0006
[SpindleRpmIn]
FunctionCode=0x06
Address=0x3000
Multiplier=100
Divider=1
[SpindleRpmOut]
Address=0x3001
Multiplier=1
Divider=100
[freq-running]
FunctionCode=0x03
Address=0x3001
PinType=float
PinName=freq-running
Divider=1
[bus-voltage]
FunctionCode=0x03
Address=0x3002
PinType=float
PinName=bus-voltage
[output-voltage]
FunctionCode=0x03
Address=0x3003
PinType=float
PinName=output-voltage
[output-current]
FunctionCode=0x03
Address=0x3004
PinType=float
PinName=output-current
Divider=100
[output-torque]
FunctionCode=0x03
Address=0x3006
PinType=float
PinName=output-torque
[run-speed]
FunctionCode=0x03
Address=0x3007
PinType=float
PinName=run-speed
[spindle-load-speed]
FunctionCode=0x03
Address=0x300F
PinType=float
PinName=spindle-load-speed
[power-on-time]
FunctionCode=0x03
Address=0x301A
PinType=float
PinName=power-on-time
[spindle-run-time]
FunctionCode=0x03
Address=0x301B
PinType=float
PinName=spindle-run-time
[fault-code]
FunctionCode=0x03
Address=0x8000
PinType=float
PinName=fault-code
CNC.ini
Code:
[EMC]
MACHINE = CNC
DEBUG = 0
VERSION = 1.1
[DISPLAY]
DISPLAY = gmoccapy
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.000000
MAX_SPINDLE_OVERRIDE = 1.000000
MIN_SPINDLE_OVERRIDE = 0.100000
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/pi/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 6.000000
MAX_LINEAR_VELOCITY = 25.000000
MIN_LINEAR_VELOCITY = 0.500000
DEFAULT_ANGULAR_VELOCITY = 12.000000
MAX_ANGULAR_VELOCITY = 180.000000
MIN_ANGULAR_VELOCITY = 1.666667
EDITOR = gedit
GEOMETRY = xyz
[HAL]
HALUI = halui
HALFILE = CNC.hal
HALFILE = vfd.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
POSTGUI_HALFILE = postgui_call_list.hal
SHUTDOWN = shutdown.hal
[SPINDLE_0]
P = 0
I = 0
D = 0
FF0 = 1
FF1 = 0
FF2 = 0
BIAS = 0
DEADBAND = 0
MAX_OUTPUT = 2000
CNC.hal
Code:
setp pid.s.Pgain [SPINDLE_0]P
setp pid.s.Igain [SPINDLE_0]I
setp pid.s.Dgain [SPINDLE_0]D
setp pid.s.bias [SPINDLE_0]BIAS
setp pid.s.FF0 [SPINDLE_0]FF0
setp pid.s.FF1 [SPINDLE_0]FF1
setp pid.s.FF2 [SPINDLE_0]FF2
setp pid.s.deadband [SPINDLE_0]DEADBAND
setp pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp pid.s.error-previous-target true
net spindle-index-enable <=> pid.s.index-enable
net spindle-enable => pid.s.enable
net spindle-vel-cmd-rpm => pid.s.command
net spindle-vel-fb-rpm => pid.s.feedback
net spindle-output <= pid.s.output
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-enable <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
net spindle-index-enable <=> spindle.0.index-enable
# ---Setup spindle at speed signals---
sets spindle-at-speed true
#******************************
# connect miscellaneous signals
#******************************
# ---HALUI signals---
net axis-select-x halui.axis.x.select
net jog-x-pos halui.axis.x.plus
net jog-x-neg halui.axis.x.minus
net jog-x-analog halui.axis.x.analog
net x-is-homed halui.joint.0.is-homed
net axis-select-y halui.axis.y.select
net jog-y-pos halui.axis.y.plus
net jog-y-neg halui.axis.y.minus
net jog-y-analog halui.axis.y.analog
net y-is-homed halui.joint.1.is-homed
net axis-select-z halui.axis.z.select
net jog-z-pos halui.axis.z.plus
net jog-z-neg halui.axis.z.minus
net jog-z-analog halui.axis.z.analog
net z-is-homed halui.joint.2.is-homed
net jog-selected-pos halui.axis.selected.plus
net jog-selected-neg halui.axis.selected.minus
net spindle-manual-cw halui.spindle.0.forward
net spindle-manual-ccw halui.spindle.0.reverse
net spindle-manual-stop halui.spindle.0.stop
net machine-is-on halui.machine.is-on
net jog-speed halui.axis.jog-speed
net MDI-mode halui.mode.is-mdi
custom_postgui.hal
Code:
net spindle-speed-fb <= gmoccapy.spindle_feedback_bar
net spindle-at-speed <= gmoccapy.spindle_at_speed_led
also the VFD is configured with the correct parameters according to the next page in the thread I linked above, thank you in advance for your help.