gmocappy clock
- HansU
- Offline
- Moderator
Less
More
- Posts: 629
- Thank you received: 182
08 Mar 2021 19:21 #201471
by HansU
Replied by HansU on topic gmocappy clock
Hmm if you use box_custom_4 there is exactly one field left - maybe for the total accumulated travel distance.
I thought about adding it like this:
forum.linuxcnc.org/38-general-linuxcnc-q...nce-for-axes?start=0
but it would perfect fit into the timer.
Instead ofwe could also lubricate by travel distance.
And I think I'll add the elapsed time for the current part. To be resetted on pressing start.
I thought about adding it like this:
forum.linuxcnc.org/38-general-linuxcnc-q...nce-for-axes?start=0
but it would perfect fit into the timer.
Instead of
a Pin for the time limit to lube
And I think I'll add the elapsed time for the current part. To be resetted on pressing start.
Please Log in or Create an account to join the conversation.
- HansU
- Offline
- Moderator
Less
More
- Posts: 629
- Thank you received: 182
08 Mar 2021 19:29 #201476
by HansU
If you don't want to use expensive hardware for reading analog signals, I can make an offer to you.
I wrote a very basic modus client running on a PIC microcontroller that has analog and digital inputs. You can use it with the MB2HAL component for example connected by a serial to USB converter.
Replied by HansU on topic gmocappy clock
Great , thats what was needed. Many thanks Norbert.
BTW , I notice that the speed controls dont work under touch screen displays , I mean the sliders , still need to use the + and _ buttons , and in many cases you need fast acction. Is there a way to make the sliders working with mouse or touch , not only the + and -
If you don't want to use expensive hardware for reading analog signals, I can make an offer to you.
I wrote a very basic modus client running on a PIC microcontroller that has analog and digital inputs. You can use it with the MB2HAL component for example connected by a serial to USB converter.
Please Log in or Create an account to join the conversation.
- newbynobi
- Offline
- Moderator
Less
More
- Posts: 2075
- Thank you received: 406
08 Mar 2021 20:46 #201485
by newbynobi
Replied by newbynobi on topic gmocappy clock
@hans23,
I am working on timer.py to add Hal pins to set an alarm if limits are reached. First pin would be total run time to give a message machine needs maintenance, if that one works, it would be easy to add more alarm pin.
I was thinking about using the spare space for a part counter, but I do like also your idea of travel distance?
What to do?
Norbert
I am working on timer.py to add Hal pins to set an alarm if limits are reached. First pin would be total run time to give a message machine needs maintenance, if that one works, it would be easy to add more alarm pin.
I was thinking about using the spare space for a part counter, but I do like also your idea of travel distance?
What to do?
Norbert
Please Log in or Create an account to join the conversation.
- HansU
- Offline
- Moderator
Less
More
- Posts: 629
- Thank you received: 182
08 Mar 2021 22:04 - 09 Mar 2021 08:26 #201490
by HansU
Replied by HansU on topic gmocappy clock
The accumulated distance for one axis can be calculated in this way.
Simply integrate the absolute velocity:
To get the real distance, the absolut value of the velocity vector has to be calculated first (sqrt(v_x² + v_y² + v_z²)), then integrated.
As you always have that value for displaying, you may could use this.
A use case for that would be to estimate the wear of the mill.
But for lubrication intervals I think it is also useful to have the separate travel distances for each axis.
If it is displayed in the ntb_setup area, there will be enough space for all that.
A value for "Time/travel since last lubrication" could also be useful.
Simply integrate the absolute velocity:
loadrt abs names=abs.x,abs.y,abs.z
loadrt integ names=integ.x,integ.y,integ.z
addf abs.x servo-thread
addf integ.x servo-thread
net vel-in-x abs.x.in <= joint.0.vel-cmd
net vel-abs-x abs.x.out => integ.x.in
net acc-dist-x integ.x.out
To get the real distance, the absolut value of the velocity vector has to be calculated first (sqrt(v_x² + v_y² + v_z²)), then integrated.
As you always have that value for displaying, you may could use this.
A use case for that would be to estimate the wear of the mill.
But for lubrication intervals I think it is also useful to have the separate travel distances for each axis.
If it is displayed in the ntb_setup area, there will be enough space for all that.
A value for "Time/travel since last lubrication" could also be useful.
Last edit: 09 Mar 2021 08:26 by HansU.
Please Log in or Create an account to join the conversation.
- newbynobi
- Offline
- Moderator
Less
More
- Posts: 2075
- Thank you received: 406
09 Mar 2021 21:08 - 09 Mar 2021 21:24 #201594
by newbynobi
Replied by newbynobi on topic gmocappy clock
So here is the next level
Adding the embedded tab as in previous post.
This one has the following hal pin:
As shown in the attached hal file you will need to set the periods for the time after you want the alarm like so:
Give the time in minutes, so here a alarm is given for machine time after 2 minutes and every minute you get an alarm for the spindle
In real machines you will sure set the time intervals longer, in my machine I set the machine time to 259200 and spindle time to 480
After that time periode the alarm pin will get high and will stay high until you set the corresponding timer.reset_alarm pin to high, do not forget to set it low again after you have done the maintenance or lube! Setting the reset pin high will clear the alarm an increment the elapsed_periods pin, so if you have done 10 lubes you may control the lube level to see if the use of oil is in between your limits or what ever you want to do with that information.
All values will be stored in a var file and reloaded on next start, machine pin after turning on the machine, spindle pin after turning on the spindle.
So what next?
- part counter
- travel distance
- anything else
And again you see, there is nothing impossible with gmoccapy and python. By the way this embedded tabs can also be included and axis and some other GUI.
So now I need testers and feed back
Norbert
Adding the embedded tab as in previous post.
This one has the following hal pin:
HAL_BIT OUT timer.alarm_machine
HAL_BIT OUT timer.alarm_spindle
HAL_U32 OUT timer.elapsed_periodes_machine
HAL_U32 OUT timer.elapsed_periodes_spindle
HAL_BIT IN timer.machine_on
HAL_U32 IN timer.periode_time_machine
HAL_U32 IN timer.periode_time_spindle
HAL_BIT IN timer.reset_alarm_machine
HAL_BIT IN timer.reset_alarm_spindle
HAL_BIT IN timer.running
HAL_BIT IN timer.spindle_on
As shown in the attached hal file you will need to set the periods for the time after you want the alarm like so:
setp timer.periode_time_machine 2
setp timer.periode_time_spindle 1
In real machines you will sure set the time intervals longer, in my machine I set the machine time to 259200 and spindle time to 480
After that time periode the alarm pin will get high and will stay high until you set the corresponding timer.reset_alarm pin to high, do not forget to set it low again after you have done the maintenance or lube! Setting the reset pin high will clear the alarm an increment the elapsed_periods pin, so if you have done 10 lubes you may control the lube level to see if the use of oil is in between your limits or what ever you want to do with that information.
All values will be stored in a var file and reloaded on next start, machine pin after turning on the machine, spindle pin after turning on the spindle.
So what next?
- part counter
- travel distance
- anything else
And again you see, there is nothing impossible with gmoccapy and python. By the way this embedded tabs can also be included and axis and some other GUI.
So now I need testers and feed back
Norbert
Last edit: 09 Mar 2021 21:24 by newbynobi.
The following user(s) said Thank You: biqut2, tivoi
Please Log in or Create an account to join the conversation.
- biqut2
- Offline
- Premium Member
Less
More
- Posts: 97
- Thank you received: 5
09 Mar 2021 21:22 #201598
by biqut2
Replied by biqut2 on topic gmocappy clock
Wow thank you! I figured I'd have to do all this once I had time. This saves me a ton of effort. I'll get this loaded up on my mill first chance I get and test it and get you some feedback.
Please Log in or Create an account to join the conversation.
- HansU
- Offline
- Moderator
Less
More
- Posts: 629
- Thank you received: 182
10 Mar 2021 09:31 - 10 Mar 2021 20:12 #201630
by HansU
Replied by HansU on topic gmocappy clock
I tried to add a field for the running time of the current program.
But adding a label and writing a value as a first step failed. Can you give me please a hint what I did wrong?
It seems that the pins are not created and due to this error the vcp is not displayed.
But adding a label and writing a value as a first step failed. Can you give me please a hint what I did wrong?
It seems that the pins are not created and due to this error the vcp is not displayed.
Last edit: 10 Mar 2021 20:12 by HansU.
Please Log in or Create an account to join the conversation.
- newbynobi
- Offline
- Moderator
Less
More
- Posts: 2075
- Thank you received: 406
10 Mar 2021 10:21 #201632
by newbynobi
Replied by newbynobi on topic gmocappy clock
Where did you do the connection?
All Hal connections for an embedded tab must be done in the Hal file specified in the loading code (INI file command) in this case in timer.hal
Please watch that pins are not all ready connected in a previous Hal file.
Order of loading Hal files are
The order they are listed in the INI File
Then the postgui Hal file
than the embedded tabs Hal file.
I can not see if you glade file is correct, I am on a wrong computer
Norbert
All Hal connections for an embedded tab must be done in the Hal file specified in the loading code (INI file command) in this case in timer.hal
Please watch that pins are not all ready connected in a previous Hal file.
Order of loading Hal files are
The order they are listed in the INI File
Then the postgui Hal file
than the embedded tabs Hal file.
I can not see if you glade file is correct, I am on a wrong computer
Norbert
Please Log in or Create an account to join the conversation.
- HansU
- Offline
- Moderator
Less
More
- Posts: 629
- Thank you received: 182
10 Mar 2021 14:54 #201650
by HansU
I used your most recent timer.hal without the last four lines
and
Linuxcnc says that it can't find the pin named 'timer.periode_time_machine'.
I think without including timer_hu.py it showed at least the panel ( I'm on the wrong computer too )
Replied by HansU on topic gmocappy clock
Sorry I didn't post that, that war clear I thought.Where did you do the connection?
All Hal connections for an embedded tab must be done in the Hal file specified in the loading code (INI file command) in this case in timer.hal
I used your most recent timer.hal without the last four lines
and
EMBED_TAB_NAME = timer
EMBED_TAB_LOCATION = ntb_setup
EMBED_TAB_COMMAND = gladevcp -x {XID} -u timer_hu.py -H timer_v2.hal timer_4.glade
Linuxcnc says that it can't find the pin named 'timer.periode_time_machine'.
I think without including timer_hu.py it showed at least the panel ( I'm on the wrong computer too )
Please Log in or Create an account to join the conversation.
- newbynobi
- Offline
- Moderator
Less
More
- Posts: 2075
- Thank you received: 406
10 Mar 2021 18:24 - 10 Mar 2021 18:25 #201671
by newbynobi
Replied by newbynobi on topic gmocappy clock
the Hal pin is called
timer.periode_time_machine
so your name is right.
there must be an other error too.
can you post your timer_hu.py file please
and the complete terminal output
timer.periode_time_machine
so your name is right.
there must be an other error too.
can you post your timer_hu.py file please
and the complete terminal output
Last edit: 10 Mar 2021 18:25 by newbynobi.
Please Log in or Create an account to join the conversation.
Moderators: newbynobi, HansU
Time to create page: 0.111 seconds