Re: getting the 57cnc to work with G540

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

Re: getting the 57cnc to work with G540

Post by DanL »

So i did do the changes the pwm 

also the pwm just stays at 5.02 vdc, with the spindle on or off, on oc1. I have read through all post's looking for where to set the pwm. I am a bit lost I will play more to see if I can find what to set, but I need help.
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: getting the 57cnc to work with G540

Post by GlennD »

Dan
After looking at the Super PID stuff you are going to need to follow several of the post I was working on.

You need to set up the circuit detailed here
GlennD wrote:
You can read up on the circuit here
That is where I got the schematic from.

You will also need to map the spindle speed to the PWM value not sure if Art has anything in place yet for that.
Click on the quote link for help with that
GlennD wrote:
I have been away for a few weeks trying to catch up now so please forgive me if this is covered some where else.

Glenn

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

Re: getting the 57cnc to work with G540

Post by DanL »

I fixed the PWM being at 5vdc it was the - from OC1 I put it to common and that came good pwm is now working in pokeys.
spindle on/off works.
I will have a look at your stuff again, at a guess I would add it to the library where the spindle control is, or does it need it's own Library. I will just play and see how I get on.
making these mistakes and you boys just pointing and hinting, and Art or anyone giving the idea of how to do it is good
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: getting the 57cnc to work with G540

Post by GlennD »

Can you post a rough sketch of what you did?
I am very interested in that.

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

Re: getting the 57cnc to work with G540

Post by DanL »

I take a pic I have a HD camera
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: getting the 57cnc to work with G540

Post by GlennD »

Thank you sir
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

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
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4593
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: getting the 57cnc to work with G540

Post by ArtF »

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



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

Re: getting the 57cnc to work with G540

Post by DanL »

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.

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

Re: getting the 57cnc to work with G540

Post by ArtF »

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


Last edited by ArtF on Tue Mar 01, 2016 6:04 am, edited 1 time in total.
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

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
Last edited by DanL on Tue Mar 01, 2016 11:19 am, edited 1 time in total.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4593
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: getting the 57cnc to work with G540

Post by ArtF »

Hi Dan:


  Its seeing a syntax error for some reason..

  Did the spindle turn on and off with M3.. as it stands?

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

Re: getting the 57cnc to work with G540

Post by DanL »

yep on and off M3 on M5 off
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4593
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: getting the 57cnc to work with G540

Post by ArtF »

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
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

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

Who is online

Users browsing this forum: No registered users and 13 guests