setup qtplasmac

More
13 Jul 2021 12:18 #214561 by fupeama
Replied by fupeama on topic setup qtplasmac

Yup, me too, but cutting 20mm plates with plasma is the "industrial" domain requiring 5 and 6 figure price tags.
On the other hand, adding an Oxy Acetylene torch to the plasma machine does that easily and with style! :)

 

yes -  for thicker material is better use oxy Acetylene. in the future i would like to be able to replace the plasma torch with oxy acetylene. I'm currently studying how to set it all up.

Martin
The following user(s) said Thank You: tommylight

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

More
16 Jul 2021 12:17 #215032 by fupeama
Replied by fupeama on topic setup qtplasmac
The final decision for the ARC override was made on the keyboard and the plus, minus and reset keys on external panel.
I modified the handler a bit. Now I am happy with this solution.


share/qtvcp/screens/qtplasmac/qtplasmac_handler.py
index 56cf3f251..cfcda3a5b 100644
@@ -432,6 +432,9 @@ class HandlerClass:
         self.colorFgPin = self.h.newpin('color_fg', hal.HAL_S32, hal.HAL_OUT)
         self.cutTypePin = self.h.newpin('cut_type', hal.HAL_S32, hal.HAL_IN)
         self.heightOverridePin = self.h.newpin('height_override', hal.HAL_FLOAT, hal.HAL_OUT)
+        self.heightOverridePinPlus = self.h.newpin('height_override_plus', hal.HAL_BIT, hal.HAL_IN)
+        self.heightOverridePinMinus = self.h.newpin('height_override_minus', hal.HAL_BIT, hal.HAL_IN)
+        self.heightOverridePinReset = self.h.newpin('height_override_reset', hal.HAL_BIT, hal.HAL_IN)
         self.laserOnPin = self.h.newpin('laser_on', hal.HAL_BIT, hal.HAL_OUT)
         self.materialChangePin = self.h.newpin('material_change', hal.HAL_S32, hal.HAL_IN)
         self.materialChangeNumberPin = self.h.newpin('material_change_number', hal.HAL_S32, hal.HAL_IN)
@@ -1248,6 +1251,15 @@ class HandlerClass:
         self.heightOverridePin.set(self.heightOvr)
         self.w.height_ovr_label.setText('{:.2f}'.format(self.heightOvr))
 
+    def heightOverridePinIn (self,state,value):
+        if state:
+            if value:
+                self.heightOvr += value * self.w.thc_threshold.value()
+            else:
+                self.heightOvr = 0
+        if self.heightOvr > 10 : self.heightOvr = 10
+        if self.heightOvr < -10 : self.heightOvr = -10
+
     def touch_xy_clicked(self):
         self.touch_off_xy(0, 0)
         self.w.gcodegraphics.logger.clear()
@@ -1813,6 +1825,9 @@ class HandlerClass:
         self.w.laser.pressed.connect(self.laser_pressed)
         self.w.main_tab_widget.currentChanged.connect(lambda w:self.main_tab_changed(w))
         self.zHeightPin.value_changed.connect(lambda v:self.z_height_changed(v))
+        self.heightOverridePinPlus.value_changed.connect(lambda v:self.heightOverridePinIn(v,1))
+        self.heightOverridePinMinus.value_changed.connect(lambda v:self.heightOverridePinIn(v,-1))
+        self.heightOverridePinReset.value_changed.connect(lambda v:self.heightOverridePinIn(v,0))
         self.plasmacStatePin.value_changed.connect(lambda v:self.plasmac_state_changed(v))
         self.w.feed_label.pressed.connect(self.feed_label_pressed)
         self.w.rapid_label.pressed.connect(self.rapid_label_pressed)

Martin

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

More
17 Jul 2021 07:26 #215120 by phillc54
Replied by phillc54 on topic setup qtplasmac
Great work. If you want to submit a PR to include the work I would be happy to merge it.

If you want to do a PR you would just need to make some minor changes to keep the code consistent with the existing. Also it would be better to rework the exising height_ovr_pressed function so both the GUI buttons and the external Hal pins use the same function rather than having two functions doing the same job.

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

More
19 Jul 2021 08:45 #215295 by fupeama
Replied by fupeama on topic setup qtplasmac
Hi,
Ok, I tried to make PR. I did it for the first time, so maybe it works.
Martin
 

Great work. If you want to submit a PR to include the work I would be happy to merge it.

If you want to do a PR you would just need to make some minor changes to keep the code consistent with the existing. Also it would be better to rework the exising height_ovr_pressed function so both the GUI buttons and the external Hal pins use the same function rather than having two functions doing the same job.

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

More
19 Jul 2021 09:02 #215297 by phillc54
Replied by phillc54 on topic setup qtplasmac

