Re: getting the 57cnc to work with G540
Re: getting the 57cnc to work with G540
yer I worked out it just needs mapped to the correct command in M3, since I know it work's I will start playing with coding. pin 45 has digital input or output or analogue, the analogue does not light up it stays grayed out.
to Get the speed changing in M3 I just need to find the correct thing to map it to. this can be done another day.
what I have found so far with the 57CNC none of the outputs can be used with a G540, other than spindle pin 14, pin 20 on the 57CNC.
the inputs work with M3 not Auggie another day thing to sort.
it's all working other than the spindle so that's what I will work on and test the Ethernet.
to Get the speed changing in M3 I just need to find the correct thing to map it to. this can be done another day.
what I have found so far with the 57CNC none of the outputs can be used with a G540, other than spindle pin 14, pin 20 on the 57CNC.
the inputs work with M3 not Auggie another day thing to sort.
it's all working other than the spindle so that's what I will work on and test the Ethernet.
Re: getting the 57cnc to work with G540
Hi art quick note the machine is working fine connected to the Ethernet, I tried the delay set to 1 and 0 and both where fine
Re: getting the 57cnc to work with G540
Thx Dan.
Art
Art
Re: getting the 57cnc to work with G540
well I have found more problems fired the machine up today to set up the spindle it was a no go.
I had the Ethernet cable connected like I had last week when I was trying to get the spindle working it was.
now today the spindle would not start in pokeys at all, plunged the USB in as well as the Ethernet cable still no good, unplugged the Ethernet cable and in pokeys I can start the spindle and change speeds.
the PWM was working in all set up's no problem's there pin 20.
the on/off pin 45 with the Ethernet plugged in was ever 5.20 vdc off or it was 3.83 vdc on, inverting the pin no change.
on USB pin 45 5.2 vdc off, 2.86 VDC or 2.87m on, inverting the pin no change.
I added the code you suggested back on Page 1 for the spindle it was not working. can you post what I should have in the main script just in case it has change from what you first said, I also when't by the example in the library they both compiled.
I then tried to run some G code (road runner and AASubroutineTest) , nup no again I have all liburys on other than laser and rely. tried with all on as well.
the error that is coming up is failed to find spindle on or failed to find spindle off, with all on it was coming up with spindle signal not found using spindle relay.
with 1mmspiral it will run and move the axis's.
jogging works, homing works. just no spindle so far
or should I be doing what you put in Adding a spindle to auggie
I had the Ethernet cable connected like I had last week when I was trying to get the spindle working it was.
now today the spindle would not start in pokeys at all, plunged the USB in as well as the Ethernet cable still no good, unplugged the Ethernet cable and in pokeys I can start the spindle and change speeds.
the PWM was working in all set up's no problem's there pin 20.
the on/off pin 45 with the Ethernet plugged in was ever 5.20 vdc off or it was 3.83 vdc on, inverting the pin no change.
on USB pin 45 5.2 vdc off, 2.86 VDC or 2.87m on, inverting the pin no change.
I added the code you suggested back on Page 1 for the spindle it was not working. can you post what I should have in the main script just in case it has change from what you first said, I also when't by the example in the library they both compiled.
I then tried to run some G code (road runner and AASubroutineTest) , nup no again I have all liburys on other than laser and rely. tried with all on as well.
the error that is coming up is failed to find spindle on or failed to find spindle off, with all on it was coming up with spindle signal not found using spindle relay.
with 1mmspiral it will run and move the axis's.
jogging works, homing works. just no spindle so far
or should I be doing what you put in Adding a spindle to auggie
Last edited by DanL on Wed Feb 24, 2016 5:34 pm, edited 1 time in total.
Re: getting the 57cnc to work with G540
Hi Dan:
Its as if the power supply your feeding ht epokeys with cant handle the current of turn on/off ( it should be able to pull the
5volts to 0, not just down to 2.5. Is your power supply for the polkeys more than 1Amp capable?
OK,in Auggie:
Auggie will fail to tun any program with an M3 if the spindle isnt setup script wise. You need only two libraries on really..
The Gcode library , and a spindle library. Firs, enable the Gcode library, and the Spindle-Relay library. No other spindle
lib, only one must be enabled.
Now, go to the config menu up top, and check the "Debug Log", this enables more messages..
Now, in the Single Line MDi, enter M3, set your line to that and hit run. You should see the following message in the log
" Setting Spindle with 1 " , if so , the Gcode library is on.
You should then see "Relay Spindle was turned on with OC1" , which is how the relay spindle
is set up. It uses OC1 to turn on or off the spindle. Check first that you get those messages.
Next, for your SuperPID on pin 45, youll change the scripts as below, but not till you verify
the messages above..
global SpindleOn = function()
{
//SpindleDevice.SetOC( MySpindleOutput, 1); //turn on spindle
//you want pin 45 to be digital on or off, sounds like 0 is on, so..
Motion.SetPinDig(45,0);
print("Relay Spindle was turned on with pin 45 = 0");
};
//this is a relay spindle control,
//it will use only the OC output #1
//to control a relay to turn a simple
//on/off spindle, on or off.
global SpindleOff = function()
{
//SpindleDevice.SetOC( MySpindleOutput, 0); //turn on spindle
Motion.SetPinDig(45,1);
print("Relay Spindle was turned off");
print("using pin45 ");
};
Speed is just as easy, but lets see how you make out with off or on.
The fact your on pin only goes to 2.5 volts or 3.5 from 5, may mean you need a pulldown
resistor in that circuit. Ill release a new version shortly to ensure all your script bugs are gone,
but this proceedure will work if the messages are in your log as above. All we need to know is that
the proper libraries are being called. The log tells you that from the print statements in the scripts.
Let me know how far its getting..
Using M3 and M5 in the single MDI is a good fast way to test, no need to run files till
you know its working..
Art
Art
Its as if the power supply your feeding ht epokeys with cant handle the current of turn on/off ( it should be able to pull the
5volts to 0, not just down to 2.5. Is your power supply for the polkeys more than 1Amp capable?
OK,in Auggie:
Auggie will fail to tun any program with an M3 if the spindle isnt setup script wise. You need only two libraries on really..
The Gcode library , and a spindle library. Firs, enable the Gcode library, and the Spindle-Relay library. No other spindle
lib, only one must be enabled.
Now, go to the config menu up top, and check the "Debug Log", this enables more messages..
Now, in the Single Line MDi, enter M3, set your line to that and hit run. You should see the following message in the log
" Setting Spindle with 1 " , if so , the Gcode library is on.
You should then see "Relay Spindle was turned on with OC1" , which is how the relay spindle
is set up. It uses OC1 to turn on or off the spindle. Check first that you get those messages.
Next, for your SuperPID on pin 45, youll change the scripts as below, but not till you verify
the messages above..
global SpindleOn = function()
{
//SpindleDevice.SetOC( MySpindleOutput, 1); //turn on spindle
//you want pin 45 to be digital on or off, sounds like 0 is on, so..
Motion.SetPinDig(45,0);
print("Relay Spindle was turned on with pin 45 = 0");
};
//this is a relay spindle control,
//it will use only the OC output #1
//to control a relay to turn a simple
//on/off spindle, on or off.
global SpindleOff = function()
{
//SpindleDevice.SetOC( MySpindleOutput, 0); //turn on spindle
Motion.SetPinDig(45,1);
print("Relay Spindle was turned off");
print("using pin45 ");
};
Speed is just as easy, but lets see how you make out with off or on.
The fact your on pin only goes to 2.5 volts or 3.5 from 5, may mean you need a pulldown
resistor in that circuit. Ill release a new version shortly to ensure all your script bugs are gone,
but this proceedure will work if the messages are in your log as above. All we need to know is that
the proper libraries are being called. The log tells you that from the print statements in the scripts.
Let me know how far its getting..
Using M3 and M5 in the single MDI is a good fast way to test, no need to run files till
you know its working..
Art
Art
Re: getting the 57cnc to work with G540
cool thank's art I was playing with different code combo's last night, when you cut and past it make's a mess of the pasted code it needs a fix or re written.
the spindle not working with the Ethernet is a pokeys problem, if it don't work in pokeys it wont work in Auggie.
I was going to ask about the relay as on off as it works with your laser panel.
I am still have fun with it, it's a good new challenge for me to learn coding in monkey.
for the PWM will it be like what glen did.
the spindle not working with the Ethernet is a pokeys problem, if it don't work in pokeys it wont work in Auggie.
I was going to ask about the relay as on off as it works with your laser panel.
I am still have fun with it, it's a good new challenge for me to learn coding in monkey.
for the PWM will it be like what glen did.
Re: getting the 57cnc to work with G540
this does come up
Setting Spindle with 1
Relay Spindle was turned on with OC1
in pokeys I am getting 5.23 off 0 on. PWM is working, inverting pin 45 does nothing.
In Auggie it just stays at 3.23 no change what ever I do. M3 or M5 the wiring is good
one thing is IO online under config meant to be ticked or not, if I tick it then look again it's un ticked
Setting Spindle with 1
Relay Spindle was turned on with OC1
in pokeys I am getting 5.23 off 0 on. PWM is working, inverting pin 45 does nothing.
In Auggie it just stays at 3.23 no change what ever I do. M3 or M5 the wiring is good
one thing is IO online under config meant to be ticked or not, if I tick it then look again it's un ticked
Re: getting the 57cnc to work with G540
Dan:
SO the scripts are getting called, and the OC1 relay is begin commanded. ( OC1 turns on my laser supply..)
You need to change that script to set pin 45 to on or off.. You need to put a
SpindleDevice.SetPinDig( 45, 1);
Where I put the line
SpindleDevice.SetOC( MySpindleOutput, 1); //turn on spindle
and you need to put
SpindleDevice.SetPinDig( 45, 0);
Where I put the line
SpindleDevice.SetOC( MySpindleOutput, 0); //turn on spindle
That way, instead of the OC1 relay toggling as in my system, your pin 45 will toggle ..
Art
SO the scripts are getting called, and the OC1 relay is begin commanded. ( OC1 turns on my laser supply..)
You need to change that script to set pin 45 to on or off.. You need to put a
SpindleDevice.SetPinDig( 45, 1);
Where I put the line
SpindleDevice.SetOC( MySpindleOutput, 1); //turn on spindle
and you need to put
SpindleDevice.SetPinDig( 45, 0);
Where I put the line
SpindleDevice.SetOC( MySpindleOutput, 0); //turn on spindle
That way, instead of the OC1 relay toggling as in my system, your pin 45 will toggle ..
Art
Re: getting the 57cnc to work with G540
that makes senses fuck I am a noob ;D ;D ;D
Re: getting the 57cnc to work with G540
did the change I have this
global SpindleOn = function()
{
SpindleDevice.SetPinDig( 45, 1); //turn on spindle
//you want pin 45 to be digital on or off, sounds like 0 is on, so..
Motion.SetPinDig(45,1);
print("Spindle was turned on with pin 45 = 1");
};
global SpindleOff = function()
{
SpindleDevice.SetPinDig( 45, 0); //turn on spindle
Motion.SetPinDig(45,0);
print("Spindle was turned off");
print("using pin45 ");
};
it still fall's pin45 does not switch in Auggie.
the OI is still not turning on could that be it
I changed the 1 and 0 around
global SpindleOn = function()
{
SpindleDevice.SetPinDig( 45, 1); //turn on spindle
//you want pin 45 to be digital on or off, sounds like 0 is on, so..
Motion.SetPinDig(45,1);
print("Spindle was turned on with pin 45 = 1");
};
global SpindleOff = function()
{
SpindleDevice.SetPinDig( 45, 0); //turn on spindle
Motion.SetPinDig(45,0);
print("Spindle was turned off");
print("using pin45 ");
};
it still fall's pin45 does not switch in Auggie.
the OI is still not turning on could that be it
I changed the 1 and 0 around
Re: getting the 57cnc to work with G540
I have been playing some more went back to OC1 it is working power 0 or -5 don't know why -.
could I use OC1 for spindle on off
could I use OC1 for spindle on off
Re: getting the 57cnc to work with G540
Dan:
Yes, you can use the relay output, just ground one side of the relay, and hook the other side of the relay to your SuperPID on signal
currently on pin 45.. but see the end of this to see how to use the relay..or the OC1..
Note:
SpindleDevice.SetPinDig( 45, 1); //turn on spindle
//you want pin 45 to be digital on or off, sounds like 0 is on, so..
Motion.SetPinDig(45,1);
You dont need both here. In fact , I probably misled you, in that same library the following line is at the top..
global SpindleDevice = Motion();
This means "SpindleDevice" is a variable of Type Motion. ( The motion pokeys );
When you put
Motion.SetPinDig(45,1); , this probably triggers an error. "Motion" is a type of variable
, in this case a Pokeys, but you cant use the word "Motion" in the command, you need to use the
variable representing "Motion", so you use the variable as above, "SpindleDevice"
Consider it this way, lets say I have in the program a variable TYPE called Car.
you could use a line similar to the spindle line above such as
MyCar = Car();
it then is OK to use
MyCar.RollDownWindow();
or MyCar.EmptyAshtray()...
but not Car.EmptyAshtray().
To use "Car", you must "instantiate" a variable of type "Car". ex: MyCar = Car(); or Arnold = Car(), or
ThisisavariableoftypeCar = Car();
So , I probably have been misleading you as I tend to use Types as
illustrations. Ill talk about Motion.SetPinDig( pin, value) as a command
where in reality, it would be "Motionvariable".SetPinDig(pin,value);
so , as above in the file I have a global declared..
global SpindleDevice = Motion();
This means any call that derives from "Motion", you call with SpindleDevice, but you cant use the word
Motion, its reserved as a type.
So if you look in your global list in the scripter, youll see terms like
Motion.GetEncoder or Motion.SetPinDig , this all means calls to
SpindleDevice.GetEncoder or SpindleDevice.SetPinDig are legal calls, but
not the actual Motion.SetPinDig..
The globals list is a list of Types generally, that you can make variables from,
and then call their routines. It shows all the routines a variable type may have.
Check the list , notice things like file.ReadChar and file.Open, there is a long list
of such variables, they are all types. So the globals list is showing types, and type calls.
So in that example, one coudl use
MyFile = file();
MyFile.Open("myfile");
MyFile.ReadChar() ...
(Dont try using File till I show examples, but my point here is to show how you use
the knowledge of a "Type" to create variables and use them. Long point I know,
but remove the Motion.SetPinDlg, and just change my Spindle calls to Pin45. They should work..
but its possible the pokeys doesnt have the current sink to pull the super PID to 0 to turn it on,
so feel free to use the relay call as I do.
Question me on this if it isnt clear, reread it a few times if not as well, as
if you understand this topic, you ocan write near anything, but one has
to understand the Types and how you make variables form those Types..
kk, now we can talk about OC1 and the relays..
GlobalSet( "ExtRelay1" , 1); will turn on the relay on the 57cnc,
GlobalSet( "ExtRelay1" , 0); will turn it off.
These calls use the globals system to do control. Some controls on the pokeys
are important enough to have variables of their own. Relays are such.. So try the above
commands one at a time in your scripter, youll hear the relay toggle on or off. (Makes
a loud click..).
Youll notice I have a "Laser Power" button which turns relay#1 on or off as well, it
does this by setting the global "ExtRelay1" to a 1 or a zero. This is done just by placing a button
and call it it variable name ExtRelay1. When you press the button is sets ExtRelay1 to "1" or"0",
thus doing the same as scripting a call to GlobalSet( "ExtRelay1" , 1);
So if you want to use the relay, just replace
SpindleDevice.SetPinDig( 45, 1); //turn on spindle
with
GlobalSet( "ExtRelay1" , 1); //turn on YOUR spindle
and in the off script, call
GlobalSet( "ExtRelay1" , 0);
The other posability are the OC's, these are OpenCollector outputs, they can ground any signal,
and accept much higher current and voltages than any other.. so a call to
SpindleDevice.SetOC( 1, 1); //turn on OC1 or
SpindleDevice.SetOC( 1, 0); //turn off OC1 woudl also control your spindle power,
just by hooking your pin45 on/off wire to OC1 instead, it will then ground or open
that line to control the superPID's power..
So as you can see, there are multiple paths to control anything in Auggie, just
a matter of understanding those paths, and picking the one that works for you.
(Id use the relay, hearing it click is a good diagnostic, but the OC is easier and it requires
only one wire, it will ground whatever is attached to it to turn it on..
Your getting there.. :)
Art
Yes, you can use the relay output, just ground one side of the relay, and hook the other side of the relay to your SuperPID on signal
currently on pin 45.. but see the end of this to see how to use the relay..or the OC1..
Note:
SpindleDevice.SetPinDig( 45, 1); //turn on spindle
//you want pin 45 to be digital on or off, sounds like 0 is on, so..
Motion.SetPinDig(45,1);
You dont need both here. In fact , I probably misled you, in that same library the following line is at the top..
global SpindleDevice = Motion();
This means "SpindleDevice" is a variable of Type Motion. ( The motion pokeys );
When you put
Motion.SetPinDig(45,1); , this probably triggers an error. "Motion" is a type of variable
, in this case a Pokeys, but you cant use the word "Motion" in the command, you need to use the
variable representing "Motion", so you use the variable as above, "SpindleDevice"
Consider it this way, lets say I have in the program a variable TYPE called Car.
you could use a line similar to the spindle line above such as
MyCar = Car();
it then is OK to use
MyCar.RollDownWindow();
or MyCar.EmptyAshtray()...
but not Car.EmptyAshtray().
To use "Car", you must "instantiate" a variable of type "Car". ex: MyCar = Car(); or Arnold = Car(), or
ThisisavariableoftypeCar = Car();
So , I probably have been misleading you as I tend to use Types as
illustrations. Ill talk about Motion.SetPinDig( pin, value) as a command
where in reality, it would be "Motionvariable".SetPinDig(pin,value);
so , as above in the file I have a global declared..
global SpindleDevice = Motion();
This means any call that derives from "Motion", you call with SpindleDevice, but you cant use the word
Motion, its reserved as a type.
So if you look in your global list in the scripter, youll see terms like
Motion.GetEncoder or Motion.SetPinDig , this all means calls to
SpindleDevice.GetEncoder or SpindleDevice.SetPinDig are legal calls, but
not the actual Motion.SetPinDig..
The globals list is a list of Types generally, that you can make variables from,
and then call their routines. It shows all the routines a variable type may have.
Check the list , notice things like file.ReadChar and file.Open, there is a long list
of such variables, they are all types. So the globals list is showing types, and type calls.
So in that example, one coudl use
MyFile = file();
MyFile.Open("myfile");
MyFile.ReadChar() ...
(Dont try using File till I show examples, but my point here is to show how you use
the knowledge of a "Type" to create variables and use them. Long point I know,
but remove the Motion.SetPinDlg, and just change my Spindle calls to Pin45. They should work..
but its possible the pokeys doesnt have the current sink to pull the super PID to 0 to turn it on,
so feel free to use the relay call as I do.
Question me on this if it isnt clear, reread it a few times if not as well, as
if you understand this topic, you ocan write near anything, but one has
to understand the Types and how you make variables form those Types..
kk, now we can talk about OC1 and the relays..
GlobalSet( "ExtRelay1" , 1); will turn on the relay on the 57cnc,
GlobalSet( "ExtRelay1" , 0); will turn it off.
These calls use the globals system to do control. Some controls on the pokeys
are important enough to have variables of their own. Relays are such.. So try the above
commands one at a time in your scripter, youll hear the relay toggle on or off. (Makes
a loud click..).
Youll notice I have a "Laser Power" button which turns relay#1 on or off as well, it
does this by setting the global "ExtRelay1" to a 1 or a zero. This is done just by placing a button
and call it it variable name ExtRelay1. When you press the button is sets ExtRelay1 to "1" or"0",
thus doing the same as scripting a call to GlobalSet( "ExtRelay1" , 1);
So if you want to use the relay, just replace
SpindleDevice.SetPinDig( 45, 1); //turn on spindle
with
GlobalSet( "ExtRelay1" , 1); //turn on YOUR spindle
and in the off script, call
GlobalSet( "ExtRelay1" , 0);
The other posability are the OC's, these are OpenCollector outputs, they can ground any signal,
and accept much higher current and voltages than any other.. so a call to
SpindleDevice.SetOC( 1, 1); //turn on OC1 or
SpindleDevice.SetOC( 1, 0); //turn off OC1 woudl also control your spindle power,
just by hooking your pin45 on/off wire to OC1 instead, it will then ground or open
that line to control the superPID's power..
So as you can see, there are multiple paths to control anything in Auggie, just
a matter of understanding those paths, and picking the one that works for you.
(Id use the relay, hearing it click is a good diagnostic, but the OC is easier and it requires
only one wire, it will ground whatever is attached to it to turn it on..
Your getting there.. :)
Art
Re: getting the 57cnc to work with G540
yes you did confuse me no problem it forced me to think about it more, as there was a differences to what you put here compered to what's in Adding a spindle to Auggie.
Re: getting the 57cnc to work with G540
I am still confused.
if I have spindle lib relay only I don't need any code to turn OC1 on or off but it's 0 vdc off and on -18.3vdc so I think that would be a bad idea.
now is this correct I think I am getting the idea that what is first is the call and what is second is the variable so
global SpindleDevice = Motion(); //SpindleDevices use variable motion
SpindleDevices.SetpinDia(45,1); // turn pin 45 on
but with above I am getting, Setting Spindle with 1, Lookup of SpindleOn failed.
if I have spindle lib relay only I don't need any code to turn OC1 on or off but it's 0 vdc off and on -18.3vdc so I think that would be a bad idea.
now is this correct I think I am getting the idea that what is first is the call and what is second is the variable so
global SpindleDevice = Motion(); //SpindleDevices use variable motion
SpindleDevices.SetpinDia(45,1); // turn pin 45 on
but with above I am getting, Setting Spindle with 1, Lookup of SpindleOn failed.
Re: getting the 57cnc to work with G540
Dan
I think Art already declared a var named SpindleDevice so you are probably ok to use it. without another declare.
In either case.
The second line does have a misspelling SpindleDevices.Set pinDia(45,1);
should be SpindleDevice.Set pinDia(45,1);
Can't tell you how many times I have done something like that usually, swap letters. :)
Glenn
I think Art already declared a var named SpindleDevice so you are probably ok to use it. without another declare.
In either case.
The second line does have a misspelling SpindleDevices.Set pinDia(45,1);
should be SpindleDevice.Set pinDia(45,1);
Can't tell you how many times I have done something like that usually, swap letters. :)
Glenn
Who is online
Users browsing this forum: No registered users and 1 guest