Axis Scaling in 2.1.6

More
29 Dec 2018 23:52 #123121 by slammers
I added my Taig 4th axis to my 770. It needs 400 steps per degree as opposed to the Tormach 4th axis which needs 500 steps per degree.

I thought I could just edit the tromach_770.ini file and change the SCALE value for Axis3 from 500 to 400 but it had no effect.

I also tried hard coding the value in the tormach_mill_messa.hal file by replacing [AXIS_3]SCALE to 400 but it also had no effect

Does Pathpilot somehow hard code the stepper scaling parameters?

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

More
30 Dec 2018 04:09 - 30 Dec 2018 04:25 #123126 by smgvbest
Replied by smgvbest on topic Axis Scaling in 2.1.6
from what I see this appears to be the relevant section of the UI for it
def set_4th_axis_scale(self, harmonic_4th_axis):
        board = self.inifile.find("HOSTMOT2", "BOARD")
        if board == None:
            self.error_handler.log("In simulator, no axis scale to set")
            # If we're in the simulator there will be no HOSTMOT2 board to set scale on
            return

        scale = self.ini_float("AXIS_3", "HARMONIC_SCALE" if harmonic_4th_axis else "SCALE", 500)
        cmd = ["halcmd", "setp", "hm2_%s.0.stepgen.03.position-scale" % board, "%.4f" % scale]
        self.error_handler.log(' '.join(cmd))
        if subprocess.call(cmd):
            self.error_handler.log("Error: something failed running halcmd to set 4th axis scale")
            sys.exit(1)

so it is looking for AXIS_3 to be set, it's looking for the name to be either HARMONIC_SCALE or SCALE and defaults to 500 if not found if I read that correctly

so a little test in sim (which had its own difficulties)
2018-12-29 21:53:50.092611 CST (+0:00:00.004668) | Harmonic 4th axis: False [tormach_mill_ui.py:1345]
2018-12-29 21:53:50.093349 CST (+0:00:00.000738) | In simulator, no axis scale to set [tormach_mill_ui.py:7968]
2018-12-29 21:53:50.093937 CST (+0:00:00.000588) | halcmd setp hm2_None.0.stepgen.03.position-scale 400.0000 <<[tormach_mill_ui.py:7971]
2018-12-29 21:53:50.094714 CST (+0:00:00.000777) | In simulator, no axis scale to set [tormach_mill_ui.py:7968]
2018-12-29 21:53:50.095754 CST (+0:00:00.001040) | halcmd setp hm2_None.0.stepgen.03.position-scale 400.0000  <<[tormach_mill_ui.py:7971]

so in the tormach_770_specific.ini file
you would code
[AXIS_3]
SCALE = 400

if your using the tormach_770.ini that would be the incorrect file to edit (it's generated from below)
in V2 it is the
tormach_mill_base.ini and the
tormach_770_specific.ini that get read in

let me know if you're editing the tormach_770_specific.ini and its still not working.
from what I see it should be working.

caveat, I am running in sim mode since i don't have a mill
Last edit: 30 Dec 2018 04:25 by smgvbest.

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

More
30 Dec 2018 04:59 #123127 by slammers
Replied by slammers on topic Axis Scaling in 2.1.6
But if I look at the pathpilotlog file I see these lines

INIFILE: /home/operator/tmc/configs/tormach_mill/tormach_770.ini
expanded INIFILE: /home/operator/tmc/configs/tormach_mill/tormach_770.ini

So I assumed that is the correct one being loaded.

the 770_specific file does not even have an Axis3 section

I can try and change the base.ini file and see if that changes anything.

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

More
30 Dec 2018 05:25 - 30 Dec 2018 05:27 #123129 by slammers
Replied by slammers on topic Axis Scaling in 2.1.6
Ok, I guess the 770.ini is generated when the program runs because if I change the base.ini file, run pathpilot then look at the 770.ini, the changes are copied over.

I had changed the base.ini file SCALE value and it did not change anything, so I just now changed the HARMONIC_SCALE instead from 283.3333 to 400 and that did the trick. I now get accurate positioning in A.

But now I am confused on why Tormach would default this to 283.333. All their documentation says their rotary tables are 500 steps / degree. Do you know what HARMONIC_SCALE would mean?

Can you point me to the location of the UI file where you found that code above?
Last edit: 30 Dec 2018 05:27 by slammers.

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

More
30 Dec 2018 08:48 #123136 by smgvbest
Replied by smgvbest on topic Axis Scaling in 2.1.6
The file is
/home/operator/tmc/python/tormach_mill_ui.py
the function set_4th_axis_scale starts at line 7965
you can also look for harmonic_4th_axis to see other places it was used

just a few other items to cross ref some thing
harmonic_4th_axis_radiobutton is the Glade name of the 4" 4th axis
other_4th_axis_radiobutton is the Glade name of the 6" and 8" 4th Axis (yeh, that one makes sense)
fourth_axis_homing_checkbutton si the Glade name of the homing check box
def on_harmonic_4th_axis_radiobutton_toggled(self, widget, data=None):
        if widget.get_active():
            self.harmonic_4th_axis = True
            self.redis.hset('machine_prefs', 'harmonic_4th_axis', self.harmonic_4th_axis)
            self.set_4th_axis_scale(self.harmonic_4th_axis)
            self.window.set_focus(None)

    def on_other_4th_axis_radiobutton_toggled(self, widget, data=None):
        if widget.get_active():
            self.harmonic_4th_axis = False
            self.redis.hset('machine_prefs', 'harmonic_4th_axis', self.harmonic_4th_axis)
            self.set_4th_axis_scale(self.harmonic_4th_axis)
            self.window.set_focus(None)

these two define the value of the harmonic_4th_axis to be TRUE or FALSE depending on if you pick the 4" or the (6 or 8") rotary axis
that goes into the function previously posted that selects either HARMONIC_SCALE or SCALE depending on if it's a 4" or 6/8" rotary.

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

More
03 Mar 2019 18:27 #127616 by ScotY
Replied by ScotY on topic Axis Scaling in 2.1.6
Hello,
Happened across this thread and the problem here sounds like something I might encounter. I am a little confused about the solution and if this will apply to my 440. Can you provide some guidance for me?
Thank you again for all your help!

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

More
03 Mar 2019 19:02 #127624 by smgvbest
Replied by smgvbest on topic Axis Scaling in 2.1.6
As I understand the 440 it only supports the harmonic 4th axis
so for any mill other than the 440 you have 2 options for 4th axis, Duality and a normal 4th axis. on the 440 you have only the duality (ie harmonic) axis

that's the way I ready it anyways so if you're adding a 4th axis that is not a duality then you would still use the harmonic axis setting and not scale.

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

Moderators: cncbasher
Time to create page: 0.109 seconds
Powered by Kunena Forum