The best way to drive an output when the machine is moving

If you have a question about the software please ask it here.

The best way to drive an output when the machine is moving

Postby GaryLa » Tue Aug 20, 2019 2:52 pm

I have a situation where I need to inform an external device that the machine is moving. I am new to UCCNC, so if this is a typical question, my apologies. I tried searching "ismoving" and various other keywords with no luck.

I would like to have an output which indicates when the machine is moving. Actually moving. Not just executing G-code (With G4 for example, the machine would not be moving).

Is there an LED that I can direct to an output pin for this?

Or would it have to be a macro that runs continuously, such as:

while(1) output_pin = exec.isMoving();
GaryLa
 
Posts: 76
Joined: Thu May 30, 2019 11:30 pm

Re: The best way to drive an output when the machine is movi

Postby dezsoe » Tue Aug 20, 2019 4:15 pm

Use the current hi/lo pin(s).
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: The best way to drive an output when the machine is movi

Postby GaryLa » Tue Aug 20, 2019 4:44 pm

dezsoe wrote:Use the current hi/lo pin(s).


Do you mean the "field" numbered 96 referenced in this: /UCCNC/Documentation/Fields_by_number.htm ?

I read somewhere that LEDs are the only thing I can drive outputs. I am not yet familiar enough to understand how to use this.

I read about the AddField function. Are you saying to create a "field" which can then be used to drive an output using a Configuration->I/O Trigger->Output Trigger?

Or will I need a continuously executing macro?
GaryLa
 
Posts: 76
Joined: Thu May 30, 2019 11:30 pm

Re: The best way to drive an output when the machine is movi

Postby dezsoe » Tue Aug 20, 2019 5:01 pm

Depending on your UCCNC version it's on the axes or the I/O setup page. In the latest stable version it's on the I/O setup. The latest test version has these settings on the axis setup pages, but take care that the USB controllers have only one output for all axes.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: The best way to drive an output when the machine is movi

Postby GaryLa » Wed Aug 21, 2019 11:47 am

Thanks. To clarify, the "Current hi/low" signal is an indicator of the machine moving any axis?

Do you know why it's refered to as "current hi/low" ?

Since the UC100/UC300 do not actually drive motors, I assume the word "current" does not refer to the flow of amps.
GaryLa
 
Posts: 76
Joined: Thu May 30, 2019 11:30 pm

Re: The best way to drive an output when the machine is movi

Postby ger21 » Wed Aug 21, 2019 12:27 pm

From the manual:

The signal is active when a motion or dwell is ongoing and activates a few milliseconds before the motion starts and
deactivates a few milliseconds after the motion stopped. The few milliseconds delays are to let the
stepper motor driver adjust the current in time to the full or to the holding current level.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: The best way to drive an output when the machine is movi

Postby cncdrive » Wed Aug 21, 2019 12:29 pm

It is called current hi/low, because this signal is usually used to reduce motor current in steppermotors as some stepper drives have an input to switch reduce the current in the stepper motor, mostly to around 60% when the motor just holds and is not moving and it puts back the current to the normal 100% of the set value before movement starts.
The current hi/low signal switches always before the motion starts and after it stops, so the motor drive has time to adjust the motor current before the motion...
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: The best way to drive an output when the machine is movi

Postby cncdrive » Wed Aug 21, 2019 12:30 pm

yeaa, read the manual. ;)
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: The best way to drive an output when the machine is movi

Postby Vmax549 » Wed Aug 21, 2019 12:35 pm

It also works great to run teh Auto lube systems. The timer ONLY runs when there is motion on an axis.

(;-) TP
Vmax549
 
Posts: 331
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: The best way to drive an output when the machine is movi

Postby GaryLa » Wed Aug 21, 2019 4:25 pm

cncdrive wrote:yeaa, read the manual. ;)


Sorry, it didn't occur to me that it was described elsewhere.

I was looking at "/UCCNC/Documentation/Fields_by_number.htm", item 96 -- which had a blank line in the "description" column.

But the original question was for a signal which was only active when there was actual movement -- for example, not when a G4 dwell was executing.

Is there any recommendation for determining when any axis is physically moving other than literally watching the step pins?
Last edited by GaryLa on Wed Aug 21, 2019 4:33 pm, edited 1 time in total.
GaryLa
 
Posts: 76
Joined: Thu May 30, 2019 11:30 pm

Next

Return to Ask a question from support here

Who is online

Users browsing this forum: Bing [Bot] and 10 guests