7i77 and VFD spindle control

  • SPH
  • SPH's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
04 Sep 2025 07:46 #334392 by SPH
7i77 and VFD spindle control was created by SPH
I've been having a hard time trying to figure out how to get my router's Yaskawa 616g5 vfd connected up and running with my 5i25 - 7i77 setup.
I can't seem to find a good example of the HAL code and I'm not across HAL enough to figure it out for myself. 
Just trying to get the absolute basics working. Spindle on is already connected and working. I just need to figure out the 0-10v output from analogue5.
The VFD can be configured for 0-10v or +-10v. I'll be setting it to 0-10v, no need for it to reverse direction.
I've seen versions with scaling and versions without, versions that set the scaling directly in HAL and others that set the scaling parameters in INI.
As I understand it I shouldn't need any scaling, just SCALE, MAX and MIN values of 24000 and 0 (or maybe 6000, the slowest the spindle is rated for) 

I think I had it close to working at one point but the scaling must have been off. I've not gone as far as connecting the vfd to the 7i77 yet, just probing the output pins on the 7i77 with a multimeter. I was reading 0.4v when the spindle was on and 0 when off but in trying to figure out why the scaling was off on that particular iteration of the HAL file I deleted something and couldn't get LCNC to run. That was about the 15th attempt so I gave up for the day.

Most of the code I've tried to work from has looked like this or some version of it.
If someone has a similar setup and could share their HAL file or give me some direction on the bare bones that are required to get 0-10v working I'd really appreciate it.
#******************************
# SPINDLE S
#******************************


# ---PWM Generator signals/setup---

setp   hm2_5i25.0.7i77.0.1.analogout5-scalemax  [SPINDLE_9]OUTPUT_SCALE
setp   hm2_5i25.0.7i77.0.1.analogout5-minlim    [SPINDLE_9]OUTPUT_MIN_LIMIT
setp   hm2_5i25.0.7i77.0.1.analogout5-maxlim    [SPINDLE_9]OUTPUT_MAX_LIMIT

net spindle-vel-cmd  => hm2_5i25.0.7i77.0.1.analogout5
net machine-is-enabled      => hm2_5i25.0.7i77.0.1.spinena

# ---setup spindle control signals---

net spindle-vel-cmd-rps    <=  motion.spindle-speed-out-rps
net spindle-vel-cmd        <=  motion.spindle-speed-out
net spindle-on             <=  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
net spindle-vel-fb         =>  motion.spindle-speed-in
net spindle-index-enable  <=>  motion.spindle-index-enable

# ---Setup spindle at speed signals---

sets spindle-at-speed true

#SPINDLE-CW
net spindle-cw  motion.spindle-forward  => hm2_5i25.0.7i77.0.0.output-08

#SPINDLE-CCW
net spindle-ccw  motion.spindle-reverse => hm2_5i25.0.7i77.0.0.output-09

#SPINDLE-STOP
#net spindle-on  motion.spindle-on       => hm2_5i25.0.7i84.0.2.output-13

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

More
04 Sep 2025 12:04 #334398 by andypugh
Replied by andypugh on topic 7i77 and VFD spindle control
Which version of LinuxCNC are you running? I would expect the spindle pins to look more like "spindle.0.speed-out" on any recent LinuxCNC version.

To get a list of HAL pins that you can copy and paste from, in the HAL file insert the line
show pin
just after the block of "loadrt" commands
Then start LinuxCNC from the command line
linuxcnc &
LinuxCNC probably won't start, but you will see a list of all the pins, and also a message about the first problem it has found in the HAL file.
Copy the pin list from the terminal window and squirrel it away in a text file for reference.
(Copy and paste in the terminal window is generally ctrl-shift-C and ctrl-shift-V as "normal" Ctrl-C is "Cancel")

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

Time to create page: 0.486 seconds
Powered by Kunena Forum