Huanyang VFD with 2,2 kw chinesium spindle

More
30 Jan 2020 11:21 #156160 by MovT
Hi.

I want to bring my chinesium spindle to work with help here. But i only have one speed at the spindle. I stuck now. No matter what speed i will set e.g. M3 S12000 the spindle will start and stop acceleration at 6000 rpm. M3 S0 stops the spindle. All work well but not the speed settings.

Here the config snippets:

LinuxCNC Version 2.8

Custom HAL
loadusr -Wn vfd hy_vfd -n vfd -d /dev/ttyUSB0 -p none -r 9600 
#loadusr -Wn vfd hy_vfd -n vfd -t 1 -d /dev/ttyUSB0 -p none -r 9600 -s 1 -S 24000 -F 400 -f 100 -V 220 -I 11 -P 4
net spindle-cmd-rpm-abs => vfd.speed-command
net spindle-cw spindle.0.forward => vfd.spindle-forward
net spindle-ccw spindle.0.reverse => vfd.spindle-reverse
net on spindle.0.on => vfd.spindle-on => hm2_7i76e.0.7i76.0.0.output-13
net spindle-at-speed => vfd.spindle-at-speed
setp vfd.enable 1

.ini
[SPINDLE_0]
P = 0
I = 0
D = 0
FF0 = 1
FF1 = 0
FF2 = 0
BIAS = 0
DEADBAND = 0


MAX_OUTPUT = 24000.0
OUTPUT_MIN_LIMIT = 6000
OUTPUT_MAX_LIMIT = 24000
OUTPUT_SCALE = 24000

.hal
#*******************
#  SPINDLE
#*******************

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

I would be very happy when i get it working as expected.

Thanks,
Udo

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

More
30 Jan 2020 11:38 #156163 by bbsr_5a
is the Parameter set to get speed from the RS485
the hyanjang also got a Jumper
seams you only set the start stop to the USB signal

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

More
30 Jan 2020 12:50 #156173 by MovT
Yes all works still under Windows 7 with Mach3 and the VFD driver. Same machine same wiring etc.

How i can debug the communication?

