print where

Discussions and file drops for Auggie
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: print where

Post by DanL »

Yer SpindleSpeed is it, if I have Spindle as the var on a DRO and I type 20000 in it it reports back as,  Spindle calls with current:20000.0000 and updates as you change the number in the scripter.

Spindle = GlobalGet("SpindleSpeed"); this is what I have so far trying to work out what else to have.

If I have SpindleSpeed as the ver in a DRO it updates non stop if I have anything above zero, it changes the pwm as you change the number in the dro but it updates constantly above 0

I have not tried on a live machine yet just in sim
Last edited by DanL on Wed Dec 28, 2016 5:45 pm, edited 1 time in total.
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: print where

Post by DanL »

I have run into I don't know.

What I am not sure about is the naming of a DRO.
With the playing I have done so far is this code  Spindle = GlobalGet("SpindleSpeed");
if I have the ver of the DRO as Spindle changing the value in the dro changes what is printed in the scripter
if i have 20000 in the dro it puts this out, Variable Spindle calls with current:20000.0000. so on changing by what I put into the dro.

I have also tried SpindleSpeed as the ver it puts out pwm2 set to 40 if I have 10000 in the dro but it runs non stop changing

from this
Variable SpindleSpeed calls with current:10000.0000
thread 355 started.
PWM2 set to 40  
thread 355 stopped.

to

Variable SpindleSpeed calls with current:10000.0000
thread 356 started.
PWM2 set to 40  
thread 356 stopped.

with thread number going up by 1 every second

the pwm does change by what I put into the dro 10000 pwm 40, 20000 pwm 80, 25000 pwm 100 what is correct.

[s]What i would like to happen is the dro shows what speed is called by the G code, I realize I need a script to put it into the dro with a ver, I am not sure how to get that info from the G code and have it show in a dro.[/s]

then I want to get that info from the dro.

This goes along with another project I have.

I found this done by Joakim what is I think what i need for the slider in a spindle override panel

//And the script will get called when you slide it..
/*
 Called whenever S parameter is used in GCode.
 Sets laser power DRO to new value 0 - 100%.
*/
global SpindleSpeed = function( speed )
{
 s = speed;
&nbsp;if (s < 0) { s = 0.0; }; &nbsp; &nbsp; // Low limit 0%
&nbsp;if (s > 100) { s = 100.0; }; // High limit 100%
&nbsp;GlobalSet("spindleMaxPower", s);
};


Last edited by DanL on Thu Dec 29, 2016 12:46 pm, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: print where

Post by ArtF »

Dan:

Ill have to reteach myself that tomorrow. Ill let you know how its currently working and what you shoudl change..

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

Re: print where

Post by ArtF »

Hi Dan:

&nbsp; Well, I took a look. Turns out I roughed in a bit on Spindles as I built Auggie. I dont use spindle as I use a slider for my
laser power. However, the code is there to help setup the spindle. Ill add what we may need.

So, the way it works is the GCode library has hooks in it for SetSpindleSpeed and such, and those hooks call whatever global is available.

For example, on a Gcode S word S3000, the Gcode library function SetSpindleSpeed is called with 3000 as the parameter. It then calls
SetSpindleSpeed(3000). That function at present occurs in 3 libraries, The LaserSpindle, FreqSpindle, and RelaySpindle libs. As I only use LaserSpindle, if you look at that library youll see I ignore S calls. Id advise you to turn off laser spindle, turn on SpindleFreq and modify that library.

&nbsp; Now there is an internal global called "SpindleSpeed". If you set a DRO on the screen and name it "SpindleSpeed", youll notice it starts up
with 1000 in its value. In your library SpindleFreq, you can modify the SetSpindleSpeed call to do a
GlobalSet("SpindleSpeed", value); so that the new Gcode word sets the internal variable, and the DRo. You can also put a slider on the screen, name it "SpindleSpeed" as well. That slider will now work just like a Gcode call and vary the speed. If Gcode calls for S to change, both the DRO and the slider will change together. Change one and the others will follow. Use the script to set the PWM as you wish for the various speeds.

&nbsp; There is also an internal variable named "SpindleOn" that you shoudl set if you wish in the M3/M5 calls. A LED dropped on the screen will then show its condition.

&nbsp; Thats how its all supposed to work.

Art
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: print where

Post by DanL »

I am useing the spindle Relay library, Its what you told me to use, with the superpid controlling the spindle it's pwm.

I Have this on a DRO on screen and it works (turns out watching your vids help)

global SpindleSpeed = function( speed )
&nbsp; {
&nbsp; &nbsp; mydro=DRO("Main_DRO_20");
&nbsp; &nbsp; mydro.SetValue(speed);

&nbsp; &nbsp; myval = mydro.GetValue();
&nbsp; &nbsp; print(myval);
&nbsp; &nbsp; GlobalSet("Main_DRO_20",speed );
};

It's just so I can see what the G code spindle speed is so I can compare it too what the superpid shows, it's out by a few 00 RPM. I have it print as well

I changed the feed override panel to a spindle override panel, I used SpindleSpeed as the ver. in both dro's and the slider and it works sort off with the latest version, the last version it would not work at all.
This is where the problems came in I thought it was me doing something wrong, it sort of is.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: print where

Post by ArtF »

Dan:

That looks good. Id recommend you rename the DRO to a var name of "SpindleSpeed" , that way it wil match with
the internal variable for the spindle. then use

global SpindleSpeed = function( speed )
{&nbsp; &nbsp;
&nbsp; &nbsp; print(myval);
&nbsp; &nbsp; GlobalSet("SpindleSpeed",speed );
};

&nbsp; Its not a necessary change, but it allows the internals to stay synced. Youd have to change any references you use
to SpindleSpeed as well.

&nbsp; What you have is correct now, and is exactly what one shoudl do if they wish to add a
variable to the system that isnt there, but when one exists, liek SpindleSpeed, it may be best to
use it.
&nbsp; So to override your spindle speed, youd only have to drop a slider on the screen with its var name
as "SpindleSpeed" as well. If you set the slider min/max to your desired spindle min/max you can slide the slider
and the SpindleSpeed DRO will track as will the internal SpindleSpeed.

None of that needs to be done, I just point out that it "could" be done. Naming a button, dro, slider etc..
to a global variable name makes them all track together automatically. You can also add a script of that name
to have that script called when any of them change.. though it isnt necessary either. Im just pointing out
how these things can interact if you wish them too. The interface system is pretty flexible that way.. theres
usually more than one way to get or set what youd like to.

Art
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: print where

Post by DanL »

I change everything back to SpindleSpeed, It sort of worked but I have corrupted auggie again, (I have to do a delete all and a reinstall again I am getting good at killing Auggie)
It shows up in the scripter that it is working you see the change but it's out by 0000 it could well be the corruption that's doing it if i type in 10000 it shows as 1 not 10000.
It was correct when I was just useing a DRO on screen.

I will have a crank soon
Post Reply

Who is online

Users browsing this forum: No registered users and 99 guests