Pwm base freq trong mach3 có nghĩa là gì
. Setting lower frequency value (e.g. 1000 Hz, 10% duty) is incorrect because laser is turned on at maximum power only by 0,1 millisecond and turned off by 0,9 milliseconds. As a result, power of laser is not averaged and cutting (engraving) line is dotted with long pauses especially if engraving speed is high. If you set higher base frequency, for example 10 000 Hz and the same duty, laser is turned on at maximum power 10 times per 1 millisecond. As a result, power of the laser The laser tube power supply I have allows two methods of control, 0-5VDC and PWM. The PWM frequency is 20kHz - 50kHz. This suggests there is some RC low pass filter on the input to convert the PWM to 0-5VDC. Mach3 PWMMach allows you to setup a pin as a PWM output. A decent PWM requires a very fast kernal frequency. If you want a 20,000Hz PWM frequency (minimum recommended by laser power supply) and you want to control the duty cycle in 1% increments. The kernal needs to run at 20,000 * 100 or 2,000,000Hz. That is way beyond what Mach3 can do. What we can get out of a basic computer is 25,000Hz. That means in order to get our 1% adjustment resolution be need to set the frequency at 25,000/ 100 = 250Hz. That is below the required frequency, so we need to convert to a voltage via a RC filter. So how well will this work....See below. This is under Config >> Spindle Pullies and will equate 0-100 RPM with 0-100% power. To convert the PWM signal to a voltage, you need to run it through a RC low pass filter. This will smooth out the signal, filling in the gaps durring the off periods of the PWM. The filter needs a time constant that is long enough to reduce the voltage ripple, yet short enough to have decent transitions in power. Here are some scope plots from Mach3 running PWM out at 50%, 10% and 90% duty cycle. Here are some plots with two different RC filters. The blue line is the voltage. The first one is pretty smooth, but the response time is pretty slow. It takes about 100ms to reach the desired voltage. The second plot shows a faster rise, but the voltage has too much ripple. On thing to note on the plots is my 'on' voltage is not 5V. This will lower the power range you work in. In order to fix this, you can run through a transistor tied to a strong 5V before going into the RC filter. The transistor will invert the signal, so you need to deal with that too. The second plot also shows evidence of the filter further loading down the 5V. Externally change the PWM frequency.I thought one way to fix the problems revealed above would be to use a microcontroller to sense the PWM duty cycle and use it to set the duty cycle of a much faster PWM frequency. It could be done with a PIC chip and very few additional parts. It could easily set the duty cycle within a period or two. The PIC16F88 has a PWM generator an internal oscillator and all the interrupts required. Below is my first crack at such a program. Below it is a simple circuit I may use to test it. It adds optional pot control.
Test Results: Yea! it worked. I used my MikroElektronic EasyPIC4 developement board to test it using a PIC16F877A. I only had a 8MHz crystal, so I scaled the speed down a little. The response was good. It set the PWM within the 2nd-3rd pulse. It does not show up well on my digital scope because the 2 PWM frequencies are so different. The faster frequency looks like a long pulse when looking at the slower one. But, you can see the turn on speed.
Change a step pulse rate to PWMMach3 can do step and direction pulses for the spindle just like it does the axis motors. You could set the PWM duty proportional to the step rate. It would be the same hardware setup as above. |