Understanding Spindle control with PathPilot

More
24 Jan 2021 19:09 #196453 by remartinez
Good afternoon to all,

Hope someone can help me out understand how PathPilot ver 2.7 controls spindle speed with Tormach's ECM v1.4 board.

I am currently running PathPilot 2.7 with ECM v1.4 board and Teco N3 vfd. My understanding is that the N3 VFD spindle speed can be controlled via external source with either and anlog 0-10v input or Pulse Input. The only way I was able to get the motor to work is with the Pulse input. The spindle speed is not correlating to the rpm selected. My understanding is limited and I am guessing that frequency output to pulse input do not coincide.

So the question is what is the proper way to connect or setup the VFD appropriately.

Thank you,
Raul

Below is the Spindle Speed control from the Hal file.

# Spindle speed control
#
# stepgen outputs the frequency it is told by tormachspindlem200 comp
#

# type 1 velocity control mode
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.control-type 1

# step/dir
# type 2 quadrature output for 50% duty cycle
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.step_type 2

# no scaling 1:1
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.position-scale 1.0

# handle spindle at speed via separate component
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.maxaccel 0

# 20 kHz maximum frequency, position units / second
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.maxvel 20000

# stepspace in nanoseconds
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.stepspace 0

# steplen in nanoseconds (10 microseconds)
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.steplen 10000

# assume standard spindle until UI sets it
setp tormachspindlem200.spindle-type 0

# VFD_RUNNING feedback frequency from VFD
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.counter-mode 1
net vfd-running hm2_[HOSTMOT2](BOARD).0.encoder.01.velocity tormachspindlem200.vfd-rpm-feedback

# VFD_RUNNING feedback ratio from VFD
setp tormachspindlem200.vfd-feedback-factor [SPINDLE]VFD_RUNNING_FEEDBACK_RATIO

# VFD 24V line feedback
net raw_vfd_24V hm2_[HOSTMOT2](BOARD).0.gpio.055.in_not debounce.1.3.in
net vfd_24 debounce.1.3.out tormachspindlem200.vfd-24V

# VFD_FAULT line feedback
net raw_vfd_fault hm2_[HOSTMOT2](BOARD).0.gpio.053.in_not debounce.1.4.in
net vfd_fault debounce.1.4.out tormachspindlem200.vfd-fault

#to PP GUI via postgui
net spindle-fault tormachspindlem200.spindle-fault
net spindle-m200-comp-version tormachspindlem200.m200-comp-version

# these let the UI read the min/max maintained by the comp based on spindle type
net spindle-min-speed tormachspindlem200.min-speed
net spindle-max-speed tormachspindlem200.max-speed

# assume high range until UI sets it
setp tormachspindlem200.belt-position 1
net spindle-range tormachspindlem200.belt-position
net spindle-range-alarm tormachspindlem200.speed-alarm

setp tormachspindlem200.lowbelt-min-rpm [SPINDLE]LO_RANGE_MIN
setp tormachspindlem200.lowbelt-max-rpm [SPINDLE]LO_RANGE_MAX

setp tormachspindlem200.highbelt-min-rpm [SPINDLE]HI_RANGE_MIN
setp tormachspindlem200.highbelt-max-rpm [SPINDLE]HI_RANGE_MAX

# set belt ratios
setp tormachspindlem200.highbelt-ratio [SPINDLE]HI_RANGE_PULLEY_RATIO
setp tormachspindlem200.lowbelt-ratio [SPINDLE]LO_RANGE_PULLEY_RATIO

# speed-out is displayed by UI when program running on mill
# but we used the spindle encoder feedback on lathe
net spindle-speed-fb-rpm tormachspindlem200.speed-out

# connect motion speed-out to input of spindle comp
net spindle-speed-raw motion.spindle-speed-out tormachspindlem200.speed-in

# connect output of spindle comp to stepgen
net spindle-speed tormachspindlem200.vfd-freq-cmd hm2_[HOSTMOT2](BOARD).0.stepgen.04.velocity-cmd

# connect spindle comp at-speed output to motion
#net spindle-at-speed tormachspindlem200.at-speed motion.spindle-at-speed

# connect motion spindle enable to stepgen enable and spindle comp
#net spindle-on hm2_[HOSTMOT2](BOARD).0.stepgen.04.enable tormachspindlem200.spindle-on vfd-pulse.in hm2_[HOSTMOT2](BOARD).0.gpio.021.out
# motion.spindle-on routes to UI via postgui HALL then back to spindle-on here also via postgui HAL tormach.spindle

net spindle-on tormachspindlem200.spindle-on

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

More
24 Jan 2021 19:41 #196460 by smgvbest
Tormach runs their VFD,
Emerson Commander SK traditionally in Frequency Mode (Pulse input)

The Output from the Mesa Card is a Frequency from 0 hz to some Max Frequency. So what you have to do in the HAL/INI file is adjust the scaling factors to match what your VFD works with

Very important to make one change at a time and measure the result so you can clearly understand the impact of each change

Look in the INI file for these and adjust as needed
setp tormachspindlem200.lowbelt-min-rpm [SPINDLE]LO_RANGE_MIN
setp tormachspindlem200.lowbelt-max-rpm [SPINDLE]LO_RANGE_MAX

setp tormachspindlem200.highbelt-min-rpm [SPINDLE]HI_RANGE_MIN
setp tormachspindlem200.highbelt-max-rpm [SPINDLE]HI_RANGE_MAX

# set belt ratios
setp tormachspindlem200.highbelt-ratio [SPINDLE]HI_RANGE_PULLEY_RATIO
setp tormachspindlem200.lowbelt-ratio [SPINDLE]LO_RANGE_PULLEY_RATIO


In the HAL file I think starting with these 2 settings may get you going

you may have to adjust scaling and you do that here
# no scaling 1:1
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.position-scale 1.0

Find the Max Frequecy your VFD supports here
# 20 kHz maximum frequency, position units / second
setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.maxvel 20000

The HAL gurus may be of more specific help but these should get you moving

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

More
26 Jan 2021 15:14 #196620 by remartinez
I went ahead and went 1 by 1 and made the changes that you recommended. The only thing that made a difference was the scailing.

setp hm2_[HOSTMOT2](BOARD).0.stepgen.04.position-scale 1.0

I had to drop the scale down to 0.4 to resemble the spindle rpm as close as possible. I did noticed that this created a fluctuation on the output. On the VFD you can see the frequency input fluctuate so this makes the motor fluctuate up and down.

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

More
04 Feb 2021 11:18 - 04 Feb 2021 11:20 #197636 by MrJTJinx
smgvbest hope you dont mind me chipping in (please feel free to give me a good kicking especially if im talking crap)

remartinez your looking for a file in folder
\v2.7.0\v2.7.0\configs\tormach_mill\includes (or somthing like)
look for a file that matches the machine you chose when building your Pathpilot PC/controller - for me was the 1100-3
so my file was
spindle_1100_3_sk
The SK seems to match DIY builds with unknown VFDs
if you make the changes for min max rpm in here it should work and be perminant. Your other change is ok as it has updated the display on the GUI.
Last edit: 04 Feb 2021 11:20 by MrJTJinx.

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

Moderators: cncbasher
Time to create page: 0.081 seconds
Powered by Kunena Forum