[SOLVED]How to configure the PWM signal in a MESA 7i96 for a spindle?

More
16 Mar 2022 21:54 #237502 by PCW
do you still have this line in the hal file:
setp hm2_7i96.0.pwmgen.00.out0.invert_output true

and are you using the STEP4- output?

When you invert the PWM output (the statement above does this)
The PWM output on STEP4- should stay low at 0 PWM

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

More
16 Mar 2022 22:23 #237505 by Nest
no, I didn't have that line in the HAL file. I have now write it and it works perfectly.
How can I raise the frequency so that the spindle goes faster?

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

More
16 Mar 2022 22:50 #237509 by PCW
You should set the PWM scale to the maximum RPM value
Then the PWM will be at 100% duty cycle at the maximum RPM setting

Note that the PWM frequency needed is determined by you interface
hardware and may need some testing if not documented

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

More
21 Mar 2022 18:14 #237943 by Nest
ok perfect,
For this configuration I have used the custom.hal file and it works fine.
can I use multiple ports for PWM signals and have two PWM signals?
can I use a TB3 output for a PWM signal?
Where can I learn this language to be able to make my own configurations?  

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

More
21 Mar 2022 19:49 #237950 by PCW
Yes, you could have two PWM outputs on TB2 instead of PWM/DIR
with different firmware

You can use TB3 outputs for PWM, but only at quite low frequencies
because they can only be changed at the servo thread rate. For
example to get 1% resolution PWM at a servo thread period of 1 ms
you would need to have a PWM frequency of 10 Hz

To use TB3 outputs as PWM you would use LinuxCNC's software
PWM componant
The following user(s) said Thank You: Nest

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

More
06 Apr 2022 23:15 - 06 Apr 2022 23:17 #239478 by Nest
I do not understand this:
To use TB3 outputs as PWM you would use LinuxCNC's software PWM componant

Could you explain it to me a little more?

So, would it be possible to add a laser module to my CNC and use another output to activate the laser and generate another PWM signal, that is, my CNC would be a router and a laser with the same firmware?
Last edit: 06 Apr 2022 23:17 by Nest.

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

More
07 Apr 2022 22:26 #239603 by andypugh
Software PWM, it works with any IO pin, though would typically be used in a fast thread with a parallel port.

linuxcnc.org/docs/stable/html/hal/rtcomps.html#_pwmgen

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

More
08 Apr 2022 16:46 #239680 by Nest
Hi. I'm sorry but I don't understand that language, I know how to program in C but not this and I don't understand it, I don't know the rules to understand it, and the documents that exist don't help me, they explain for people who already have knowledge in this language.
I need help to understand
If it's not too much trouble, can you give me a step-by-step example of what to do to configure a PWM signal on TB3 output 0 to drive a spindle?

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

More
08 Apr 2022 21:06 #239700 by andypugh
The following user(s) said Thank You: Nest

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

More
11 Apr 2022 21:26 #239977 by Nest
hi, i think i understand some of linuxcnc but i'm stuck.
I have added the pwmgen component to the project only one generator
loadrt pwmgen output_type=0

I have added the functions
addf pwmgen.make-pulses     servo-thread   
addf pwmgen.update          servo-thread

and I have configured the parameters
setp pwmgen.0.scale         4000          
setp pwmgen.0.pwm-freq      100.00
setp pwmgen.0.dither-pwm    1
setp pwmgen.0.min-dc        0.0
setp pwmgen.0.max-dc        0.0
setp pwmgen.0.value         20.00

but when showing the HAL configuration I don't see any changes on the pins.


I see that the TB3 outputs are solid state relays, when the hm2_7i96.0.ssr.00.out-00 for example
net spindle-enable <= pwmgen.0.enable => hm2_7i96.0.ssr.00.out-00

output is activated when i tipe in the MDI tab M03 S300 a contact is closed. I think that pwmgen acts on the relay closing and opening and creating the PWM signal

what am I missing?

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

Moderators: PCWjmelson
Time to create page: 0.087 seconds
Powered by Kunena Forum