Please Help - How to Configure a 5 Axis Head-Head

More
27 Jul 2023 21:08 #276402 by tommylight
Hal is pretty easy
net name-of-connection wire-1 >wire-2
so
net test motion-digital-out.1 paraport.0.out02
Like wiring stuff in electronics.
The following user(s) said Thank You: IronManDylan

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

More
28 Jul 2023 06:58 #276438 by Aciera
I would suggest to use pncconf to create a basic config for your mesa hardware and then modify the created .ini and .hal manually.
That way you start off with a config that you can start up and deal with errors as you add things one by one instead of starting out with a simulation config that is going to have issues all over it.

The 5axis_cmds.hal file has a lot of net setup commands so maybe somewhere in there. Also, the core_servo.hal file has some of the same PID set up as the test.hal file.

Not sure how you got 19 .hal files in your bridgemill config as mine and the one on github has only 2. What version of Linuxcnc are you running and where did you get your 'bridgemill' simulation config from?

First thing to decide is whether you want/need the vismach model. In the '5axisgui.hal' all pins that start with '5axisgui.' are for the vismach model. So, unless you want to add your a-axis to the model, you don't want to add anything here about an a-axis. If you don't want the vismach model then you will need to extract the part of '5axisgui.hal' that calculates the pivot-lenght and passes that to 5axiskins.pivot-length. Also you can remove the line 'net :jy2 joint.6.pos-fb' as you do not seem to have a tandem Y.
 
The following user(s) said Thank You: IronManDylan

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

More
28 Jul 2023 18:35 - 28 Jul 2023 18:41 #276474 by IronManDylan
Aciera
The 19 files also including the .hal file in the folder "hallib". Which based on the name maybe means that that it is just a library and isn't being used idk?  Underneath the main file there are three HAL files. 5axis_cmds.hal, 5axisgui.hal and 5axis_postgui.hal.  5axis_cmds.hal has by far the most set up data in it.  I followed instruction from rodw on this post to download debian bookworm and LinuxCNC 2.9.  Bridgemill came included with that download. 

I created a basic set up using pncconf already, it is a separate config from bridgemill that I called TEST.  It does connect to the Mesa and can jog the linear axis.  Seems like homing will probably work too though I didn't let it reach its limits.  I'm working on trying to figure out how to read this file now so I can bring over what works to the bridgemill config. 

I don't really care either way if vismach is there or not. It doesnt represent my machine, but I guess maybe it would be useful to check out gcode before running it.  Really whatever makes it easier to get the machine up and running. Yeah "net :jy2 joint.6.pos-fb" is what I was reffering to when I said that there wasn't a pin for the A axis we added. I can remove this y2 but do we need to add an A? or is this part of the file just for Vismach and therefore can be ignored? 

Tommy
Okay, I have been chewing on that and I think it is starting to make some sense.  So I think what I need to do it virtually "wire" up the Mesa. 

It seems like these series of code from my TEST config would me doing something like that for the x axis: 
net x-index-enable  =>  pid.x.index-enable
net x-enable        =>  pid.x.enable
net x-pos-cmd       =>  pid.x.command
net x-pos-fb        =>  pid.x.feedback
net x-output        <=  pid.x.output # ---closedloop stepper signals---
net x-pos-cmd    <= joint.0.motor-pos-cmd
net x-vel-cmd    <= joint.0.vel-cmd
net x-output     => hm2_7i96s.0.stepgen.02.velocity-cmd
net x-pos-fb     <= hm2_7i96s.0.stepgen.02.position-fb
net x-pos-fb     => joint.0.motor-pos-fb
net x-enable     <= joint.0.amp-enable-out
net x-enable     => hm2_7i96s.0.stepgen.02.enable # ---setup home / limit switch signals---
net home-x     =>  joint.0.home-sw-in
net x-neg-limit     =>  joint.0.neg-lim-sw-in
net x-pos-limit     =>  joint.0.pos-lim-sw-in

