Gmoccapy - A new screen for linuxcnc

More
20 Mar 2014 15:30 #45009 by DaBit

P.S: If someone can send me an encoder for my lathe, I would be able to test ;-)


I do have a couple 1000lpr (4000ppr) encoders on my shelf...

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

More
20 Mar 2014 20:14 #45012 by andypugh

: If someone can send me an encoder for my lathe, I would be able to test ;-)


The setup here has been superseded and is available if you want it:
picasaweb.google.com/lh/photo/_hlZumHKbs...pFm0?feat=directlink

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

More
21 Mar 2014 00:38 #45017 by newbynobi
Dabit and Andi

You got mail

Norbert

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

More
21 Mar 2014 11:13 #45020 by jbunch
Norbert,

I have removed all the additional code from the spindle and connections to gmoccapy.
The behaivior is still the same.

I can run a program when the spindle is running CW.
I am unable to run a program when the spindle is running CCW.

will this behaivior cause a tool to break when ridged tapping?
It may not reverse out but the spindle will still rotate.

I am unable to test this as I have always had problems with ridged taping.
Single point threading is ok.

Jim

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

More
21 Mar 2014 20:23 #45029 by newbynobi
Please post you complete config folder.

What if you start it with axis?
What does the basic test program?

Norbert

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

More
22 Mar 2014 00:20 - 22 Mar 2014 00:39 #45042 by jbunch
Norbert,

I have changed to the AXIS interface and I am now able to face with the spindle running CCW.

I am using NGCGUI to create the program. I am using the facing program.


Jim
Last edit: 22 Mar 2014 00:39 by jbunch.

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

More
22 Mar 2014 04:56 - 22 Mar 2014 04:57 #45070 by newbynobi
Halo Jim,

Even if you do not answer all my questions, i will try to find out where the differences are. This will take a while, as i will get some hardware from Andi and will need some time to add that to my lathe.

So be patient.

It is strange to search an error without detailed information andthe needed hardware.

Norbert
Last edit: 22 Mar 2014 04:57 by newbynobi.

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

More
22 Mar 2014 12:45 #45084 by mariusl
Hi Norbert

I did a new config again. This time as you suggested.

I used stepconf of the master branch that I am using
I copied the config from /linuxcnc/configs/ to my config directory
I put the gmoccapy display section in

And I have the long number over the screen again. I looked at the [TRAJ] section and stepconf generates the [TRAJ]MAX_LINEAR_VELOCITY. You mentioned last time that this should not exist but it does and is created by stepconf. Is it a bug in stepconf?

Regards
Marius


www.bluearccnc.com

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

More
22 Mar 2014 13:01 #45085 by jbunch
Norbert,

I am unsure of what you are looking for.

When you ask for AXIS are you refering to the interface or the machine axis or joint?

If it is the interface AXIS I have reconfigured and started and run under this interface today and all works.

If you are talking about the axis or joints the CCW problem exists under both the X and the Z axis using gmoccapy.

If you are refering to the generated G cod. I used NGCGUI to generate the code both turning and facing with the spindle running CCW.
The problem exists for both axis or joints.

When talking about the config folder. Are you refering to the file names or all the data in the files?

Here is the files in config:

jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ ls -l
total 80
-rw-r--r-- 1 jimbo jimbo 1667 2014-03-21 23:00 emc.var
-rw-r--r-- 1 jimbo jimbo 1667 2014-03-21 23:00 emc.var.bak
-rw-r--r-- 1 jimbo jimbo 1541 2014-03-21 12:18 gmoccapy_preferences
-rw-r--r-- 1 jimbo jimbo 182 2014-03-21 23:00 position.txt
-rw-r--r-- 1 jimbo jimbo 5877 2013-12-24 16:31 pyngcgui_gmoccapy.ini
-rw-r--r-- 1 jimbo jimbo 5891 2013-12-24 16:31 pyngcgui_gmoccapy_with_popupkeyboard.ini
-rw-r--r-- 1 jimbo jimbo 1115 2013-12-24 16:31 pyngcgui_popupkeyboard.ui
-rw-r--r-- 1 jimbo jimbo 1116 2013-12-24 16:31 pyngcgui.ui
drwxr-xr-x 5 jimbo jimbo 4096 2014-03-21 12:22 save
-rw-r--r-- 1 jimbo jimbo 524 2014-02-10 12:31 tool.tbl
-rw-r--r-- 1 jimbo jimbo 240 2013-04-10 12:52 tool.tbl.bak
-rw-r--r-- 1 jimbo jimbo 12617 2014-03-21 12:05 yam-lathe.hal
-rw-r--r-- 1 jimbo jimbo 4679 2014-03-21 12:03 yam-lathe.ini
-rw-r--r-- 1 jimbo jimbo 2373 2014-03-21 12:04 yam-postgui.hal


