PnCConf and setting up PWM on 7i96

More
6 years 7 months ago - 6 years 7 months ago #162361 by PCW
The start-up PWM state is really only important if you don't have a separate spindle enable
ideally the spindle enable should be a 7I96 SSR output since its guaranteed to be off at
start-up or after a watchdog bite

The PWM output is determined by the firmware loaded, The standard PWM firmware
for the 7I96 replacesSTEP4/DIR4 with PWM/DIR.

You can use the software PWM on almost any I/O pin if you are OK with quite a slow
PWM frequency. For example you could use a SSR output for the software PWM
at say 10Hz PWM frequency and 1% resolution. This would be an easy way to generate
a 0 to 10V signal for a VFD as long as you dont expect fast speed changes.
Last edit: 6 years 7 months ago by PCW. Reason: fix formatting a bit

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

More
6 years 7 months ago #162365 by GND
That makes sense regarding the start up state. In my case I have a spindle relay driven by one of the SSR outputs, hence as you say, safe at start up. Sounds like that's another detail I can tick off my list!

Thanks also for the clarification regarding the physical 7i96 connections used. It's useful to know about the SW option for PWM too - but for my purposes, using the HW PWM generator on STEP4/DIR4 is ideal. Just wanted to be sure where to put the wires!

As ever, thanks for your fast and detailed assistance.

Cheers
Graeme

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

More
6 years 6 months ago #162388 by GND
Well, I've made the edits to the HAL (or more specifically to the custom.hal, to avoid editing the main hal file) and am having no luck.

I believe I have everything right, because if I use the Halscope, I can see that the inputs into the PWM function are correct. If I adjust the spindle override in AXIS, I can see the PWM "value" moving between 0 and 1 exactly as expected. The other settings (enable, scale, output-type and pwm_frequency) are all just as I I have set them. But I get no output from the 7i96 pin.

I have an oscilloscope on the step4 pin (tried both the + and -) and nothing. All I see is the Step4+ goes from logic 1 to logic 0 when I run LinuxCNC But no pulse train. I checked the firmware version loaded with Mesaflash, and it has PWM. So now I'm really at a loss....

Any thoughts most welcome!

Cheers
Graeme

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

More
6 years 6 months ago #162392 by PCW
can you post the results of:

halcmd show all | grep pwm

When linuxcnc is running and you expect PWM output?

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

More
6 years 6 months ago #162396 by GND
No problem;

26 bit IN TRUE hm2_7i96.0.pwmgen.00.enable
26 float IN 1 hm2_7i96.0.pwmgen.00.value <== spindle-speed
==> hm2_7i96.0.pwmgen.00.value
26 bit RW FALSE hm2_7i96.0.pwmgen.00.out0.invert_output
26 bit RW FALSE hm2_7i96.0.pwmgen.00.out0.is_opendrain
26 bit RW FALSE hm2_7i96.0.pwmgen.00.out1.invert_output
26 bit RW FALSE hm2_7i96.0.pwmgen.00.out1.is_opendrain
26 s32 RW 1 hm2_7i96.0.pwmgen.00.output-type
26 float RW 5000 hm2_7i96.0.pwmgen.00.scale
26 u32 RW 0x00004E20 hm2_7i96.0.pwmgen.pdm_frequency
26 u32 RW 0x000003E8 hm2_7i96.0.pwmgen.pwm_frequency
hm2_7i96.0.pwmgen.00.out0.invert_output hm2_7i96.0.gpio.025.invert_output
hm2_7i96.0.pwmgen.00.out0.is_opendrain hm2_7i96.0.gpio.025.is_opendrain
hm2_7i96.0.pwmgen.00.out1.invert_output hm2_7i96.0.gpio.026.invert_output
hm2_7i96.0.pwmgen.00.out1.is_opendrain hm2_7i96.0.gpio.026.is_opendrain

Hope that gives you some clues....
Graeme

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

More
6 years 6 months ago #162399 by PCW
OK so if the scale is 5000 did you try setting the spindle speed to 2500 (that should be 50% duty cycle)

The current value of 1 would be close to 0 PWM duty cycle

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

Moderators: cmorley
Time to create page: 0.459 seconds
Powered by Kunena Forum