But I am also seeing a bunch of pins created per axis without being "connected" to anything.
[code]setp   pid.x.Pgain     [JOINT_0]P
setp   pid.x.Igain     [JOINT_0]I
setp   pid.x.Dgain     [JOINT_0]D
setp   pid.x.bias      [JOINT_0]BIAS
setp   pid.x.FF0       [JOINT_0]FF0
setp   pid.x.FF1       [JOINT_0]FF1
setp   pid.x.FF2       [JOINT_0]FF2
setp   pid.x.deadband  [JOINT_0]DEADBAND
setp   pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp   pid.x.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp   pid.x.maxerror 0.000500

# Step Gen signals/setup setp  
hm2_7i96s.0.stepgen.02.dirsetup        [JOINT_0]DIRSETUP
setp   hm2_7i96s.0.stepgen.02.dirhold         [JOINT_0]DIRHOLD
setp   hm2_7i96s.0.stepgen.02.steplen         [JOINT_0]STEPLEN
setp   hm2_7i96s.0.stepgen.02.stepspace       [JOINT_0]STEPSPACE
setp   hm2_7i96s.0.stepgen.02.position-scale  [JOINT_0]STEP_SCALE
setp   hm2_7i96s.0.stepgen.02.step_type        0
setp   hm2_7i96s.0.stepgen.02.control-type     1
setp   hm2_7i96s.0.stepgen.02.maxaccel         [JOINT_0]STEPGEN_MAXACCEL
setp   hm2_7i96s.0.stepgen.02.maxvel           [JOINT_0]STEPGEN_MAXVEL
[/code]

And I am also seeing code that seems to set up the connection with the mesa via the ethernet port, this is at the top of the file
[code][code]loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=6 num_pwmgens=1 num_stepgens=9
sserial_port_0=00xxxxxx" 
setp    hm2_7i96s.0.pwmgen.pwm_frequency 20000
setp    hm2_7i96s.0.pwmgen.pdm_frequency 6000000
setp    hm2_7i96s.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.y,pid.z,pid.s

addf hm2_7i96s.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.y.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf hm2_7i96s.0.write         servo-thread
setp hm2_7i96s.0.dpll.01.timer-us -50
setp hm2_7i96s.0.stepgen.timer-number 1
[/code][/code]

My initial thought would be to copy and paste this (I actually tried some of that to no avail) into one of the bridgemill files.  But I don't know which file that should be done to. Where in the file that should be done to. Or wether something else need to be modified or what.  I can look at this code and get kind of a blurry image of what it is doing, but def not clear enough to properly manipulate it. 
Last edit: 28 Jul 2023 18:41 by IronManDylan.

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

More
28 Jul 2023 19:53 #276477 by tommylight
A quick rundown of hal commands:
Loadrt = load a real time component
Addf = add a function to base or servo period
Net = connect 2 or more hal pins
Setp = set a parameter value
Sets = set a signal value
-
Might double check that as i am on the phone.
The following user(s) said Thank You: IronManDylan

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

More
28 Jul 2023 20:02 #276478 by Aciera

do we need to add an A? or is this part of the file just for Vismach and therefore can be ignored? 
 

No, you don't need to add A to the vismach. So for now I would just remove the line referring to y2 and keep the rest.

I followed instruction from rodw on this post to download debian bookworm and LinuxCNC 2.9.  Bridgemill came included with that download. 

No idea how you got those files as 2.9 bridgemill simulation config does not include them:

github.com/LinuxCNC/linuxcnc/tree/2.9/co...ach/5axis/bridgemill

In any case, the point is that you don't need them. So don't let yourself be confused.
The following user(s) said Thank You: IronManDylan

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

More
28 Jul 2023 21:19 - 28 Jul 2023 21:20 #276483 by IronManDylan
Aciera 
Wellll I have no idea either haha.  Here's a list of the files that I have that github doesn't.  Including them for the sake of thoroughness:

