fbpx

CS-Lab Support Forum for CNC Community

Help to run this brand-new forum and stay with us.
Ask your questions, we are here to help! 

 

Please or Register to create posts and topics.

simCNC tool lifetime

PreviousPage 2 of 2

Thanks for the explanation! Very interesting and powerful function.

I have allready tested some stuff regarding tool life time with machine params. Works good so far. I will work on that and make it more handy on the weekend. Will post the results then.

I also tried now to embed the pyAction function with a timer. Seems also to work so far. Are there known limitations? (more pyaction timers can lag for example?)

Hello!

I have done some testing with the machine parameters. This works in general good so far. 

My attempt is to use the pyAction with an timer every 60 seconds to count down one minute as soon the spindle is activated. 

Also the message and action can be done as soon one tool reaches 0 minutes. 

Work in progress to do the fine tuning. 

1. 

So the toollifetimer pyAction runs as soon the machine is turned on. So the 60 seconds are counting down from this event.

I would like to integrate in my M3 macro a command to enable this pyAction and in my M5 macro to stop the pyAction.

Is there a command for macros to enable and disable an specific pyAction?

 

2.

To set the value for the machine param (i.e. param 100 for tool nr 1) i have made an small gui. It can set the param 100 to 44 for example. The progressbar is also set to a maximum of 44 by gui editor. I wanted to change the progress bar max value with my self made gui. I cant change the "maximum" value in the progress bar by macro with this command:

gui.ProgressBar_1.setMaximum(44)

is there something missing or maybe not possible?

Kind regards

Dobbelju

 

Uploaded files:
  • ToolLife1.png
  • ProgressBar_setmaximum.png
Quote from Dobbelju on 2 July 2023, 12:36

1. 

So the toollifetimer pyAction runs as soon the machine is turned on. So the 60 seconds are counting down from this event.

I would like to integrate in my M3 macro a command to enable this pyAction and in my M5 macro to stop the pyAction.

Is there a command for macros to enable and disable an specific pyAction?

Not that I know at least... But you could check in your toolLifeTimer macro if the spindle is currently running or not. The action itself can just continue to loop.

if d.getSpindleState() == SpindleState.CW_ON or d.getSpindleState() == SpindleState.CCW_ON:
    # start timer
else:
   # end timer

Quote from Dobbelju on 2 July 2023, 12:36

 

2.

To set the value for the machine param (i.e. param 100 for tool nr 1) i have made an small gui. It can set the param 100 to 44 for example. The progressbar is also set to a maximum of 44 by gui editor. I wanted to change the progress bar max value with my self made gui. I cant change the "maximum" value in the progress bar by macro with this command:

gui.ProgressBar_1.setMaximum(44)

is there something missing or maybe not possible?

Qt has this attribute, but it does not theme to get exposed by simCNC.

How about using a relative value as input and just calculate a percentage of current time over the maximum life time? This way your progress bar maximum will stay at 100.

thisVal = d.getMachineParameter(100) / gui.input_t1_lifespan.value * 100
gui.ProgressBar_2.setValue(thisVal)

i.e. at 150 minutes life span and a current run time of 45 minutes you'd get 28,125. No need to round the number, as the progress bar accepts float values.

Cheers,
André

Dobbelju has reacted to this post.
Dobbelju

The good news is that soon you can use the "Analog IO indicator" as a horizontal or vertical bar.

Regards,

Wojtek

andre has reacted to this post.
andre
Quote from andre on 2 July 2023, 19:08

Qt has this attribute, but it does not theme to get exposed by simCNC.

How about using a relative value as input and just calculate a percentage of current time over the maximum life time? This way your progress bar maximum will stay at 100.

thisVal = d.getMachineParameter(100) / gui.input_t1_lifespan.value * 100
gui.ProgressBar_2.setValue(thisVal)

i.e. at 150 minutes life span and a current run time of 45 minutes you'd get 28,125. No need to round the number, as the progress bar accepts float values.

Cheers,
André

Hello, sadly i coudn`t get it to work with this calculation. I assume the problem is on my side and i can´t figure out how to exactly implement this in my screen 😀 .

Could you be so kind and maybe explain a litte bit more?

I have finished most of the project.

As shown in the pictures this is the general build for it. 

Every 60seconds the pyAction counts down the actual used tool lifetime for a minute  when the spindle is turned on. 

Works fine for all positions. When the time has reached 0:0 then the status gets red and can execute whatever is needed - in my case before the next tool change a prompt will be shown that the tool needs to be checked/replaced before continuing is possible.

Also the time is set by an own dialog for each tool number.

Thanks for the assistance! 

When someone wants to try this function, i can provide the code.

Uploaded files:
  • Version-1.0-2.png
  • Version-1.0-2-3.png
carbonkid has reacted to this post.
carbonkid

Very good job.

Dobbelju has reacted to this post.
Dobbelju
PreviousPage 2 of 2

PARTNERS:

 

USA

Germany

Slovenia / Bosnia

Spain

South Africa

UNI-CAM

The Netherlands

Portugal

Greece

  Distrib milionis logo

Hungary

Distrib logot

Bulgaria

Master

Kenya

Proteq Automation

Egypt

Germanelectronix

China

Jun Ma

Serbia

ALCO

Italy

LVL tech r

Denmark

Varntoft Dania

Finland

×

Hello!

Click one of our contacts below to chat on WhatsApp

× How can I help you?