Shared PWM Functions()
Posted: Fri Jan 15, 2016 5:12 pm
Got the PWM pin Gcode script working for laser power.
I used G110 Pvalue. code will look like G110 P50 for 50% power.
I will probably back the percentage down to allow for a max of 85%.
Hardest part was getting the pin number. I apparently wanted badly to use 20 as the pin number. To bad the Pokeys value was staring me in the face the whole time. :P
Placed this in the Gcode Script.
I am using a couple of MPS2222A NPN transistor to get the volts from 3.3v at 100% to 5v at 100%
Circuit attached that I followed. All of this is not in a running machine yet but works on the bench.
Glenn
Edit: The setting show on the PWM page in Pokeys gave a 2.55 volt reading at 50% and appears to be very linear.
I used G110 Pvalue. code will look like G110 P50 for 50% power.
I will probably back the percentage down to allow for a max of 85%.
Hardest part was getting the pin number. I apparently wanted badly to use 20 as the pin number. To bad the Pokeys value was staring me in the face the whole time. :P
Placed this in the Gcode Script.
Code: Select all
//Set PWM Pin2 to percentage of output
//P value of 0=0volts or 100=5volts
global GCode110 = function()
{
PK = Motion();
PK.SetPWM(2,ParmsPRI[0]);
};
Circuit attached that I followed. All of this is not in a running machine yet but works on the bench.
Glenn
Edit: The setting show on the PWM page in Pokeys gave a 2.55 volt reading at 50% and appears to be very linear.