NEWS
LinuxCNC 2.5.2 Release
LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 
Home Forum Configuring LinuxCNC PnCConf Wizard help understanding the difference ...

Welcome, Guest
Username: Password: Remember me

TOPIC: help understanding the difference ...

help understanding the difference ... 26 Jul 2011 02:41 #11858

  • 1:1
  • 1:1's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 83
  • Karma: 0
Hello all,

With a goal of making a config with zero extraneous lines of config and/or redundant hal connections I'm trying to understand my pncconf file output and I thought by comparing to a one of the demo configs I might learn something but as it turns out there are differences that are making it confusing...

- The demo config is called 5i22big and is under the Mesa servo tab
- My config was 5 axes XYZA and a servo spindle and what I hoped would be nothing else (to keep things simple)

... but coolant, limits, estop and toolchanger stuff has turned up as has other bits I dont understand yet

Many questions but I'll be methodical and chip away at them one by one - I'll paste one axis of info from each config where I have put the similar stuff I understand at the top of each and the stuff I dont get at the bottom

Firstly from pncconf (you can tell from the alias function replacing the '0' with 'x'):
#*******************
#  AXIS X
#*******************

setp   pid.x.Pgain     [AXIS_0]P
setp   pid.x.Igain     [AXIS_0]I
setp   pid.x.Dgain     [AXIS_0]D
setp   pid.x.bias      [AXIS_0]BIAS
setp   pid.x.FF0       [AXIS_0]FF0
setp   pid.x.FF1       [AXIS_0]FF1
setp   pid.x.FF2       [AXIS_0]FF2
setp   pid.x.deadband  [AXIS_0]DEADBAND
setp   pid.x.maxoutput [AXIS_0]MAX_OUTPUT

setp   hm2_5i22.0.pwmgen.01.output-type 1
setp   hm2_5i22.0.pwmgen.01.scale  [AXIS_0]OUTPUT_SCALE

setp    hm2_5i22.0.encoder.01.counter-mode 0
setp    hm2_5i22.0.encoder.01.filter 1
setp    hm2_5i22.0.encoder.01.index-invert 0
setp    hm2_5i22.0.encoder.01.index-mask 0
setp    hm2_5i22.0.encoder.01.index-mask-invert 0

setp    hm2_5i22.0.encoder.01.scale  [AXIS_0]ENCODER_SCALE

net x-index-enable  <=>  pid.x.index-enable

net xenable     => pid.x.enable
net xoutput     pid.x.output           => hm2_5i22.0.pwmgen.01.value
net xpos-cmd    axis.0.motor-pos-cmd   => pid.x.command
net xenable     axis.0.amp-enable-out  => hm2_5i22.0.pwmgen.01.enable

net xpos-fb               <=  hm2_5i22.0.encoder.01.position
net xpos-fb               =>  pid.x.feedback
net xpos-fb               =>  axis.0.motor-pos-fb
net x-index-enable    axis.0.index-enable  <=>  hm2_5i22.0.encoder.01.index-enable

# ---setup home / limit switch signals---

net x-home-sw     =>  axis.0.home-sw-in
net x-neg-limit     =>  axis.0.neg-lim-sw-in
net x-pos-limit     =>  axis.0.pos-lim-sw-in

Then from the demo config:
# ################
# X [0] Axis
# ################

setp pid.0.Pgain [AXIS_0]P
setp pid.0.Igain [AXIS_0]I
setp pid.0.Dgain [AXIS_0]D
setp pid.0.bias [AXIS_0]BIAS
setp pid.0.FF0 [AXIS_0]FF0
setp pid.0.FF1 [AXIS_0]FF1
setp pid.0.FF2 [AXIS_0]FF2
setp pid.0.deadband [AXIS_0]DEADBAND
setp pid.0.maxoutput [AXIS_0]MAX_OUTPUT

setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.output-type 1 #pwm on pin1, dir on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.scale  [AXIS_0]OUTPUT_SCALE

setp hm2_[HOSTMOT2](BOARD).0.encoder.00.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask-invert 0

setp  hm2_[HOSTMOT2](BOARD).0.encoder.00.scale  [AXIS_0]INPUT_SCALE


