PnCConf and setting up PWM on 7i96

More
31 Mar 2020 23:10 #162315 by GND
I'm in the final stages of my first 7i96 deployment - all good so far after some great forum help.

But I'm now struggling with the final step - to set up a PWM output to drive my spindle speed. I have - I believe - the right firmware in my Mesa card, namely 7i96d_1pwm. But when I get to the page in PnCConf where you choose the firmware, it only shows 7i96d as an option. And therefore it won't let me select a PWM output.

Have I done something wrong? Any help gratefully received!

Cheers
Graeme

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

More
01 Apr 2020 00:07 - 01 Apr 2020 00:12 #162320 by PCW
You will probably have to do this by directly editing the hal/ini files

Pncconf will put in most of the hal/ini boilerplate for spindle control
including spindle enable and direction but you will have to wire the
spindle-output signal to the pwmgen value pin, setup the PWM scaling,
mode and frequency and set the PWMgen enable true
(or wire it to spindle-enable)

Basic PWM setup:
setp hm2_7i96.0.pwmgen.pwm_frequency 10000
setp hm2_7i96.0.pwmgen.00.scale 24000 # full scale is 24000 RPM
setp hm2_7i96.0.pwmgen.00.output-type 1 # standard PWM and direction

net spindle-enable hm2_7i96.0.pwmgen.00.enable
net spindle-speed-out-rpm-abs hm2_7i96.0.pwmgen.00.value
Last edit: 01 Apr 2020 00:12 by PCW.

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

More
01 Apr 2020 00:17 #162321 by GND
I did wonder if that might be the case! I guess I make sure everything else I need is set up using PnCConf, then then do the edits by hand. Then any future changes will either have to made be by hand, or via PnCConf with these edits re-applied.

No problem - I can do that!

Many thanks for your help, as ever.

Cheers
Graeme

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

More
01 Apr 2020 00:30 #162322 by PCW
Note that that is basically just a sketch
how direction is handled and the startup
PWM state need to be addressed

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

More
01 Apr 2020 08:56 #162338 by Clive S

But I'm now struggling with the final step - to set up a PWM output to drive my spindle speed. I have - I believe - the right firmware in my Mesa card, namely 7i96d_1pwm. But when I get to the page in PnCConf where you choose the firmware, it only shows 7i96d as an option. And therefore it won't let me select a PWM output.


I have answered your question on the other forum that you posted the question on. Are you UK based?

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

More
01 Apr 2020 17:06 #162360 by GND
Thanks Guys - just seen the later posts you sent.

@PCW - OK. My spindle is forward only, so I presume that removes one issue. When you say the startup PWM state, what do you mean by this? I have been reading the HostMot2 driver manual today, but see no mention of startup state?

Also, can I ask - is it possible to assign the PWM output to specific pins on the 7i96? Or is this fixed in the device configuration? I am presuming the latter from what I've read.

@Clive S - yes, I'm in the UK. I saw and responded to your posting on the other forum, where I was asking some Novamill specific questions. Many thanks for that!
The following user(s) said Thank You: Clive S

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

More
01 Apr 2020 17:25 - 01 Apr 2020 17:26 #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: 01 Apr 2020 17:26 by PCW. Reason: fix formatting a bit

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

More
01 Apr 2020 18:18 #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
01 Apr 2020 22:20 #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
01 Apr 2020 22:35 #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.

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