print where

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: print where

Re: print where

by DanL » Fri Dec 30, 2016 11:35 pm

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

Re: print where

by ArtF » Fri Dec 30, 2016 12:54 pm

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 )
{   
    print(myval);
    GlobalSet("SpindleSpeed",speed );
};

  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.

  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.
  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

Re: print where

by DanL » Fri Dec 30, 2016 5:28 am

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 )
  {
    mydro=DRO("Main_DRO_20");
    mydro.SetValue(speed);

    myval = mydro.GetValue();
    print(myval);
    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.

Re: print where

by ArtF » Fri Dec 30, 2016 2:27 am

Hi Dan:

  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.

  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.

  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.

  Thats how its all supposed to work.

Art

Re: print where

by ArtF » Fri Dec 30, 2016 2:03 am

Dan:

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

Art

Re: print where

by DanL » Thu Dec 29, 2016 10:30 pm

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


Re: print where

by DanL » Thu Dec 29, 2016 3:59 am

Yer SpindleSpeed is it, if I have Spindle as the var on a DRO and I type 20000 in it it reports back as, &nbsp;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

Re: print where

by ArtF » Thu Dec 29, 2016 1:18 am

Dan:

Strange, it seems to work here, though my G28 macro only reports the x,y,z coords requested.

It wouldnt need the g command. just G28X5 for example...

Havent done much with spindle speed yet, so yes, I guess just a DRO is all thats needed.. though
I think there is already a global spindlespeed value.. Ill see if I can find it.

Art

Re: print where

by DanL » Wed Dec 28, 2016 11:27 pm

I tried G28 in the MDI and Gcode both did not work.

G28 G00 Z0
G28 G0 Z0
G28 Z0

did not try G1.

I am working on doing a spindle override panel, editing the feed override panel

To start with I have put a dro on screen and used SpindleSpeed as the ver it does not show the spindle speed All it does is change the spindle speed. so it's the wrong ver to use.

Should I make a Ver up that gets the Spindle Speed then prints to A dro at this stage just the Spindle speed from the Gcode is fine.
I will try this any way.
I can do a input for the spindle speed at some stage from the superpid.

Re: print where

by ArtF » Wed Dec 28, 2016 1:14 pm

Hi Dan:

&nbsp; Ive found a couple more issues, Ill update soon. M1 only works after the m6, but is broken on its own, Ive fixed
that and am now looking at a couple more issues. Ill check the G28 as well, it works in mdi, just not in Gcode for some reason..

Art

Top