Spindle w/ PnCConf / Mesa 5i20 & 7i48 /EMC2 2.5
I put this line (setp hm2_5i20.0.encoder.04.counter-mode 1) in the custom.hal file per the instructions in the getting started manual. I think the latest version of PnCConf has done away with the need to do this because the same line is in the regular .hal file.
Regardless of what command I give the spindle I get a DAC out of 10V, either + or -. This happens even if I set the max output in PnCConf to less than 10 (this does change the value in the .ini file, but doesn't limit the signal).
The drive has an input to select reverse which I hooked to the "spindle-ccw" signal. This signal pulls in the reverse relay on the drive when it should, but the drive will only work with a positive DAC input. It needs a positive input for forward and also for reverse, with the reverse relay energized. The 7i48 is putting out +/- 10V, which makes sense, but doesn't work.
I don't have any signal, that I can find, in Hal Meter that shows the encoder counts. They don't seem to be linked to anything. As seems to be my habit, I'm again a lost ball in the high weeds. I've attached my .hal file; if anyone can help, I'd appreciate it. Thanks
Please Log in or Create an account to join the conversation.
The drive has an input to select reverse which I hooked to the "spindle-ccw" signal. This signal pulls in the reverse relay on the drive when it should, but the drive will only work with a positive DAC input. It needs a positive input for forward and also for reverse, with the reverse relay energized. The 7i48 is putting out +/- 10V, which makes sense, but doesn't work.
The hostmot2 PWM function (type 1) does support PWM and direction on the FPGA card pins, but the 7i48 doesn't understand that, it expects a typ2, two separate PWMs on two pins, one for negative and one for positive voltages.
I think your current setup is PWM type 1 (PWM and direction) being interpreted as a 100% negative PWM by the 7i48.
I think what you need to do is insert some HAL logic between the PID output and the PWMgen input.
1) An ABS function so that all requests are positive:
www.linuxcnc.org/docview/html/man/man9/abs.9.html
2) A COMP function to provide a reverse relay signal on a GPIO pin.
www.linuxcnc.org/docview/html/man/man9/comp.9.html
You would need to set comp.N.in1 to 0, and net comp.N.in0 to the PID output.
If you need actual HAL code just ask, but it's getting late here.
(An alternative would be to break-out the direction pin from the 50-way connector, and use it direct, but I feel that would be more trouble.)
Please Log in or Create an account to join the conversation.
The hostmot2 PWM function (type 1) does support PWM and direction on the FPGA card pins, but the 7i48 doesn't understand that, it expects a typ2, two separate PWMs on two pins, one for negative and one for positive voltages.
I think your current setup is PWM type 1 (PWM and direction) being interpreted as a 100% negative PWM by the 7i48.
setp hm2_5i20.0.pwmgen.04.output-type 2 (is what I have).
The 7i48 is giving a -10V output for any reverse command and a +10V output for any forward command.
# --- SPINDLE-CCW ---
setp hm2_5i20.0.gpio.043.is_output true
net spindle-ccw hm2_5i20.0.gpio.043.out
setp hm2_5i20.0.gpio.043.invert_output true
This sets the vfd to reverse when it should, but the drive doesn't output to the motor with the -10V input.
The above is just to make sure we're on the same page. At first I could live without reverse if I could control forward. I only have full speed and that throws a over voltage error in the vfd.
If you need actual HAL code just ask, but it's getting late here.
If I need HAL code I'm at your mercy. I read the links and can follow what they're saying but couldn't begin to implement the process.
Please Log in or Create an account to join the conversation.
As Andy said you need to add an absolute component between spindle command (SIGNAL spindle-vel-cmd ) and
the PWM generator (PIN hm2_5i20.0.pwmgen.04.value)
You could do this by hand editing the main HAL file but pncconf has a way to add components without editing.
On the HAL Component Page select 1 in the absolute spinbox. This will add the absolute component to the main HAL file.
In your custom hal file you will tell HAL to dsconnect the spindle pwm ge from the spidle command signal then plug in the absolute component.
unlink hm2_5i20.0.pwmgen.04.value
net spindle-vel-cmd abs.0.in
net spindle-vel-cmd-abs abs.0.out hm2_5i20.0.pwmgen.04.value
And if I havent made a mistake that should do it.
Please Log in or Create an account to join the conversation.
both positive and negative spindle velocity commands
First you need a
loadrt abs count=1
to load the abs (absolute value) component
and then the abs component needs to be wired in series with the spindle speed command from emc
net spindle-speed-cmd motion.spindle-speed-out => abs.0.in
net positive-only-spindle-speed-cmd abs.0.out => hm2_5i20.0.pwmgen.XX.value
(XX is the PWMGEN used for the spindle)
As far as only having full (10V) output) this is most likely because the pwmgen scale is incorrect
if it has not been set it will have the default value of +1 for 10V positive output a -1 for 10v negative
output so if you hand it a RPM value of 1 or greater it will go to full scale
The proper value is your full scale RPM with 10V in to your VFD, so for example if you have
4500 RPM at 10V, you need to set the PWM scale to 4500
setp hm2_5i20.0.pwmgen.XX.scale 4500
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
In PNCconf spindle control is not PID controlled but I could add that in the future. I was thinking it might make sense to have command and feedback at the same scale.
Seems like I should have PNCconf optionally add the absolute component for spindle control - is 0-10 volt control common?
Please Log in or Create an account to join the conversation.
has this changed? I think there was some discussion about changing it to match all the other units
There are lots of VFDs that are 0-10V +dir only plus some that can do either
+-10v or 0-10V and dir so both options would be good
Please Log in or Create an account to join the conversation.
Ok I will look at single direction control.
I wonder also how many people might be interested in PID spindle control.
I think most modern VFDs have this internally?
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.