Hi,
Ok, I tried to make PR. I did it for the first time, so maybe it works.
Martin

I saw the PR, it looks good, I will test and merge tomorrow.
It would have been nice if you had renamed the pins so they were similar to the existing external pins, something like:
self.extHeightOvrMinusPin

Do you want to add them to the doc or do you want me to.

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

More
19 Jul 2021 10:27 #215307 by fupeama
Replied by fupeama on topic setup qtplasmac
OK I will rename pin.
something like this?
self.extHeightOvrPlusPin = self.h.newpin('ext_height_ovr_plus', hal.HAL_BIT, hal.HAL_IN)I would prefer you to add the information to the documentation because English is not my native language.

Martin
The following user(s) said Thank You: Clive S

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

More
19 Jul 2021 10:34 #215309 by phillc54
Replied by phillc54 on topic setup qtplasmac
Great, thanks for doing this. I'll do the docs tomorrow as well.
The following user(s) said Thank You: Clive S

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

More
21 Jul 2021 14:38 #215497 by fupeama
Replied by fupeama on topic setup qtplasmac
Thanks for adding code to repo.
If you want, I can try write code for encoder height override too.
Martin

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

More
21 Jul 2021 23:22 #215532 by phillc54
Replied by phillc54 on topic setup qtplasmac

Thanks for adding code to repo.
If you want, I can try write code for encoder height override too.
Martin

I am not sure what you mean, but I would be happy to have a look.

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

More
22 Jul 2021 07:30 #215553 by fupeama
Replied by fupeama on topic setup qtplasmac
similar feature like a buttons but for encoder.
I think the source code is explanatory
Martin.

index 521dc682e..40c4ad0df 100644
@@ -208,6 +208,7 @@ class HandlerClass:
         self.dialogError = False
         self.cutTypeText = ''
         self.heightOvr = 0.0
+        self.old_ovr_counts = 0
         self.startLine = 0
         self.preRflFile = ''
         self.rflActive = False
@@ -474,6 +475,10 @@ class HandlerClass:
         self.extHeightOvrPlusPin = self.h.newpin('ext_height_ovr_plus', hal.HAL_BIT, hal.HAL_IN)
         self.extHeightOvrMinusPin = self.h.newpin('ext_height_ovr_minus', hal.HAL_BIT, hal.HAL_IN)
         self.extHeightOvrResetPin = self.h.newpin('ext_height_ovr_reset', hal.HAL_BIT, hal.HAL_IN)
+        self.extHeightOvrCountsPin = self.h.newpin('ext_height_ovr_counts', hal.HAL_S32, hal.HAL_IN)
+        self.extHeightOvrCountEnablePin = self.h.newpin('ext_height_ovr_count_enable', hal.HAL_BIT, hal.HAL_IN)
         self.probeTestErrorPin = self.h.newpin('probe_test_error', hal.HAL_BIT, hal.HAL_IN)
         self.out0Pin = self.h.newpin('ext_out_0', hal.HAL_BIT, hal.HAL_OUT)
         self.out1Pin = self.h.newpin('ext_out_1', hal.HAL_BIT, hal.HAL_OUT)
@@ -1248,6 +1253,18 @@ class HandlerClass:
         if self.heightOvr > 10 :self.heightOvr = 10
         self.heightOverridePin.set(self.heightOvr)
         self.w.height_ovr_label.setText('{:.2f}'.format(self.heightOvr))
+        
+    def height_ovr_encoder(self,value):
+        if (value != self.old_ovr_counts and self.extHeightOvrCountEnablePin.get()): 
+            self.heightOvr += (value-self.old_ovr_counts) * self.w.thc_threshold.value()
+            if self.heightOvr < -10 :self.heightOvr = -10
+            if self.heightOvr >  10 :self.heightOvr =  10
+            self.heightOverridePin.set(self.heightOvr)
+            self.w.height_ovr_label.setText('{:.2f}'.format(self.heightOvr))
+        self.old_ovr_counts = value
+            
+        
+            
 
     def touch_xy_clicked(self):
         self.touch_off_xy(0, 0)
@@ -1859,7 +1876,8 @@ class HandlerClass:
         self.extRunPausePin.value_changed.connect(lambda v:self.ext_run_pause(v))
         self.extHeightOvrPlusPin.value_changed.connect(lambda v:self.height_ovr_pressed(v,1))
         self.extHeightOvrMinusPin.value_changed.connect(lambda v:self.height_ovr_pressed(v,-1))
+        self.extHeightOvrCountsPin.value_changed.connect(lambda v:self.height_ovr_encoder(v))    
         self.probeTestErrorPin.value_changed.connect(lambda v:self.probe_test_error(v))
 
     def set_axes_and_joints(self):

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

Moderators: snowgoer540
Time to create page: 0.219 seconds
Powered by Kunena Forum