5axis.tbl.bak
5axis.var.bak 
5axis.var
5axis_cmds.hal
autosave.halscope
halshow.preferences 
The folder "hallib" with all its .hal files

I am sure some of these are being created by the execution of windows I opened in the axis gui as I was experimenting with stuff (like autosave.halscope for example).  But some of these are really dense files with a lot of pins activated on them. The main example of this is 5axis_cmds.hal.  I am going to include that file if you want to take a peak at it. 

But yeah, that is really confusing. So, would the best thing to do be to use pncconf and select the bridgemill folder and create a new hal file that way? Or perhaps move the TEST.hal file into the bridgemill folder and rename it to, idk? Should I delete all the files that are not on the github? I have created a backup of the config file so I should be able to mess with stuff.  

Another question that is forming in my mind is where is the 5axis TCP kinematics being handled? I guess I assumed it was in the 5axis_cmds.hal file but I don't have any real reason to believe that. 

And lastly, okay I will remove y2.


Tommy
Thanks for the run down, even with that clarification the 5axis_cmds.hal is extremely confusing, but maybe it doesn't even need to be there haha
Attachments:
Last edit: 28 Jul 2023 21:20 by IronManDylan.
The following user(s) said Thank You: tommylight

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

More
29 Jul 2023 00:37 - 29 Jul 2023 00:56 #276500 by IronManDylan
The 5axis_cmds.hal is generated on start up.  I have deleted the file.  I restart bridgemill and it comes back.  I have edited the file.  I restart bridgemill, it deletes all my edits.  This is happening without a network connection. 

I am starting to think something needs to be adjusted with the .ini file to get this working
Last edit: 29 Jul 2023 00:56 by IronManDylan.

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

More
29 Jul 2023 06:11 - 29 Jul 2023 09:05 #276513 by Aciera

# This file: ./5axis_cmds.hal
# Created by: /usr/share/linuxcnc/hallib/basic_sim.tcl


Ah, yes, those files seem to be created by the simulation process itself.  I think this must be dependent on the install method as I usually build linuxcnc from source while you installed from the debian repository. 
My apologies for throwing you on a loop, this is something I was not aware of.
Nonetheless, it confirms that you can ignore those particular hal files.   

[edit]
Just checked and the .._cmd.hal is also created on my installation. x) Learn something new everyday.
Last edit: 29 Jul 2023 09:05 by Aciera.
The following user(s) said Thank You: IronManDylan

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

More
29 Jul 2023 06:17 - 29 Jul 2023 06:24 #276514 by Aciera

Another question that is forming in my mind is where is the 5axis TCP kinematics being handled? I guess I assumed it was in the 5axis_cmds.hal file but I don't have any real reason to believe that. 

 
The kinematics are defined in the [KINS] section of the ini file:

[KINS]
# 5axiskins misnomer 1 more joint for W
 KINEMATICS = 5axiskins
     JOINTS = 6

This will then load the actual file that contains the kinematic model. In the case of 5axiskins it's this one:
github.com/LinuxCNC/linuxcnc/blob/2.9/sr...nematics/5axiskins.c

[edit]
Well, to be precise, that is the source file used by the compiler.
Last edit: 29 Jul 2023 06:24 by Aciera.
The following user(s) said Thank You: IronManDylan

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

More
29 Jul 2023 17:35 #276531 by IronManDylan
No worries, yeah I guess there is some kind of routine for generating that cmds file.  

As far as kinematics goes, is that kins file set up for head-head TCP control? Is it as simple as calling that kins file during initiation then? That seems like it would be too easy.. But if so it should be super easy to set up a new configuration for my 5 axis,  but again, that sounds too easy haha.  It is my understanding that it takes a lot of math to get a machine like this running. 

But we can't edit that cmds file.  So do you have any idea how to modify (what I assume needs to be the .ini file) to get bridgemill talking to the 7i96S_7i85s?  Assuming what I stated above is true and we can't whip up a new file. 

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

Time to create page: 0.387 seconds
Powered by Kunena Forum