Re: getting the 57cnc to work with G540
-
GlennD
- Site Admin
- Posts: 80
- Joined: Wed Oct 19, 2011 3:19 am
Re: getting the 57cnc to work with G540
Thank you sir
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: getting the 57cnc to work with G540
GlennD I just looked at your pick for the circuit, because of the type of dyslexia, it means nothing to me. I get the idea tho I will draw it in fritzing what will give me the the pick
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: getting the 57cnc to work with G540
Hi Dan:
Youve lost me a bit.
OK, we have two issues, 1) PWM control, and 2) RUN control..
1) To get PWM to run, we need to use a PWM signal the SuperPID can use. In this case your using Pin20, correct? SO does this work
in Pokeys? Auggie? Both?
2) Ive read up on the SuperPID, if you intend to use OC1+ to your SuperPID RUN line, and hook OC1- to the superPID
ground, the on/off should work. Does this work OK for you in Auggie, or just in Pokeys? or Both?
If Im understanding you, one of thses is working in both? Let us know, lets fix it one signal at a time, so we know that signal works, then
we'll finish the second. Your really close I think..
Art
Youve lost me a bit.
OK, we have two issues, 1) PWM control, and 2) RUN control..
1) To get PWM to run, we need to use a PWM signal the SuperPID can use. In this case your using Pin20, correct? SO does this work
in Pokeys? Auggie? Both?
2) Ive read up on the SuperPID, if you intend to use OC1+ to your SuperPID RUN line, and hook OC1- to the superPID
ground, the on/off should work. Does this work OK for you in Auggie, or just in Pokeys? or Both?
If Im understanding you, one of thses is working in both? Let us know, lets fix it one signal at a time, so we know that signal works, then
we'll finish the second. Your really close I think..
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: getting the 57cnc to work with G540
hi art
(1) I have oc1+ to run and oc1 - to ground next to the run pin it would turn the superpid on at full nacker 30,000rpm. and at the same time the pwm 2 pin 20 would be at 5vdc at the superpid.
(2) I left oc1+ in run and put oc1- to my common ground then ran a wire from common ground to the ground pin beside the run pin, with it like this it will turn off and on and the pwm pin is low .02 vdc so it runs at 5000 rpm.
I can't turn it off or on with pokey's can't work out what pin OC1 is.
when it is set up as 1 I can not change the pwm in pokeys.
when it is set up as 2 I can change the pwm in pokeys it goes from 5000 rpm to 17000 rpm 0 to 3.3 vdc.
so it's sort off working. as a test I left the pokeys open started Auggie turned the spindle on and tried to change the speed on PWM 2 pin 20 it did it for a second then when back to 5000 rpm and I had to reset everything bad idea.
I played around with the code GlennD did one of them was working sort off. I will have to go to that computer and finish the reply from there.
(1) I have oc1+ to run and oc1 - to ground next to the run pin it would turn the superpid on at full nacker 30,000rpm. and at the same time the pwm 2 pin 20 would be at 5vdc at the superpid.
(2) I left oc1+ in run and put oc1- to my common ground then ran a wire from common ground to the ground pin beside the run pin, with it like this it will turn off and on and the pwm pin is low .02 vdc so it runs at 5000 rpm.
I can't turn it off or on with pokey's can't work out what pin OC1 is.
when it is set up as 1 I can not change the pwm in pokeys.
when it is set up as 2 I can change the pwm in pokeys it goes from 5000 rpm to 17000 rpm 0 to 3.3 vdc.
so it's sort off working. as a test I left the pokeys open started Auggie turned the spindle on and tried to change the speed on PWM 2 pin 20 it did it for a second then when back to 5000 rpm and I had to reset everything bad idea.
I played around with the code GlennD did one of them was working sort off. I will have to go to that computer and finish the reply from there.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: getting the 57cnc to work with G540
>>(2) I left oc1+ in run and put oc1- to my common ground then ran a wire from common ground to the ground pin beside the run pin, with it like this it will turn off and on and the pwm pin is low .02 vdc so it runs at 5000 rpm.
This IS the correct way. In order for the pokeys signals to make sense to any device, they must share a reference, in this case..ground. SO keep
it this way.
>>I can't turn it off or on with pokey's can't work out what pin OC1 is.
Its a pin belonging to the Pulse engine, youll find them on the right side of the pulse engine screen in Pokeys.
>>when it is set up as 2 I can change the pwm in pokeys it goes from 5000 rpm to 17000 rpm 0 to 3.3 vdc.
OK, so the pokeys changes the speed, and I suspect also turns it on and off when you use the engine screen.
>>so it's sort off working. as a test I left the pokeys open started Auggie turned the spindle on and tried to change the speed on PWM 2 pin 20 it did it for a second then when back to 5000 rpm and I had to reset everythin g bad idea.
lol, yeah, never do that. Run Auggie OR pokeys, never both..
All we need to do is get your PWM working, thats all. I dont have it attached to spindle speed yet I dont think.. BUT..lets try
doing it in Script. Execute an M3 and it should turn on... since OC1 is working, so lets try in the scripter to make the pwm change..
in the scripter or ScriptMDI, enter
m = Motion();
m.SetPWMDuty( 2, 50 );
Run that and see if speed is now 50%.. Try m.SetPWMDuty(2, 10); and see if its now 10%..
Let me know what it does..
Art
This IS the correct way. In order for the pokeys signals to make sense to any device, they must share a reference, in this case..ground. SO keep
it this way.
>>I can't turn it off or on with pokey's can't work out what pin OC1 is.
Its a pin belonging to the Pulse engine, youll find them on the right side of the pulse engine screen in Pokeys.
>>when it is set up as 2 I can change the pwm in pokeys it goes from 5000 rpm to 17000 rpm 0 to 3.3 vdc.
OK, so the pokeys changes the speed, and I suspect also turns it on and off when you use the engine screen.
>>so it's sort off working. as a test I left the pokeys open started Auggie turned the spindle on and tried to change the speed on PWM 2 pin 20 it did it for a second then when back to 5000 rpm and I had to reset everythin g bad idea.
lol, yeah, never do that. Run Auggie OR pokeys, never both..
All we need to do is get your PWM working, thats all. I dont have it attached to spindle speed yet I dont think.. BUT..lets try
doing it in Script. Execute an M3 and it should turn on... since OC1 is working, so lets try in the scripter to make the pwm change..
in the scripter or ScriptMDI, enter
m = Motion();
m.SetPWMDuty( 2, 50 );
Run that and see if speed is now 50%.. Try m.SetPWMDuty(2, 10); and see if its now 10%..
Let me know what it does..
Art
Last edited by ArtF on Tue Mar 01, 2016 5:04 pm, edited 1 time in total.
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: getting the 57cnc to work with G540
that don't work Art
I tried as well
m = Motion();
m.SetPWMDuty_1( 2, 50 );
log
13:21:116 --System -- System about to run.
13:21:116 Execution Phase begins...
13:21:116 MDI fold attempts execute
13:21:128 Setting Spindle with 1
13:21:129 Relay Spindle was turned on with OC#1
13:21:129 Script SetSpindleState Called
13:21:129 Script complete,end wait on thread.
13:22:927 Setting Fold: -3
13:26:425 --System -- System about to run.
13:26:425 Execution Phase begins...
13:26:425 MDI Script attempts execute
13:26:425 Script MDI execution begins.
13:26:461 Script OnRun Called
13:26:461 attempt to call non function type
13:26:461
unknown(0) :
13:26:461
callstack..
13:26:461 (0): __unknown
13:26:461
13:26:461 Script complete,end wait on thread.
13:26:461 End of MDI Script run.
13:29:210 Setting Fold: -1
13:31:144 --System -- System about to run.
13:31:144 Execution Phase begins...
13:31:144 MDI fold attempts execute
13:31:173 Setting Spindle with 0
13:31:173 Relay Spindle was turned off
13:31:174 using OC #1
13:31:191 Script SetSpindleState Called
13:31:191 Script complete,end wait on thread.
13:46:970 Show log initiated
I tried as well
m = Motion();
m.SetPWMDuty_1( 2, 50 );
log
13:21:116 --System -- System about to run.
13:21:116 Execution Phase begins...
13:21:116 MDI fold attempts execute
13:21:128 Setting Spindle with 1
13:21:129 Relay Spindle was turned on with OC#1
13:21:129 Script SetSpindleState Called
13:21:129 Script complete,end wait on thread.
13:22:927 Setting Fold: -3
13:26:425 --System -- System about to run.
13:26:425 Execution Phase begins...
13:26:425 MDI Script attempts execute
13:26:425 Script MDI execution begins.
13:26:461 Script OnRun Called
13:26:461 attempt to call non function type
13:26:461
unknown(0) :
13:26:461
callstack..
13:26:461 (0): __unknown
13:26:461
13:26:461 Script complete,end wait on thread.
13:26:461 End of MDI Script run.
13:29:210 Setting Fold: -1
13:31:144 --System -- System about to run.
13:31:144 Execution Phase begins...
13:31:144 MDI fold attempts execute
13:31:173 Setting Spindle with 0
13:31:173 Relay Spindle was turned off
13:31:174 using OC #1
13:31:191 Script SetSpindleState Called
13:31:191 Script complete,end wait on thread.
13:46:970 Show log initiated
Last edited by DanL on Tue Mar 01, 2016 10:19 pm, edited 1 time in total.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: getting the 57cnc to work with G540
Hi Dan:
Its seeing a syntax error for some reason..
Did the spindle turn on and off with M3.. as it stands?
Art
Its seeing a syntax error for some reason..
Did the spindle turn on and off with M3.. as it stands?
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: getting the 57cnc to work with G540
yep on and off M3 on M5 off
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: getting the 57cnc to work with G540
Dan:
Good, so all we need worry about then is that pin 20. Ill post a library script tomorrow after I test one
to make sure it works here. We'll track it down and get your power working shortly..
Thx
Art
Good, so all we need worry about then is that pin 20. Ill post a library script tomorrow after I test one
to make sure it works here. We'll track it down and get your power working shortly..
Thx
Art
-
DanL
- Site Admin
- Posts: 357
- Joined: Thu Sep 11, 2014 12:35 am
Re: getting the 57cnc to work with G540
cool thanks art I have tried using glens code
this one fails
SetPWMDuty_1(2,map(GlobalGet("SpindleSpeed"),8000,18000,0.1,100));
this one does not fail it does something I will fire the machine up and run it again
SSpeed=GlobalGet("SpindleSpeed");
if (SSpeed>= 8000){SetPWMDuty_1(2,map(SSpeed,8000,18000,0.1,100));};
and a few other combo's from examples.
this one fails
SetPWMDuty_1(2,map(GlobalGet("SpindleSpeed"),8000,18000,0.1,100));
this one does not fail it does something I will fire the machine up and run it again
SSpeed=GlobalGet("SpindleSpeed");
if (SSpeed>= 8000){SetPWMDuty_1(2,map(SSpeed,8000,18000,0.1,100));};
and a few other combo's from examples.