Askpower VFD Connections

More
12 Mar 2018 12:38 #107241 by skrap58
Replied by skrap58 on topic Askpower VFD Connections
#9 setp spindle-vfd.enable

Will any random number work or is there something specific that needs to go there?
In the linuxcnc documentation this goes in the hal file

loadrt scale count=1
addf scale.0 servo-thread
setp scale.0.gain 0.002
net spindle-speed-scale motion.spindle-speed-out => scale.0.in
net spindle-speed-DAC scale.0.out => <your DAC pin name> (What should this pin name be?)

I apologize for being so clueless about this. But, it is all new to me.
Thank you for your help.

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

More
12 Mar 2018 12:50 #107242 by andypugh
Replied by andypugh on topic Askpower VFD Connections
Try 1 to enable the VFD and 0 to disable it.

I rather imagine you want to enable it.

The DAC pin is probably pwmgen.0.value as I assume that you are using software PWM. But you haven't actually said, and I can't see a "loadrt pwmgen" in the HAL snippets posted so far.

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

More
12 Mar 2018 20:57 #107257 by skrap58
Replied by skrap58 on topic Askpower VFD Connections
I am not using pwm software. I am following this guide

1. 0-10v Spindle Speed
If your spindle speed is controlled by an analog signal, (for example, by a VFD with a 0 to 10 volt signal) and you’re using a DAC card like the m5i20 to output the control signal:

First you need to figure the scale of spindle speed to control signal. For this example the spindle top speed of 5000 RPM is equal to 10 volts.

images/spindle-math.png
We have to add a scale component to the HAL file to scale the motion.spindle-speed-out to the 0 to 10 needed by the VFD if your DAC card does not do scaling.

loadrt scale count=1
addf scale.0 servo-thread
setp scale.0.gain 0.002
net spindle-speed-scale motion.spindle-speed-out => scale.0.in
net spindle-speed-DAC scale.0.out => <your DAC pin name>

custom.hal
# Include your customized HAL commands here
# This file will not be overwritten when you run stepconf again


# Load the Huanyang VFD user component
loadusr -Wn vfd hy_vfd -n vfd

#net vfd-comms halui.machine.is-on => spindle-vfd.enable
setp spindle-vfd.enable 1
net spindle-fwd motion.spindle-forward => spindle-vfd.spindle-forward
net spindle-reverse motion.spindle-reverse => spindle-vfd.spindle-reverse
net spindle-speed-cmd motion.spindle-speed-out-abs => spindle-vfd.speed-command
net spindle-on motion.spindle-on => spindle-vfd.spindle-on
net spindle-at-speed motion.spindle-at-speed => spindle-vfd.spindle-at-speed

my-mill.hal

# Generated by stepconf 1.1 at Mon Mar 12 16:18:56 2018
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hal_parport cfg="0 out"
loadrt stepgen step_type=0,0,0

loadrt scale count=1
addf scale.0 servo-thread
setp scale.0.gain 0.002
net spindle-speed-scale motion.spindle-speed-out => scale.0.in
net spindle-speed-DAC scale.0.out =>
addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
net spindle-cmd-rpm <= motion.spindle-speed-out
net spindle-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-cmd-rps <= motion.spindle-speed-out-rps
net spindle-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-at-speed => motion.spindle-at-speed

net xstep => parport.0.pin-02-out
net xdir => parport.0.pin-03-out
net ystep => parport.0.pin-04-out
net ydir => parport.0.pin-05-out
net zstep => parport.0.pin-06-out
net zdir => parport.0.pin-07-out
net astep => parport.0.pin-08-out
net adir => parport.0.pin-09-out
net max-x <= parport.0.pin-10-in
net max-y <= parport.0.pin-11-in
net max-z <= parport.0.pin-12-in

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 1
setp stepgen.0.dirhold 115000
setp stepgen.0.dirsetup 115000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
net max-x => axis.0.pos-lim-sw-in

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 1
setp stepgen.1.dirhold 115000
setp stepgen.1.dirsetup 115000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
net max-y => axis.1.pos-lim-sw-in

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 1
setp stepgen.2.dirhold 115000
setp stepgen.2.dirsetup 115000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable
net max-z => axis.2.pos-lim-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

wwp@cnc ~ $ linuxcnc
LINUXCNC - 2.7.10
pickconfig: installed aux examples: /usr/share/linuxcnc/aux_examples/NativeCAM
Machine configuration directory is '/home/wwp/linuxcnc/configs/my-mill'
Machine configuration file is 'my-mill.ini'
Starting LinuxCNC...
Found file(REL): ./my-mill.hal
Note: Using POSIX realtime
config string '0 out'
./my-mill.hal:13: Pin '1' does not exist
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/wwp/linuxcnc_debug.txt
and
/home/wwp/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
wwp@cnc ~ $

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

More
12 Mar 2018 21:07 #107258 by andypugh
Replied by andypugh on topic Askpower VFD Connections
So _are_ you using a 5i20 as mentioned?

If not, what hardware are you using?

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

More
12 Mar 2018 21:08 #107259 by Grotius
Replied by Grotius on topic Askpower VFD Connections
Hi Scrap,

If you are good in rs485 and python you can modify a rs485 usb connection example file. I'ts posted here before at the forum.
The files is called : hpmx.py

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

More
12 Mar 2018 21:11 #107260 by andypugh
Replied by andypugh on topic Askpower VFD Connections

If you are good in rs485 and python you can modify a rs485 usb connection example file. I'ts posted here before at the forum.
The files is called : hpmx.py


Are you sire that the VFD under discussion has an RS485 connection?

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

More
12 Mar 2018 21:22 #107261 by skrap58
Replied by skrap58 on topic Askpower VFD Connections
I am using a ST-V2 breakout board from stepperonline.

www.omc-stepperonline.com/download/ST-V2.pdf

connected to the askpower vfd mentioned above

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

More
12 Mar 2018 21:23 #107262 by skrap58
Replied by skrap58 on topic Askpower VFD Connections
It does not support modbus so I think it has to be done with the 0-10v connections.

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

More
12 Mar 2018 21:57 #107264 by andypugh
Replied by andypugh on topic Askpower VFD Connections

I am using a ST-V2 breakout board from stepperonline.
www.omc-stepperonline.com/download/ST-V2.pdf
connected to the askpower vfd mentioned above


In that case you _will_ need a software PWM generator.

And that is what you need to connect the spindle output to.

linuxcnc.org/docs/2.7/html/man/man9/pwmgen.9.html

(Actually I would normally suggest running it in PDM mode)

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

More
15 Mar 2018 20:56 #107399 by skrap58
Replied by skrap58 on topic Askpower VFD Connections
Ok I have the spindle working with the vfd in axis but it goes right up to max speed. It seems like I do not need the pwm software. I should be able to run using scaling but I cant seem to get that to work. I have attached my .hal file

All i need to do at this point is control the spindle speed via axis.

as always any and all help is greatly appreciated
Attachments:

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

Time to create page: 0.108 seconds
Powered by Kunena Forum