Here is some data that is sent to the terminal window when I start and stop gmoccapy:
jimbo@jimbo-lathe:~$ cat runtime_terminal
LINUXCNC - 2.6.0~pre
Machine configuration directory is '/home/jimbo/linuxcnc/configs/yam_lathe'
Machine configuration file is 'yam-lathe.ini'
Starting LinuxCNC...
io started
halcmd loadusr io started
task pid=27714
emcTaskInit: using builtin interpreter
/home/jimbo/linuxcnc-dev/bin/gmoccapy:151: GtkWarning: gtk_widget_grab_default: assertion `gtk_widget_get_can_default (widget)' failed
  self.builder.add_from_file(XMLNAME)
**** GMOCCAPY GETINIINFO **** 
 Preference file path: gmoccapy_preferences
/home/jimbo/linuxcnc-dev/bin/gmoccapy:214: GtkWarning: Invalid icon size 48

  self.widgets.window1.show()
**** GMOCCAPY INFO ****
**** No screen 2 glade file present ****
toolfile: /home/jimbo/linuxcnc/configs/yam_lathe/tool.tbl
**** GMOCCAPY INFO ****
**** audio available! ****
WARNING:Config:Can't load Default loading default layout instead
Xlib.protocol.request.QueryExtension
pyngcgui:INTFC:linuxcnc running=1
pyngcgui:INTFC:ini_file=</home/jimbo/linuxcnc/configs/yam_lathe/yam-lathe.ini>
**** GMOCCAPY INFO ****
**** no valid probe config in INI File ****
**** disabled tool measurement ****

(gmoccapy:27715): GtkSourceView-CRITICAL **: gtk_source_language_manager_set_search_path: assertion `lm->priv->ids == NULL' failed
**** GMOCCAPY INFO : inifile = /home/jimbo/linuxcnc/configs/yam_lathe/yam-lathe.ini ****:
**** GMOCCAPY INFO : postgui halfile = yam-postgui.hal ****:
/usr/lib/python2.6/dist-packages/Onboard/KeyGtk.py:43: PangoWarning: pango_font_description_set_size: assertion `size >= 0' failed
  font_description.set_size(self.font_size)
Emit interp-run
1 2
Emit interp-run
Emit interp-run
file name: 
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
Settings say: do not use keyboard shortcuts, aboart
pyngcgui:SENT: /home/jimbo/linuxcnc/nc_files/0.auto.ngc
pyngcgui:SENT:using: default_send
Emit interp-run
Emit interp-run
2 2
G-Code error in face.ngc
Near line 46 of
/home/jimbo/linuxcnc/nc_files/ngcgui_files/face.ngc
File ended with no percent sign or program end

Emit interp-run
toolfile: /home/jimbo/linuxcnc/configs/yam_lathe/tool.tbl
toolfile: /home/jimbo/linuxcnc/configs/yam_lathe/tool.tbl
/home/jimbo/linuxcnc-dev/lib/python/gmoccapy/notification.py:155: GtkWarning: Invalid icon size 48

  self.popup.show()
file name: /home/jimbo/linuxcnc/nc_files/0.auto.ngc
/home/jimbo/linuxcnc-dev/bin/gmoccapy:3677: GtkWarning: Invalid icon size 48

  gtk.main()
quit from <btn_exit>
estopping / killing gmoccapy
Exception TypeError: TypeError("'NoneType' object is not callable",) in <bound method Popen.__del__ of <subprocess.Popen object at 0xb61c8fec>> ignored
Shutting down and cleaning up LinuxCNC...
Running HAL shutdown script
Could not open command file 'shutdown.hal'
Cleanup done

I understand ths is frustrating but there are many definitions under linuxcnc that are the same.

Thank You.
Jim

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

More
22 Mar 2014 13:12 #45086 by jbunch
Norbert,
jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ cat emc.var
5161	0.000000
5162	0.000000
5163	0.000000
5164	0.000000
5165	0.000000
5166	0.000000
5167	0.000000
5168	0.000000
5169	0.000000
5181	0.000000
5182	0.000000
5183	0.000000
5184	0.000000
5185	0.000000
5186	0.000000
5187	0.000000
5188	0.000000
5189	0.000000
5210	0.000000
5211	0.000000
5212	0.000000
5213	0.000000
5214	0.000000
5215	0.000000
5216	0.000000
5217	0.000000
5218	0.000000
5219	0.000000
5220	1.000000
5221	0.000000
5222	0.000000
5223	10.907998
5224	0.000000
5225	0.000000
5226	0.000000
5227	0.000000
5228	0.000000
5229	0.000000
5230	0.000000
5241	0.000000
5242	0.000000
5243	0.000000
5244	0.000000
5245	0.000000
5246	0.000000
5247	0.000000
5248	0.000000
5249	0.000000
5250	0.000000
5261	0.000000
5262	0.000000
5263	0.000000
5264	0.000000
5265	0.000000
5266	0.000000
5267	0.000000
5268	0.000000
5269	0.000000
5270	0.000000
5281	0.000000
5282	0.000000
5283	0.000000
5284	0.000000
5285	0.000000
5286	0.000000
5287	0.000000
5288	0.000000
5289	0.000000
5290	0.000000
5301	0.000000
5302	0.000000
5303	0.000000
5304	0.000000
5305	0.000000
5306	0.000000
5307	0.000000
5308	0.000000
5309	0.000000
5310	0.000000
5321	0.000000
5322	0.000000
5323	0.000000
5324	0.000000
5325	0.000000
5326	0.000000
5327	0.000000
5328	0.000000
5329	0.000000
5330	0.000000
5341	0.000000
5342	0.000000
5343	0.000000
5344	0.000000
5345	0.000000
5346	0.000000
5347	0.000000
5348	0.000000
5349	0.000000
5350	0.000000
5361	0.000000
5362	0.000000
5363	0.000000
5364	0.000000
5365	0.000000
5366	0.000000
5367	0.000000
5368	0.000000
5369	0.000000
5370	0.000000
5381	0.000000
5382	0.000000
5383	0.000000
5384	0.000000
5385	0.000000
5386	0.000000
5387	0.000000
5388	0.000000
5389	0.000000
5390	0.000000
imbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ cat emc.var.bak
5161	0.000000
5162	0.000000
5163	0.000000
5164	0.000000
5165	0.000000
5166	0.000000
5167	0.000000
5168	0.000000
5169	0.000000
5181	0.000000
5182	0.000000
5183	0.000000
5184	0.000000
5185	0.000000
5186	0.000000
5187	0.000000
5188	0.000000
5189	0.000000
5210	0.000000
5211	0.000000
5212	0.000000
5213	0.000000
5214	0.000000
5215	0.000000
5216	0.000000
5217	0.000000
5218	0.000000
5219	0.000000
5220	1.000000
5221	0.000000
5222	0.000000
5223	10.907998
5224	0.000000
5225	0.000000
5226	0.000000
5227	0.000000
5228	0.000000
5229	0.000000
5230	0.000000
5241	0.000000
5242	0.000000
5243	0.000000
5244	0.000000
5245	0.000000
5246	0.000000
5247	0.000000
5248	0.000000
5249	0.000000
5250	0.000000
5261	0.000000
5262	0.000000
5263	0.000000
5264	0.000000
5265	0.000000
5266	0.000000
5267	0.000000
5268	0.000000
5269	0.000000
5270	0.000000
5281	0.000000
5282	0.000000
5283	0.000000
5284	0.000000
5285	0.000000
5286	0.000000
5287	0.000000
5288	0.000000
5289	0.000000
5290	0.000000
5301	0.000000
5302	0.000000
5303	0.000000
5304	0.000000
5305	0.000000
5306	0.000000
5307	0.000000
5308	0.000000
5309	0.000000
5310	0.000000
5321	0.000000
5322	0.000000
5323	0.000000
5324	0.000000
5325	0.000000
5326	0.000000
5327	0.000000
5328	0.000000
5329	0.000000
5330	0.000000
5341	0.000000
5342	0.000000
5343	0.000000
5344	0.000000
5345	0.000000
5346	0.000000
5347	0.000000
5348	0.000000
5349	0.000000
5350	0.000000
5361	0.000000
5362	0.000000
5363	0.000000
5364	0.000000
5365	0.000000
5366	0.000000
5367	0.000000
5368	0.000000
5369	0.000000
5370	0.000000
5381	0.000000
5382	0.000000
5383	0.000000
5384	0.000000
5385	0.000000
5386	0.000000
5387	0.000000
5388	0.000000
5389	0.000000
5390	0.000000

jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ cat  gmoccapy_preferences
[DEFAULT]
unlock_way = no
rel_color = black
max_messages = 10.0
show_preview_on_offset = False
jump_to_dir = /home/jimbo
show_keyboard_on_offset = True
spindle_bar_max = 2000.0
homed_color = green
height = 750.0
system_name_g92 = G92
logo = False
system_name_g59.2 = G59.2
system_name_g59.3 = G59.3
audio_error = /usr/share/sounds/ubuntu/stereo/dialog-question.ogg
log_actions = False
view_tool_path = True
scale_max_vel = 4.2
width = 979.0
open_file = 
abs_color = blue
show_offsets = False
system_name_g59 = G59
system_name_g58 = G58
show_keyboard_on_mdi = True
spindle_start_rpm = 300.0
view_dimension = True
gremlin_view = rbt_view_y2
scale_spindle_override = 1.0
system_name_tool = Tool
system_name_g54 = G54
system_name_rot = Rot
system_name_g56 = G56
message_font = sans 10
x_pos = 10.0
y_pos = 10.0
dtg_color = yellow
unlock_code = 123
unhomed_color = red
screen1 = fullscreen
use_keyboard_shortcuts = False
x_pos_popup = 15.0
spindle_bar_min = 0.0
enable_dro = False
audio_alert = /usr/share/sounds/ubuntu/stereo/bell.ogg
use_screen2 = False
opstop = True
show_keyboard_on_file_selection = False
grid_size = 1.0
scale_feed_override = 1.0
use_frames = True
system_name_g55 = G55
y_pos_popup = 55.0
show_keyboard_on_edit = True
run_from_line = no_run
blockdel = False
gtk_theme = Follow System Theme
system_name_g5x = G5x
system_name_g57 = G57
hide_cursor = False
use_auto_units = True
width_popup = 250.0
show_keyboard_on_tooledit = False
show_dro_btn = False
system_name_g59.1 = G59.1
show_dtg = False
scale_jog_vel = 0.6
view = p
jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ cat position.txt
-2.65049115913555955
0.00000000000000000
-1.67096977329974794
0.00000000000000000
0.00000000000000000
0.00000000000000000
0.00000000000000000
0.00000000000000000
0.00000000000000000
jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ cat tool.tbl
T1 P1 D0.015000 X-4.958000 Z-12.569000 Q3 ;turning tool                       
T2 P2 ;1/16 end mill                       
T3 P3 X-5.761500 Z-11.620400 Q2 ;boring bar 1                       
T4 P4 ;big tool number                       
T5 P5 X-5.250000 Z-10.000000 ;tap holder                  
T6 P6 D0.009000 X-5.000000 Z-11.157100 Q2 ;1/2 inch boring bar                       
T7 P7 X-5.250000 Z-11.000000 Q6 ;threading tool                       
T9 P9 D0.031200 X-5.100000 Z-10.322385 Q3 ;turningTool   
jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ cat yam-lathe.hal
# Generated by PNCconf at Fri Sep  2 04:29:39 2011
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hostmot2
loadrt hm2_pci config="firmware=hm2/5i20/SVST8_4.BIT num_encoders=5 num_pwmgens=4 num_stepgens=0" 
    setp hm2_5i20.0.pwmgen.pwm_frequency 100000
    setp hm2_5i20.0.pwmgen.pdm_frequency 100000
    setp hm2_5i20.0.watchdog.timeout_ns 10000000
loadrt near

# ****************** Jog Pendant ******************
loadrt mux8 count=1
loadrt and2 count=15
loadrt or2 count=6 
loadrt not count=2
loadrt mult2 count=1             
loadrt xor2 count=2
loadrt toggle count=1
loadrt toggle2nist count=3

addf hm2_5i20.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
loadrt pid num_chan=3
addf pid.0.do-pid-calcs servo-thread
addf pid.1.do-pid-calcs servo-thread
addf pid.2.do-pid-calcs servo-thread

addf or2.0 servo-thread
addf or2.1 servo-thread
addf or2.2 servo-thread
addf or2.3 servo-thread
addf or2.4 servo-thread
addf or2.5 servo-thread
addf and2.0 servo-thread      # Postgui jog
addf and2.1 servo-thread      # Postgui Jog
addf and2.2 servo-thread      # Postgui
addf and2.3 servo-thread      # Foot Switch
addf and2.4 servo-thread      # Interlock mode.is-idle and Cycle start button
addf and2.5 servo-thread      # Interlok Mode auto output pin to mode.is-auto
addf and2.6 servo-thread      # program.is-idle lockout
addf and2.7 servo-thread      # program.is-idle lockout
addf and2.8 servo-thread      # program.is-running run program lockout
addf and2.9 servo-thread      # program.is-running program is paused lockout
addf and2.10 servo-thread     # Cycle start Button
addf and2.11 servo-thread     # Program Paused
addf and2.12 servo-thread     # Spindle Near cmd
addf and2.13 servo-thread     # Program pause button
addf and2.14 servo-thread     # Program pause/resume button 
addf mux8.0 servo-thread
addf not.0 servo-thread       # Invert mode.is-idle
addf not.1 servo-thread       # Invert program.is-running
addf xor2.0 servo-thread          # Foot Switch
addf xor2.1 servo-thread          # Foot Switch
addf mult2.0 servo-thread         # Spindle RPM
addf toggle.0 servo-thread
addf toggle2nist.0 servo-thread

alias pin    pid.0.Pgain         pid.x.Pgain
alias pin    pid.0.Igain         pid.x.Igain
alias pin    pid.0.Dgain         pid.x.Dgain
alias pin    pid.0.bias          pid.x.bias
alias pin    pid.0.FF0           pid.x.FF0
alias pin    pid.0.FF1           pid.x.FF1
alias pin    pid.0.FF2           pid.x.FF2
alias pin    pid.0.deadband      pid.x.deadband
alias pin    pid.0.maxoutput     pid.x.maxoutput
alias pin    pid.0.enable        pid.x.enable
alias pin    pid.0.command       pid.x.command
alias pin    pid.0.feedback      pid.x.feedback
alias pin    pid.0.output        pid.x.output
alias pin    pid.0.index-enable  pid.x.index-enable

alias pin    pid.1.Pgain         pid.z.Pgain
alias pin    pid.1.Igain         pid.z.Igain
alias pin    pid.1.Dgain         pid.z.Dgain
alias pin    pid.1.bias          pid.z.bias
alias pin    pid.1.FF0           pid.z.FF0
alias pin    pid.1.FF1           pid.z.FF1
alias pin    pid.1.FF2           pid.z.FF2
alias pin    pid.1.deadband      pid.z.deadband
alias pin    pid.1.maxoutput     pid.z.maxoutput
alias pin    pid.1.enable        pid.z.enable
alias pin    pid.1.command       pid.z.command
alias pin    pid.1.feedback      pid.z.feedback
alias pin    pid.1.output        pid.z.output
alias pin    pid.1.index-enable  pid.z.index-enable


addf near.0                   servo-thread
addf hm2_5i20.0.write         servo-thread
addf hm2_5i20.0.pet_watchdog  servo-thread

# external output signals



# external input signals


# --- HOME-X ---
net home-x     <=  hm2_5i20.0.gpio.030.in
# --- HOME-Z ---
net home-z     <=  hm2_5i20.0.gpio.031.in
# --- BOTH-X ---
net both-x     <=  hm2_5i20.0.gpio.028.in
# --- BOTH-Z ---
net both-z     <=  hm2_5i20.0.gpio.029.in
# --- ESTOP-EXT ---
net estop-ext     <=  hm2_5i20.0.gpio.048.in

#*******************
#  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
net x-index-enable  <=>  pid.x.index-enable

# PWM Generator signals/setup

    setp hm2_5i20.0.pwmgen.00.output-type 1
    setp hm2_5i20.0.pwmgen.00.scale  [AXIS_0]OUTPUT_SCALE
net xenable     => pid.x.enable
net xoutput     pid.x.output           => hm2_5i20.0.pwmgen.00.value
net xpos-cmd    axis.0.motor-pos-cmd   => pid.x.command
net xenable     axis.0.amp-enable-out  => hm2_5i20.0.pwmgen.00.enable

# ---Encoder feedback signals/setup---

    setp hm2_5i20.0.encoder.00.counter-mode 0
    setp hm2_5i20.0.encoder.00.filter 1
    setp hm2_5i20.0.encoder.00.index-invert 0
    setp hm2_5i20.0.encoder.00.index-mask 0
    setp hm2_5i20.0.encoder.00.index-mask-invert 0
    setp hm2_5i20.0.encoder.00.scale  [AXIS_0]INPUT_SCALE
net xpos-fb               <=  hm2_5i20.0.encoder.00.position
net xpos-fb               =>  pid.x.feedback
net xpos-fb               =>  axis.0.motor-pos-fb
net x-index-enable    axis.0.index-enable  <=>  hm2_5i20.0.encoder.00.index-enable

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

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

#*******************
#  AXIS Z
#*******************

    setp pid.z.Pgain     [AXIS_2]P
    setp pid.z.Igain     [AXIS_2]I
    setp pid.z.Dgain     [AXIS_2]D
    setp pid.z.bias      [AXIS_2]BIAS
    setp pid.z.FF0       [AXIS_2]FF0
    setp pid.z.FF1       [AXIS_2]FF1
    setp pid.z.FF2       [AXIS_2]FF2
    setp pid.z.deadband  [AXIS_2]DEADBAND
    setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
net z-index-enable  <=>  pid.z.index-enable

# PWM Generator signals/setup

    setp hm2_5i20.0.pwmgen.01.output-type 1
    setp hm2_5i20.0.pwmgen.01.scale  [AXIS_2]OUTPUT_SCALE
net zenable     => pid.z.enable
net zoutput     pid.z.output           => hm2_5i20.0.pwmgen.01.value
net zpos-cmd    axis.2.motor-pos-cmd   => pid.z.command
net zenable     axis.2.amp-enable-out  => hm2_5i20.0.pwmgen.01.enable

# ---Encoder feedback signals/setup---

    setp hm2_5i20.0.encoder.01.counter-mode 0
    setp hm2_5i20.0.encoder.01.filter 1
    setp hm2_5i20.0.encoder.01.index-invert 0
    setp hm2_5i20.0.encoder.01.index-mask 0
    setp hm2_5i20.0.encoder.01.index-mask-invert 0
    setp hm2_5i20.0.encoder.01.scale  [AXIS_2]INPUT_SCALE
net zpos-fb               <=  hm2_5i20.0.encoder.01.position
net zpos-fb               =>  pid.z.feedback
net zpos-fb               =>  axis.2.motor-pos-fb
net z-index-enable    axis.2.index-enable  <=>  hm2_5i20.0.encoder.01.index-enable

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

net home-z     =>  axis.2.home-sw-in
net both-z     =>  axis.2.neg-lim-sw-in
net both-z     =>  axis.2.pos-lim-sw-in




#*******************
#  SPINDLE S
#*******************

loadrt abs count=7
loadrt scale count=2
loadrt sum2 count=1
addf scale.0 servo-thread
addf scale.1 servo-thread    # Scale for To RPM
addf abs.0 servo-thread      # change RPM in yam-postgui.hal
addf abs.1 servo-thread      # Not used
addf abs.2 servo-thread      # spindle speed PID output correction
addf abs.3 servo-thread      # not used
addf abs.4 servo-thread      # Not used
addf abs.5 servo-thread      # Not Used
addf abs.6 servo-thread      # Not Used
addf sum2.0 servo-thread


setp pid.2.Pgain          0.0000000000
setp pid.2.Igain          0.000000000
setp pid.2.Dgain          0.0000
setp pid.2.bias           0.0
setp pid.2.FF0            0.00000050
setp pid.2.FF1            0.0
setp pid.2.FF2            0.01
setp pid.2.deadband       0.1
setp pid.2.maxoutput      10.00

# ---Encoder feedback signals/setup---

setp hm2_5i20.0.encoder.02.counter-mode 0
setp hm2_5i20.0.encoder.02.filter 0
setp hm2_5i20.0.encoder.02.index-invert 0
setp hm2_5i20.0.encoder.02.index-mask 0
setp hm2_5i20.0.encoder.02.index-mask-invert 0
setp hm2_5i20.0.encoder.02.scale 2000 

net spindle-index-enable     <=>  hm2_5i20.0.encoder.02.index-enable 
net spindle-revs             <=>  hm2_5i20.0.encoder.02.position 

# ---setup spindle control signals---

net spindle-enable         <=  motion.spindle-on
net spindle-cw             <=  motion.spindle-forward
net spindle-ccw            <=  motion.spindle-reverse
net spindle-brake          <=  motion.spindle-brake
net spindle-revs           =>  motion.spindle-revs
net spindle-index-enable       <=> motion.spindle-index-enable
net spindle-speed-out abs.2.in <=  motion.spindle-speed-out


# Change velocity to RPM 

setp scale.1.gain 60

net spindle-velocity motion.spindle-speed-in near.0.in2 scale.1.in <= hm2_5i20.0.encoder.02.velocity

# End Velocity to RPM


# *** Spindle speed control
# PWM Generator signals/setup

setp hm2_5i20.0.pwmgen.02.output-type 1
setp hm2_5i20.0.pwmgen.02.scale  0.00094
net spindle-enable  hm2_5i20.0.pwmgen.02.enable <= pid.2.enable
net spindle-vel-cmd pid.2.command  <= abs.2.out
net spin-pid-out pid.2.output hm2_5i20.0.pwmgen.02.value 

# *** End


# *** spindle at speed

setp near.0.scale 1.2
net spindle_speed_reqst_scaled  near.0.in1 <=  motion.spindle-speed-cmd-rps 
#net spindle_ena_spindle_spd and2.12.in1 <= near.0.out
#net spindle_for_rev and2.12.in0 and2.3.in1 <= or2.5.out

#setp near.0.scale 1.2
#net spindle_speed_reqst_scaled  near.0.in1 <=  motion.spindle-speed-cmd-rps 
#net spindle_ena_spindle_spd and2.12.in1 <= near.0.out
#net spindle_for_rev and2.12.in0 and2.3.in1 <= or2.5.out
# *** End Spindle at speed

##### Foot switch reverse on spindle  

#net foot_Switch_on and2.3.in0 <= hm2_5i20.0.gpio.061.in_not
#net foot_sw_on_xor xor2.0.in1 xor2.1.in1 <= and2.3.out
#net foot_spindle_fwd xor2.0.in0 or2.5.in0 <= halui.spindle.runs-forward
#net foot_spindle_bak xor2.1.in0 or2.5.in1 <= halui.spindle.runs-backward

##### End foot switch
##### Start spindle F/R Control pins to VFD

net spindle-fwd hm2_5i20.0.gpio.040.out <= halui.spindle.runs-forward
net spindle-bkwd hm2_5i20.0.gpio.042.out <= halui.spindle.runs-backward

#net spindle-fwd hm2_5i20.0.gpio.040.out <= xor2.0.out
#net spindle-bkwd hm2_5i20.0.gpio.042.out <= xor2.1.out

##### End spindle F/R control pins



#******* Cycle Start feed Hold section ****************
#******** Cycle start and resume 

net push_cycle_start and2.4.in1 and2.5.in1 <= hm2_5i20.0.gpio.060.in_not
net auto_mode_is_set and2.4.in0 not.0.in <= halui.mode.is-auto
net invert_auto_mode and2.5.in0 <= not.0.out
net sel_auto_mode halui.mode.auto <= and2.5.out
net interlock_auto_mode and2.6.in0 and2.7.in0 <= and2.4.out
net pgm_is_idle and2.6.in1 <= halui.program.is-idle
net pgm_is_paused and2.7.in1 <= halui.program.is-paused
net pgm_is_running_invert not.1.in <= halui.program.is-running
net pgm_is_running and2.8.in0 and2.9.in0 <= not.1.out
net pgm_idle_interlock and2.8.in1 <= and2.6.out
net pgm_paused_interlock and2.9.in1 <= and2.7.out
net start_run_pgm halui.program.run <= and2.8.out
net Resume_running_pgm halui.program.resume <= and2.9.out

#******** End Cycle Start and resume
#******** start pause program/Feed hold

net pgm_pause halui.program.pause <=  hm2_5i20.0.gpio.059.in_not

#******* End Pause PGM/Feed Hold




#******************************
# connect miscellaneous signals
#******************************

#  ---coolant signals---

net coolant-mist      <=  iocontrol.0.coolant-mist
net coolant-flood     <=  iocontrol.0.coolant-flood

#  ---probe signal---

net probe-in     =>  motion.probe-input


#  ---digital in / out signals---

#  ---estop signals---

net estop-out     <=  iocontrol.0.user-enable-out
net estop-ext     =>  iocontrol.0.emc-enable-in

#  ---manual tool change signals---
#  ---manual tool change signals---

#loadusr -W hal_manualtoolchange
#net tool-change-request     iocontrol.0.tool-change       =>  hal_manualtoolchange.change
#net tool-change-confirmed   iocontrol.0.tool-changed      <=  hal_manualtoolchange.changed
#net tool-number             iocontrol.0.tool-prep-number  =>  hal_manualtoolchange.number
#net tool-prepare-loopback   iocontrol.0.tool-prepare      =>  iocontrol.0.tool-prepared


#  ----- SETUP Outputs ------
setp hm2_5i20.0.gpio.040.is_output 1
setp hm2_5i20.0.gpio.040.invert_output 1

setp hm2_5i20.0.gpio.042.is_output 1
setp hm2_5i20.0.gpio.042.invert_output 1
jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ cat yam-lathe.ini
# Generated by PNCconf at Fri Sep  2 04:29:39 2011
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

[EMC]
VERSION = pyngcgui
MACHINE = yam-lathe
DEBUG = 0

[MACROS]

[DISPLAY]
DISPLAY = gmoccapy
PREFERENCE_FILE_PATH = gmoccapy_preferences
LATHE = 1
BACK_TOOL_LATHE = 1
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.000000
MAX_SPINDLE_OVERRIDE = 1.000000
MIN_SPINDLE_OVERRIDE = 0.500000
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 5
INCREMENTS = .1in .01in .001in .0001in
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 0.250000
MAX_LINEAR_VELOCITY = 1.000000
MIN_LINEAR_VELOCITY = 0.010000
DEFAULT_ANGULAR_VELOCITY = 0.250000
MAX_ANGULAR_VELOCITY = 1.000000
MIN_ANGULAR_VELOCITY = 0.010000
EDITOR = gedit
GEOMETRY = xz


TOOL_EDITOR = tooledit TOOL POC X Z DIAM FRONT BACK ORIEN COMMENT

#NGCGUI_OPTIONS   = opt1 opt2 ...
# opt items:
#   nonew      -- disallow making   new tab page
#   noremove   -- disallow removing any tab page
#   noauto     -- no autosend (makeFile, then manually send)
#   noiframe   -- no internal image, image  on separate toplevel
#   nom2       -- no m2 terminator (use %)
 NGCGUI_PREAMBLE   = lathe_std.ngc
 NGCGUI_SUBFILE    = turn-od.ngc
 NGCGUI_SUBFILE    = bore-id.ngc
 NGCGUI_SUBFILE    = face-part.ngc
 NGCGUI_SUBFILE    = face.ngc
 NGCGUI_SUBFILE    = drill.ngc
 NGCGUI_SUBFILE    = thread.ngc
 NGCGUI_SUBFILE    = tap.ngc

EMBED_TAB_NAME = Functions
EMBED_TAB_LOCATION = ntb_preview
#alternate: EMBED_TAB_LOCATION = ntb_user_tabs
#this demo requires a parallel ngcgui dir
#EMBED_TAB_COMMAND = gladevcp -x {XID} pyngcgui_popupkeyboard.ui
EMBED_TAB_COMMAND = gladevcp -x {XID} pyngcgui.ui

#EMBED_TAB_NAME = Gremlinview
#EMBED_TAB_LOCATION = ntb_preview
# alternate: EMBED_TAB_LOCATION = ntb_user_tabs
# this demo requires a parallel ngcgui dir
#EMBED_TAB_COMMAND = gladevcp -x {XID} gremlin_view.ui

# Prefix to be used
PROGRAM_PREFIX = ../../nc_files/

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

# Task controller section -----------------------------------------------------
[TASK]
TASK = milltask
CYCLE_TIME = 0.010

# Part program interpreter section --------------------------------------------
[RS274NGC]
#RS274NGC_STARTUP_CODE = G17 G20 G40 G43H0 G54 G64P0.005 G80 G90 G94 G97 M5 M9
RS274NGC_STARTUP_CODE = G18 G20 G40 G43 G54 G64P0.005 G80 G90 G94 G97 M5 M9
PARAMETER_FILE = emc.var
SUBROUTINE_PATH = ../../nc_files/ngcgui_files:../../nc_files/subroutines:../../nc_files/ngcgui_lib:../../nc_files/ngcgui_lib/utilitysubs
# USER_M_PATH     = ../../nc_files/ngcgui_lib/mfiles

#  SUBROUTINE_PATH = /home/jimbo/linuxcnc/nc_files/ngcgui_files
USER_M_PATH = ../../../nc_files

# Motion control section ------------------------------------------------------
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
SERVO_PERIOD = 1000000

# [HOSTMOT2]
# This is for info only
# DRIVER0=hm2_pci
# BOARD0=5i20
# CONFIG0="firmware=hm2/5i20/SVST8_4.BIT num_encoders=4 num_pwmgens=4 num_stepgens=0" 

[HAL]
HALUI = halui
HALFILE = yam-lathe.hal
POSTGUI_HALFILE = yam-postgui.hal
SHUTDOWN = shutdown.hal

[HALUI]

[TRAJ]
AXES = 3
COORDINATES = X Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 0.4
MAX_VELOCITY = 7
MAX_LINEAR_VELOCITY = 1.67
POSITION_FILE = position.txt

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
TOOLCHANGE_QUILL_UP = 1

#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
HOME = -.125
FERROR = 0.010
MIN_FERROR = 0.0010
MAX_VELOCITY = 3.5
MAX_ACCELERATION = 4
P = 13.5
I = 0.0012
D = 0.045
FF0 = 0.000
FF1 = 0.065
FF2 = 0.00075
BIAS = 0.0
DEADBAND = 0.0
OUTPUT_SCALE = -1.0
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10.0
INPUT_SCALE = 50900
MIN_LIMIT = -5.625
MAX_LIMIT = .125
HOME_OFFSET = 0.000
HOME_SEARCH_VEL = .500
HOME_LATCH_VEL = .050
HOME_FINAL_VEL = .700
HOME_USE_INDEX = NO
HOME_SEQUENCE = 0

#********************
# Axis Z
#********************
[AXIS_2]
TYPE = LINEAR
HOME = .0625
FERROR = 0.015
MIN_FERROR = 0.002
MAX_VELOCITY = 5
MAX_ACCELERATION = 3.5
P = 24
I = 0.0
D = 0.05
FF0 = 0.0
FF1 = 0.1039
FF2 = 0.00206
BIAS = 0.0
DEADBAND = 0.0
OUTPUT_SCALE = -1.0
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 10.0
INPUT_SCALE = 12704.0
MIN_LIMIT = -13.125
MAX_LIMIT = .0625
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = .500
HOME_LATCH_VEL = .050
HOME_FINAL_VEL = 1.000
HOME_USE_INDEX = NO
HOME_SEQUENCE = 1

#********************
# Spindle 
#********************
[SPINDLE_1]
P = 00.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 0.0
FF2 = 0.000
jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ cat yam-postgui.hal

# Incremental and Velocity jog
   net orvel0 or2.0.in0 <= hm2_5i20.0.gpio.053.in_not
   net orvel1 or2.0.in1 <= hm2_5i20.0.gpio.054.in_not
   net jogactive and2.0.in0 and2.1.in0 and2.2.in0 <= or2.0.out
# End incremental velocity jog

# Start FEED Override

#   net feed_override halui.feed-override.count-enable <= hm2_5i20.0.gpio.055.in_not
#   setp halui.feed-override.scale .00125

# End Feed Override

# Start Spindle override

   net sp_override halui.spindle-override.count-enable <= hm2_5i20.0.gpio.056.in_not
   setp halui.spindle-override.scale .001

# End Spindle override

# Gmoccapy Spindle speed and at speed

net spindle_is_at_speed gmoccapy.spindle_at_speed_led motion.spindle-at-speed <= near.0.out
##net spindle_is_at_speed gmoccapy.spindle_at_speed_led motion.spindle-at-speed <= and2.12.out
net spindle_speeed_positive abs.0.in <= scale.1.out
net spindle_speed_actual gmoccapy.spindle_feedback_bar <= abs.0.out


#  Tool Change

  net tool-change             gmoccapy.toolchange-change     <=   iocontrol.0.tool-change 
  net tool-changed           gmoccapy.toolchange-changed   <=   iocontrol.0.tool-changed
  net tool-prep-number   gmoccapy.toolchange-number    <=   iocontrol.0.tool-prep-number
  net tool-prepare-loopback iocontrol.0.tool-prepare  => iocontrol.0.tool-prepared

# End Tool Change

# Jog increment scale 

   setp mux8.0.in0 0.0
   setp mux8.0.in1 0.000025
   setp mux8.0.in2 0.00025
   setp mux8.0.in3 0.0025
   setp mux8.0.in4 0.025

    
   net sclale_speed_1 or2.1.in0 gmoccapy.jog-inc-4 <= hm2_5i20.0.gpio.049.in_not
   net sclale_speed_2 or2.2.in0 gmoccapy.jog-inc-3 <= hm2_5i20.0.gpio.050.in_not
   net sclale_speed_3 or2.1.in1 or2.2.in1 gmoccapy.jog-inc-2 <= hm2_5i20.0.gpio.051.in_not
   net sclale_speed_4 or2.3.in0 gmoccapy.jog-inc-1 <= hm2_5i20.0.gpio.052.in_not

   net scale1 mux8.0.sel0 <= or2.1.out
   net scale2 mux8.0.sel1 <= or2.2.out
   net scale3 mux8.0.sel2 <= or2.3.out

# End jog increment scale

  net orvel1 => axis.0.jog-vel-mode
  net orvel1 => axis.2.jog-vel-mode

  net pend-scale axis.0.jog-scale <= mux8.0.out
  net pend-scale axis.2.jog-scale

  net mpg-x axis.0.jog-enable <= hm2_5i20.0.gpio.058.in_not
  net mpg-z axis.2.jog-enable <= hm2_5i20.0.gpio.057.in_not

net pend-counts axis.0.jog-counts <= hm2_5i20.0.encoder.04.count 
net pend-counts axis.1.jog-counts
net pend-counts axis.2.jog-counts


jimbo@jimbo-lathe:~/linuxcnc/configs/yam_lathe$ ls -l
total 80
-rw-r--r-- 1 jimbo jimbo 1667 2014-03-21 23:00 emc.var
-rw-r--r-- 1 jimbo jimbo 1667 2014-03-21 23:00 emc.var.bak
-rw-r--r-- 1 jimbo jimbo 1541 2014-03-21 12:18 gmoccapy_preferences
-rw-r--r-- 1 jimbo jimbo 182 2014-03-21 23:00 position.txt
-rw-r--r-- 1 jimbo jimbo 5877 2013-12-24 16:31 pyngcgui_gmoccapy.ini
-rw-r--r-- 1 jimbo jimbo 5891 2013-12-24 16:31 pyngcgui_gmoccapy_with_popupkeyboard.ini
-rw-r--r-- 1 jimbo jimbo 1115 2013-12-24 16:31 pyngcgui_popupkeyboard.ui
-rw-r--r-- 1 jimbo jimbo 1116 2013-12-24 16:31 pyngcgui.ui
drwxr-xr-x 5 jimbo jimbo 4096 2014-03-21 12:22 save
-rw-r--r-- 1 jimbo jimbo 524 2014-02-10 12:31 tool.tbl
-rw-r--r-- 1 jimbo jimbo 240 2013-04-10 12:52 tool.tbl.bak
-rw-r--r-- 1 jimbo jimbo 12617 2014-03-21 12:05 yam-lathe.hal
-rw-r--r-- 1 jimbo jimbo 4679 2014-03-21 12:03 yam-lathe.ini
-rw-r--r-- 1 jimbo jimbo 2373 2014-03-21 12:04 yam-postgui.hal



Jim

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

Moderators: newbynobiHansU
Time to create page: 0.210 seconds
Powered by Kunena Forum