7i33 pwmgen.value question
05 Feb 2012 21:15 #17444
by justin
7i33 pwmgen.value question was created by justin
Hello,
I have a 5i20 and 7i33 and I am interfacing with a vfd which wants a 0-10vdc signal. So originally I had the pwmgen value +/-10vdc but made it positive 10v regardless of spindle direction by using abs. In hal meter it is showing appropriate positive values for the pwgen.value. However when I a measure between the DRV2 and Ground on my 7i33 I get the exact value only negative.
When I am not using the abs component and I input an m4 hal meter shows a negative value on pwmgen.2.value but it outputs a positive dc voltage to my vfd and it works fine!
I am sure i am missing something simple here....
Here a section on my .hal file
#spindle scales
addf scale.0 servo-thread
addf scale.1 servo-thread
setp scale.0.gain 0.0001666
setp scale.1.gain 60
loadrt abs count=4
addf abs.0 servo-thread
addf abs.1 servo-thread
addf abs.2 servo-thread
addf abs.3 servo-thread
#spindle speed out limits
loadrt limit1 count=1
addf limit1.0 servo-thread
setp limit1.0.min -6000
setp limit1.0.max 6000
#set scale and pwm
setp hm2_5i20.0.encoder.02.scale -4096
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.output-type 1
net spindle-speed-limit motion.spindle-speed-out => limit1.0.in
net spindle-speed-limit-out limit1.0.out => scale.0.in
net spindle-speed-DAC scale.0.out
net spindle-speed-DAC-abs => hm2_5i20.0.pwmgen.02.value
#net spindle-speed-DAC => hm2_5i20.0.pwmgen.02.value
net spindle-rpm => abs.1.in
net spindle-speed-abs <= abs.1.out
net spindle-speed-DAC => abs.3.in
net spindle-speed-DAC-abs => abs.3.out
net spindle-enable-req motion.spindle-on => and2.1.in0
net spindle-brake-sensor hm2_5i20.0.gpio.051.in_not => and2.1.in1
net spindle-enable and2.1.out => hm2_5i20.0.pwmgen.02.enable
I have a 5i20 and 7i33 and I am interfacing with a vfd which wants a 0-10vdc signal. So originally I had the pwmgen value +/-10vdc but made it positive 10v regardless of spindle direction by using abs. In hal meter it is showing appropriate positive values for the pwgen.value. However when I a measure between the DRV2 and Ground on my 7i33 I get the exact value only negative.
When I am not using the abs component and I input an m4 hal meter shows a negative value on pwmgen.2.value but it outputs a positive dc voltage to my vfd and it works fine!
I am sure i am missing something simple here....
Here a section on my .hal file
#spindle scales
addf scale.0 servo-thread
addf scale.1 servo-thread
setp scale.0.gain 0.0001666
setp scale.1.gain 60
loadrt abs count=4
addf abs.0 servo-thread
addf abs.1 servo-thread
addf abs.2 servo-thread
addf abs.3 servo-thread
#spindle speed out limits
loadrt limit1 count=1
addf limit1.0 servo-thread
setp limit1.0.min -6000
setp limit1.0.max 6000
#set scale and pwm
setp hm2_5i20.0.encoder.02.scale -4096
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.output-type 1
net spindle-speed-limit motion.spindle-speed-out => limit1.0.in
net spindle-speed-limit-out limit1.0.out => scale.0.in
net spindle-speed-DAC scale.0.out
net spindle-speed-DAC-abs => hm2_5i20.0.pwmgen.02.value
#net spindle-speed-DAC => hm2_5i20.0.pwmgen.02.value
net spindle-rpm => abs.1.in
net spindle-speed-abs <= abs.1.out
net spindle-speed-DAC => abs.3.in
net spindle-speed-DAC-abs => abs.3.out
net spindle-enable-req motion.spindle-on => and2.1.in0
net spindle-brake-sensor hm2_5i20.0.gpio.051.in_not => and2.1.in1
net spindle-enable and2.1.out => hm2_5i20.0.pwmgen.02.enable
Please Log in or Create an account to join the conversation.
06 Feb 2012 00:28 #17448
by cmorley
Replied by cmorley on topic Re:7i33 pwmgen.value question
change you pwmgen scale from negative to positive.
setp hm2_5i20.0.encoder.02.scale 4096
setp hm2_5i20.0.encoder.02.scale 4096
Please Log in or Create an account to join the conversation.
06 Feb 2012 05:17 #17450
by justin
Replied by justin on topic Re:7i33 pwmgen.value question
Thanks for the reply. I just tried changing it and it does not seem to reverse the actual dc voltage from the 7i33. I imagine it would be a bad idea to simply swap the drv. and ground wires to the VFD. Would this cause grounding problems?
Please Log in or Create an account to join the conversation.
06 Feb 2012 06:03 #17451
by PCW
Replied by PCW on topic Re:7i33 pwmgen.value question
If the VFD signal is ground, yes it will cause troubles and possibly damage the 7I33
I think cmorely meant for you to change the PWM scale, not the encoder scale:
setp hm2_5i20.0.pwmgen.02.scale -oldscale
I think cmorely meant for you to change the PWM scale, not the encoder scale:
setp hm2_5i20.0.pwmgen.02.scale -oldscale
Please Log in or Create an account to join the conversation.
06 Feb 2012 07:22 #17452
by justin
Replied by justin on topic Re:7i33 pwmgen.value question
Thanks, that makes a lot of sense. I will try that in the morning...
Justin
Justin
Please Log in or Create an account to join the conversation.
06 Feb 2012 20:03 #17472
by cmorley
Replied by cmorley on topic Re:7i33 pwmgen.value question
Sorry yes thats what i meant.
Please Log in or Create an account to join the conversation.
08 Feb 2012 02:18 #17499
by justin
Replied by justin on topic Re:7i33 pwmgen.value question
Solved!.... first using Abs to make the pwmgen.value positive for both m3 and m4 and then using a pwmgen.scale of -1 worked great. Thanks for the help as always.
Justin
Justin
Please Log in or Create an account to join the conversation.
Time to create page: 0.105 seconds