# axis enable chain
newsig emcmot.00.enable bit
sets emcmot.00.enable FALSE
net emcmot.00.enable => pid.0.enable
net emcmot.00.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.enable
net emcmot.00.enable <= axis.0.amp-enable-out 


net motor.00.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.00.position => pid.0.feedback
net motor.00.pos-fb => axis.0.motor-pos-fb #push copy back to Axis GUI

net emcmot.00.pos-cmd axis.0.motor-pos-cmd => pid.0.command
net motor.00.command  pid.0.output  =>  hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value

Lots of it is the same - but from the encoder scale down the code unique - Is it doing the same thing ? something different ??

Also one refers to encoder.00 and the other encoder.01 - egad (?)

The links to the .ini files are working - and attached is the .ini from the pncconf file in case its helpful ...

Trying to nail this down ...

Any help appreciated This attachment is hidden for guests. Please log in or register to see it.
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
The administrator has disabled public write access.

Re:help understanding the difference ... 26 Jul 2011 05:30 #11870

  • andypugh
  • andypugh's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4090
  • Thank you received: 139
  • Karma: 129
Many of the sample configs are old. They work, so have not been changed, but anywhere you see "newsig" or "linkps" in a HAL file it is a hint that it is an old config.

Similarly, pncconf uses "alias" extensively to make it easier for the code to create4 a HAL file.

The tersest HAL file will contain only "net", "setp", "loadrt" and "addf" functions.

net allows you to create a signal, and link it to an output pin and to many input pins, all on one line. As an example

net enable axis.0.amp-enable-out => parport.0.pin-01-out parport.0.pin-01-out parport.0.pin-02-out parport.0.pin-03-out

However, terse is not necessarily good. it often makes sense to write the HAL file in blocks, for example defining the hardware IO pins by function all together in one block by assigning them to signal names, then using those signal names in the axis definition blocks.
The administrator has disabled public write access.

Re:help understanding the difference ... 26 Jul 2011 07:23 #11871

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4940
  • Thank you received: 84
  • Karma: 133
I don't even see "alias" mentioned anywhere in the manuals :/

John
The administrator has disabled public write access.

Re:help understanding the difference ... 26 Jul 2011 11:15 #11879

  • 1:1
  • 1:1's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 83
  • Karma: 0
Alias was easy to figure out - but for whatever reason I find it harder to read in the code, there are some lines that appear to have 'x' in it that aren't aliased so I get in a twist...

I'm using 2.5 - maybe thats it

Yes, you're right about making code clear Andy - that was the intention, I was more concerned about the extra hal lines turning up from pncconf and also just making sure for the future when I write some lines of my own I dont fluff it up.

Old code huh ? Oh dear, not much use then right ?

Anyway - at the moment pretty much from "setp hm2_5i22.0.encoder.01.filter 1" down I'm swimming - anyone care to comment it a little ?

Also I dont recall seeing "<=>" in the hal tutorial - it means they mirror each other ?
The administrator has disabled public write access.

Re:help understanding the difference ... 26 Jul 2011 11:24 #11880

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4940
  • Thank you received: 84
  • Karma: 133
1:1 wrote:
Also I dont recall seeing "<=>" in the hal tutorial - it means they mirror each other ?

That one is in the manual :) and to get the basic idea how to read a HAL file read this short section.

www.linuxcnc.org/docview/html/hal_basic_hal.html

John
The administrator has disabled public write access.

Re:help understanding the difference ... 26 Jul 2011 12:57 #11882

  • 1:1
  • 1:1's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 83
  • Karma: 0
Which manual/tutorial/webpage ?

"<=>" doesn't get any hits on a string search on the manuals I have

That basic HAL page is new to me also - so many different places to get all the info...

so for example:
net x-index-enable  <=>  pid.x.index-enable
net x-index-enable    axis.0.index-enable  <=>  hm2_5i22.0.encoder.01.index-enable

a signal called x-index-enable has been made - but the inequalities on both sides mean ??

that signal is then wha ??? :blink:
The administrator has disabled public write access.
Moderators: cmorley
Time to create page: 1.028 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.