7i76E one PWM needed

More
10 years 9 months ago #68948 by PCW
Replied by PCW on topic 7i76E one PWM needed
Chose the other differential pair output (so its 0V when the 7I76E is idle) and invert the PWM output in HAL

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

More
10 years 9 months ago #68958 by sirhc
Replied by sirhc on topic 7i76E one PWM needed
Must have been too late :silly: Don't know why I forgot it's differential.. Thanks!!!

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

More
10 years 9 months ago #68968 by sirhc
Replied by sirhc on topic 7i76E one PWM needed
Okay this works, but there is some sort of glitch of a few 100ms during startup of Linuxcnc. The negative pin is low when linuxcnc is not running which is good. At startup of linuxcnc the pin will go high and stay high until the invert command is executed.

So I'm not sure it can be solved in linuxcnc. Is it possible to change the FPGA code so when I use the positive pin PWM will stay 0 if Linuxcnc is closed?

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

More
10 years 9 months ago - 10 years 9 months ago #68969 by PCW
Replied by PCW on topic 7i76E one PWM needed
Yes, you would probably have to change the FPGA code to get a glitch free startup
You will always need to use the negative output as this is the only output that will stay at 0 when linuxcnc is not running

What is required is to make the FPGA PWM output active low. To do this as a hack you would
change ( in pwmpdmgenh.vhd )
Code:
when "00" => pwmouta <= pwm; -- normal sign magnitude pwmoutb <= dir; when "01" =>

to
Code:
when "00" => pwmouta <= not pwm; -- normal sign magnitude pwmoutb <= dir; when "01" =>
Last edit: 10 years 9 months ago by PCW.

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

More
10 years 9 months ago #69312 by sirhc
Replied by sirhc on topic 7i76E one PWM needed
I've got this part working, but I'm facing another strange problem which is maybe related to the bit file.
I've hooked up a spindle encoder. I don't know why but the index signal does not work. I have the encoder in counter mode because I only have one input on signal A. And I've hooked the index signal. When I open hal scope I can see both signals are working. The index signal is available at hm2_7i76e.0.encoder.00.input-index.

Hal looks like:
# ---Encoder feedback signals/setup---

setp hm2_7i76e.0.encoder.00.counter-mode 1
setp hm2_7i76e.0.encoder.00.filter 1
setp hm2_7i76e.0.encoder.00.index-invert 0
setp hm2_7i76e.0.encoder.00.index-mask 0
setp hm2_7i76e.0.encoder.00.index-mask-invert 0
setp hm2_7i76e.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE

net spindle-revs <= hm2_7i76e.0.encoder.00.position
net spindle-vel-fb-rps <= hm2_7i76e.0.encoder.00.velocity
net spindle-index-enable <=> hm2_7i76e.0.encoder.00.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

What could be wrong? The spindle-index-enable signal alwaysstays FALSE.

Regards Chris

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

More
10 years 9 months ago - 10 years 9 months ago #69313 by PCW
Replied by PCW on topic 7i76E one PWM needed
If motion.spindle-index-enable is false (so hm2_7i76e.0.encoder.00.index-enable remains false),
The index hardware is disabled so the index input does nothing

For spindle synchronized motion, spindle at speed must be true for motion to set index enable,
so I would check this first
Last edit: 10 years 9 months ago by PCW.

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

Moderators: PCW, jmelson
Time to create page: 0.072 seconds
Powered by Kunena Forum