- Configuring LinuxCNC
- Configuration Tools
- PnCConf Wizard
- Help needed to get my 7i76E + 7i85S + 7i73 on my mill going.
Help needed to get my 7i76E + 7i85S + 7i73 on my mill going.
pin out float speed "speed in RPM";
How does this speed connect to my HAL?
#*******************
# 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
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
# ---Encoder feedback signals/setup---
setp hm2_7i76e.0.encoder.04.counter-mode 0
setp hm2_7i76e.0.encoder.04.filter 1
setp hm2_7i76e.0.encoder.04.index-invert 0
setp hm2_7i76e.0.encoder.04.index-mask 0
setp hm2_7i76e.0.encoder.04.index-mask-invert 0
# setp hm2_7i76e.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
net spindle-revs <= hm2_7i76e.0.encoder.04.position
net spindle-vel-fb-rps <= hm2_7i76e.0.encoder.04.velocity
net spindle-index-enable <=> hm2_7i76e.0.encoder.04.index-enable
# ---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-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
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
net spindle-vel-fb-rps => motion.spindle-speed-in
net spindle-index-enable <=> motion.spindle-index-enable
# ---Setup spindle at speed signals---
sets spindle-at-speed true
setp hm2_7i76e.0.7i76.0.0.spinout-scalemax 2400
setp hm2_7i76e.0.7i76.0.0.spinout-maxlim 2500
net spindle-enable hm2_7i76e.0.7i76.0.0.spinena
net spindle-vel-cmd-rpm-abs hm2_7i76e.0.7i76.0.0.spinout
net spindle-ccw hm2_7i76e.0.7i76.0.0.spindir
Please Log in or Create an account to join the conversation.
I might have done this if the hi/lo ratios could have been locked down to a simple multiple of the base ratio but that did not appear to be the case.
Lo is 50% of Hi or do I misunderstand this?
No I think I was the one that misunderstood not really knowing your mill.
Sorry but I don't really understand spindles as my plasma cutter does not have one. I suspect that the pin that needs to be connected instead of these setp commands.
setp hm2_7i76e.0.7i76.0.0.spinout-scalemax 2400
setp hm2_7i76e.0.7i76.0.0.spinout-maxlim 2500
You might need to mult the speed by say 0.9 for scalemax.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I find this very helpful with my hal leaning experience.
Please Log in or Create an account to join the conversation.
Sorry but I don't really understand spindles as my plasma cutter does not have one. I suspect that the pin that needs to be connected instead of these setp commands.
setp hm2_7i76e.0.7i76.0.0.spinout-scalemax 2400
setp hm2_7i76e.0.7i76.0.0.spinout-maxlim 2500
The spindle analogue output scale values can not be linked, they are parameters rather than pins.
I am not 100% sure what is required here, but I am assuming that the intention is that LinuxCNC sends the right motor speed to get the required spindle speed.
You could set the scalemax and maxlim to the actual motor speed. Or scale it from 0 to 100% or from 0 to 1.
The best approach probably depends on where the spindle speed feedback is from, is it from a spindle encoder, a motor encoder or from the VFD?
It is possible that the custom component output only needs to connect to the pid.s.ff0
(Having a closed-loop spindle-speed configuration does slightly complicate things, the feedback might need scaling too)
Please Log in or Create an account to join the conversation.
It seems that the requirement to use a parameter to set maximum spindle speed is not designed with a gearbox in mind.
Please Log in or Create an account to join the conversation.
I am not 100% sure what is required here, but I am assuming that the intention is that LinuxCNC sends the right motor speed to get the required spindle speed.
You could set the scalemax and maxlim to the actual motor speed. Or scale it from 0 to 100% or from 0 to 1.
The best approach probably depends on where the spindle speed feedback is from, is it from a spindle encoder, a motor encoder or from the VFD?
It is possible that the custom component output only needs to connect to the pid.s.ff0
(Having a closed-loop spindle-speed configuration does slightly complicate things, the feedback might need scaling too)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
In theory the PID ought to be able to work in any gear, and adjust the spindle control voltage accordingly.
But, in practice it will need a bit of help to set the speed correctly at a reasonable speed.
PID output is partly made up of FF0 * input. So just setting FF0 of the PID for each gear might have the desired effect.
I would be tempted to scale the spindle control voltage to motor speed. Assuming a 1500 rpm motor then the parameter you want out of the component is 1500/max_speed for each gear (rather than the actual top speed) then link that to the PID FF0 pin.
Please Log in or Create an account to join the conversation.
I've added a parameter called maxrpm
#set as per Andy's example
setp gearbox2.maxrpm 1500
component gearbox2 "LinuxCNC HAL component for Techno's gearbox";
author "Rod Webster";
pin in bit input_a "input a";
pin in bit input_b "input b";
pin in bit input_c "input c";
pin in bit input_d "input d";
pin in bit input_e "input e";
pin in bit gear_shift "gear shift, true if high";
pin in bit higear "true if in high gear";
pin out float speed "speed in RPM";
pin out float speedratio "max RPM for machine divided by maximum RPM for gear";
param rw float maxrpm "maximum RPM for machine";
function _;
license "GPL";
;;
#include <rtapi_math.h>
FUNCTION(_) {
static double speedarray[4][5] = {
{2500.0, 1500.0, 900.0, 540.0, 325.0},
{1500.0, 900.0, 540.0, 325.0, 195.0},
{1250.0, 750.0, 450.0, 270.0, 160.0},
{ 750.0, 450.0, 270.0, 160.0, 100.0}
};
int idx;
idx = (higear) ? 0:1 + (gear_shift) ? 0:2;
if(input_a)
speed = speedarray[idx][0];
if(input_b)
speed = speedarray[idx][1];
if(input_c)
speed = speedarray[idx][2];
if(input_d)
speed = speedarray[idx][3];
if(input_e)
speed = speedarray[idx][4];
speedratio = maxrpm/speed;
}
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Configuration Tools
- PnCConf Wizard
- Help needed to get my 7i76E + 7i85S + 7i73 on my mill going.