tail -f /dev/ttyUSB0 didnt work ;(

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

More
30 Jan 2020 14:55 #156183 by MovT
5 Minutes ago i go back to Mach3 and test the spindle. All works fine and the speed went up to 24000 rpm.

I can't figure out what i miss in my config.

by the way, the vfd.speed-comand is always 0. vfd.rott says 6000 rpm if th spindle run. Thats very weird.

Any help will be appreciated.


Best,
Udo

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

More
30 Jan 2020 17:37 #156191 by Todd Zuercher
Does your spindle have encoder feedback? If it doesn't why do you have a pid configured. The PID can't close the loop without feedback.

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

More
30 Jan 2020 19:30 #156197 by MaHa
My configuration, another vfd but hf spindle and 7i76e. It's pncconf wizard generated and modified.
In the .ini file this entry.

#********************
# Spindle 
#********************
[SPINDLE_9]
P = 0.0
I = 0.0
D = 0.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 24000.0
OUTPUT_SCALE = 26000
OUTPUT_MIN_LIMIT = 0
OUTPUT_MAX_LIMIT = 24000

the output scale was needed, to get 6000rpm at 100 Hz and 24000rpm at 400Hz.

In hal, timedelay for speedupdelay, and lincurve to set any s lower than 6000 to 6000 and limit to 24000rpm is also in my config.
loadrt timedelay count=1
loadrt lincurve personality=4
addf timedelay.0 servo-thread
addf lincurve.0 servo-thread
setp timedelay.0.on-delay 4
setp timedelay.0.off-delay 0


#*******************
#  SPINDLE S
#*******************

setp   pid.s.Pgain     [SPINDLE_9]P
setp   pid.s.Igain     [SPINDLE_9]I
setp   pid.s.Dgain     [SPINDLE_9]D
setp   pid.s.bias      [SPINDLE_9]BIAS
setp   pid.s.FF0       [SPINDLE_9]FF0
setp   pid.s.FF1       [SPINDLE_9]FF1
setp   pid.s.FF2       [SPINDLE_9]FF2
setp   pid.s.deadband  [SPINDLE_9]DEADBAND
setp   pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT
setp   pid.s.error-previous-target true


# ---auto rpm: 1-6000 = 6000 / 24000 max
setp lincurve.0.x-val-00 0
setp lincurve.0.y-val-00 0
setp lincurve.0.x-val-01 1
setp lincurve.0.y-val-01 6000
setp lincurve.0.x-val-02 6000
setp lincurve.0.y-val-02 6000
setp lincurve.0.x-val-03 24000
setp lincurve.0.y-val-03 24000


net spindle-index-enable   <=> pid.s.index-enable
net spindle-enable          => pid.s.enable
net spindle-vel-cmd-rpm-abs => pid.s.command
net spindle-vel-fb-rpm-abs  => pid.s.feedback
net spindle-output          <= pid.s.output

# ---digital potentionmeter output signals/setup---

setp   hm2_7i76e.0.7i76.0.0.spinout-minlim    [SPINDLE_9]OUTPUT_MIN_LIMIT
setp   hm2_7i76e.0.7i76.0.0.spinout-maxlim    [SPINDLE_9]OUTPUT_MAX_LIMIT
setp   hm2_7i76e.0.7i76.0.0.spinout-scalemax  [SPINDLE_9]OUTPUT_SCALE

net spindle-output      => hm2_7i76e.0.7i76.0.0.spinout
net spindle-enable      => hm2_7i76e.0.7i76.0.0.spinena                 timedelay.0.in
net spindle-cw          => hm2_7i76e.0.7i76.0.0.spindir

# ---setup spindle control signals---

net spindle-vel-cmd-rps        <=  motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs    <=  motion.spindle-speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  motion.spindle-speed-out
net spindle-pre                <=  motion.spindle-speed-out-abs         lincurve.0.in
net spindle-vel-cmd-rpm-abs    <=  lincurve.0.out
net spindle-enable             <=  motion.spindle-on
net spindle-cw                 <=  motion.spindle-forward
net spindle-ccw                <=  motion.spindle-reverse
net spindle-brake              <=  motion.spindle-brake
net spindle-revs               =>  motion.spindle-revs
net spindle-at-speed           =>  motion.spindle-at-speed              timedelay.0.out 
net spindle-vel-fb-rps         =>  motion.spindle-speed-in
net spindle-index-enable      <=>  motion.spindle-index-enable


#    sets spindle-at-speed true

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

More
30 Jan 2020 20:09 - 30 Jan 2020 20:10 #156200 by Todd Zuercher
If he is simply commanding the VFD through modbus, (not the 7i76's analog out). There should be no reason to scale an output. Also the VFD can have its parameters set to honor the minimum and max speeds and ramp speed, so there would be no need for the Limit3. Simply connecting the motion. spindle-speed-out to hal pin for the serial driver.

It may be helpful if you posted your entire hal file rather than snippets of it.

At this point I'm not sure if the VFD is starting and being ran by physical connections to your 7i76 or by the serial connection. You seem to have both in your hal file. If you intend to run using the serial connections you should not connect the physical ones. On a lot of these drives if you enable the terminal strip inputs you must disable the serial link and vice versa.
Last edit: 30 Jan 2020 20:10 by Todd Zuercher.

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

More
30 Jan 2020 22:37 - 30 Jan 2020 22:39 #156211 by MovT
All answers sounds very cryptic. I am a beginner in LinuxCnC. My first attempt was in a case successful. The Spindle starts but the vfd.command-speed wasn't delivered by any kind of the examples.

I digged deeeper in the signal chain and grab the first input and so what - it works now.

The line:

net spindle-cmd-rpm-abs => vfd.speed-command

was changed to :

net spindle-vel-cmd-rpm => vfd.speed-command

and all was fine.

M3 S12000 bring the spindle to 12000 rpm and if the spindle achieved the target rpm spindle-at-sped will set to true.

Thanks anyway guys.

Hope the rest will be in the same manner.

Best,
Udo
Last edit: 30 Jan 2020 22:39 by MovT.

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

Time to create page: 0.096 seconds
Powered by Kunena Forum