Shared PWM Functions()

Discussions and file drops for Auggie
Post Reply
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Shared PWM Functions()

Post by GlennD »

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.

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]);
 };
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.

Attachments
PWMCircuit.PNG
PWMPokeys.PNG
Last edited by Ya-Nvr-No on Sat Jan 16, 2016 1:45 am, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Shared PWM Functions()

Post by ArtF »

Glenn:


Wow, you guys are getting ahead of me.. .Double wow, the first user script
to control hardware .. with no complex questions ( or any questions ) as to How?
  A conversion circuit as well? Glenn, your flying.. I have deja-vu of Marris
dropping the original charge pump schematic on the yahoo group all those
years back in Mach2 when Charge Pumps started being used.. lol..

  Way to go, thx for the posts..

  Im been renovating in Auggie, many items are fixed, and many more
stabilized. It will be a long road of experimentation Im sure, but Im hoping
we can end up with about 100 users who like to play in hardware/software..
and I think we've started down that road well enough.. :)

  New release with the updates and Feedrate Override and such will be this week.

Art



GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: Shared PWM Functions()

Post by GlennD »

I thank you for your hard work Art.
My part was simple, just used what you did and read.
And tried a bunch of things until it worked.

I was thinking of adding it to the MotionIO script .
A copy of what you did with the OC relays but for the PWM pins.

Code: Select all

//Set PWM for specified Pin,  0 through 4 to percentage of output
//power value of 0=0volts or 100=3.3volts
global SetPWM = function( nPin , power )
{
  Pokeys1.SetPWM( nPin , power);
};
Glenn

User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Shared PWM Functions()

Post by ArtF »

Already Added. :)


I figure any Spindle function could use it, or laser firing.. There will be plenty of options for spindles
as we can put out near any type of signal a motor might need..

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 80 guests