Spindle dwell time

More
17 May 2020 22:26 - 17 May 2020 22:28 #168094 by TKWard10000
Hi,

Newbie here.

Took me several hours to configure the hal to accept commands for the Spindle step, and C6 board logic... which is working fine now.

However, the GUI appears to allow going straight from forward to reverse, and doesn't take account of 'dwell time', i.e. spindle slowdown time before reversing.

I'm using a dreaded DC spindle ...... its connections for spindle control are

FWD
REV
COM

Closing COM to either FWD or REV activates to motor in the appropriate direction with M3 or M4, and shuts off with M5

The COM is fed to the ON-OFF Relay, and then onward to the common of FWD/REV relay .... the NO and NC contacts to the appropriate terminals on the drive.

BUT... I need a hal command that introduces a fixed delay ( say 5 seconds) to account for spindle slowdown, so that FWD/REV cant be switched if the motor is still running. Reason being it that it will 'smoke' the board with the back emf of a motor spinning in reverse etc.

Can anyone point me in the right direction please ?

Thanks
Keith
Last edit: 17 May 2020 22:28 by TKWard10000.

Please Log in or Create an account to join the conversation.

More
18 May 2020 05:13 #168121 by cmorley
Replied by cmorley on topic Spindle dwell time
You could use classicladder or use timedelay component:

linuxcnc.org/docs/2.7/html/man/man9/timedelay.9.html

Chris

Please Log in or Create an account to join the conversation.

More
19 May 2020 00:01 #168209 by TKWard10000
Replied by TKWard10000 on topic Spindle dwell time
Thank you. Appreciate the response.

Looking at this I think I have another issue.

Realisticly, I need it inhibit direction change unless spindle is off and motor stopped turning .... aka M5 issued.

I don't know how to do that in terms of logic. Never done ladder programming ...... I can program in C, C++, VB...... plenty of others but never that lol

Please Log in or Create an account to join the conversation.

More
19 May 2020 00:09 #168212 by cmorley
Replied by cmorley on topic Spindle dwell time
Do you have spindle feedback?
if so use it to detect spindle stoppage.
other wise you will have to guesstimate by detecting M5 and a time delay.

If you do C program 'comp' programming will be easy to pick up.
linuxcnc.org/docs/2.7/html/hal/comp.html

Please Log in or Create an account to join the conversation.

More
19 May 2020 00:21 #168213 by TKWard10000
Replied by TKWard10000 on topic Spindle dwell time
I was thinking I could do a logical compare with spindle speed. if I knew what pins I could do logic on etc .....and how

Im still trying to understand concept of hal ... and im a visual and by example learner .....

is there a way of loading additional hal "program" files, rather than having all in same file ?

similar to loading header files in C ?

Sorry for all the newb questions ..... I was proud of myself for getting spindle stepping to work with cnc4pc C6 board ..... and ten realized that was just the start lol

Im also thinking of getting a pair of mesa boards later in the week (6i25 - 7i76 combo )...
But that seems even more complex! Seperate convo though.

Keith

Please Log in or Create an account to join the conversation.

More
19 May 2020 00:28 #168214 by cmorley
Replied by cmorley on topic Spindle dwell time
well you can only compare if you have the hardware - so do you have spindle feedback available? an encoder or rotation sensor?

you can chain HAL files together.

HAL is like electrical circuits wired together other then the wires are text descriptions rather then physical wires.

Please Log in or Create an account to join the conversation.

More
19 May 2020 00:35 - 19 May 2020 00:38 #168216 by TKWard10000
Replied by TKWard10000 on topic Spindle dwell time
Damn. Thought I had said yes to that. It will arrive wednesday ( 1000ppr with index )

My HAL file as is pastebin.com/7Z6Z10ei

Motor driver manual is here acim.nidec.com/drives/kbelectronics/-/me...mg_manual.ashx?la=en

Page 22 is relevant section ..... using DPDT relay to swap polarity of 0-10V isolated signal .... and a separate SPST relay for spindle on-off

Pins for encoder will change, otherwise it works with exception of delays and logic etc
Last edit: 19 May 2020 00:38 by TKWard10000.

Please Log in or Create an account to join the conversation.

More
19 May 2020 00:57 #168218 by TKWard10000
Replied by TKWard10000 on topic Spindle dwell time
Just realized, I do have an optical sensor mounted currently ( single pulse per rev ) ..... coming over from Mach3

But i didnt think linuxcnc could work with just a single pulse device ?

Please Log in or Create an account to join the conversation.

More
19 May 2020 03:16 #168225 by cmorley
Replied by cmorley on topic Spindle dwell time
it can, it's just not recommended.

Please Log in or Create an account to join the conversation.

More
19 May 2020 14:14 #168271 by TKWard10000
Replied by TKWard10000 on topic Spindle dwell time
I will have to look single pulse spindle encoder use. Reason being that I will have to make a mount for the 1000ppr rotary encoder,

Do you know of any examples on how to use a single 'index' pulse encoder ?

At least I can basic hal stuff working, and then modify once I get the additional hardware.

Keith

Please Log in or Create an account to join the conversation.

Time to create page: 0.089 seconds
Powered by Kunena Forum