- Posts: 1850
- Thank you received: 127
Spindel problems in Gmoccapy
- tecno
- Offline
- Platinum Member
-
Less
More
9 years 6 months ago - 9 years 6 months ago #92445
by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
Halmeter shows
0 on bar and False on LED
INI
[DISPLAY]
#DISPLAY = axis
DISPLAY = gmoccapy
POSTGUI_HALFILE = postgui.hal
#POSTGUI_HALFILE = custom_postgui.hal
HALFILE = base.hal
HALFILE = spindle.hal
0 on bar and False on LED
INI
[DISPLAY]
#DISPLAY = axis
DISPLAY = gmoccapy
POSTGUI_HALFILE = postgui.hal
#POSTGUI_HALFILE = custom_postgui.hal
HALFILE = base.hal
HALFILE = spindle.hal
Last edit: 9 years 6 months ago by tecno.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
9 years 6 months ago #92448
by andypugh
Replied by andypugh on topic Spindel problems in Gmoccapy
Which HAL file makes the connections to the spindle speed bar?
Please Log in or Create an account to join the conversation.
- tecno
- Offline
- Platinum Member
-
Less
More
- Posts: 1850
- Thank you received: 127
9 years 6 months ago #92449
by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
Spindle.hal to postgui.hal
postgui
# link to gmoccapy toolchange, so you get the advantage of tool description on change dialog
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-prep-loop iocontrol.0.tool-prepare <= iocontrol.0.tool-prepared
net tooloffset-x gmoccapy.tooloffset-x <= motion.tooloffset.x
net tooloffset-z gmoccapy.tooloffset-z <= motion.tooloffset.z
net spindle-rpm gmoccapy.spindle_feedback_bar
net spindle-at-speed gmoccapy.spindle_at_speed_led
from spindle.hal
# spindle.hal
# holds all stuff related to the spindle control
# First load all needed rel time components
loadrt encoder num_chan=1
loadrt scale count=1
loadrt near count=1
loadrt abs count=1
# Next add them to a thread so they are updated periodicaly
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
addf scale.0 servo-thread
addf near.0 servo-thread
addf abs.0 servo-thread
# Set initial pin values if needed
# position scale =
# The scaling for position feedback, position command, and velocity command, in steps per length unit.
# IMHO should be 1.0
setp stepgen.2.position-scale 0.9
setp stepgen.2.steplen 5000
setp stepgen.2.stepspace 5000
setp stepgen.2.maxaccel 5000
setp scale.0.gain 60
setp encoder.0.position-scale 1
setp encoder.0.counter-mode 1
# make needed connections to hardware
net spindle-step stepgen.2.step => parport.0.pin-06-out
net spindle-dir stepgen.2.dir => parport.0.pin-07-out
net spindle-signal parport.0.pin-10-in => encoder.0.phase-Z
net spindle-signal encoder.0.phase-A
# internal hal connections
net spindle-index-enable motion.spindle-index-enable <=> encoder.0.index-enable
# encoder velocity is in units per seconds
# we use scale to get it in units per minutes
# in postgui.hal we connect the signal spindle-rpm to the gmoccapy pin
net spindle-rps encoder.0.velocity => scale.0.in
net spindle-rps motion.spindle-speed-in
net spindle-rpm-not_abs abs.0.in <= scale.0.out
net spindle-rpm abs.0.out
net spindle-position encoder.0.position => motion.spindle-revs
net spindle-enable motion.spindle-on => stepgen.2.enable
net spindle-cmd-rpm stepgen.2.velocity-cmd <= motion.spindle-speed-out
#Spindle at speed ?
setp near.0.scale 1.2
setp near.0.difference 10
net spindle-comanded near.0.in1
net spindle-rev_per_min near.0.in2
net spindle-at-speed near.0.out => motion.spindle-at-speed
postgui
# link to gmoccapy toolchange, so you get the advantage of tool description on change dialog
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-prep-loop iocontrol.0.tool-prepare <= iocontrol.0.tool-prepared
net tooloffset-x gmoccapy.tooloffset-x <= motion.tooloffset.x
net tooloffset-z gmoccapy.tooloffset-z <= motion.tooloffset.z
net spindle-rpm gmoccapy.spindle_feedback_bar
net spindle-at-speed gmoccapy.spindle_at_speed_led
from spindle.hal
# spindle.hal
# holds all stuff related to the spindle control
# First load all needed rel time components
loadrt encoder num_chan=1
loadrt scale count=1
loadrt near count=1
loadrt abs count=1
# Next add them to a thread so they are updated periodicaly
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
addf scale.0 servo-thread
addf near.0 servo-thread
addf abs.0 servo-thread
# Set initial pin values if needed
# position scale =
# The scaling for position feedback, position command, and velocity command, in steps per length unit.
# IMHO should be 1.0
setp stepgen.2.position-scale 0.9
setp stepgen.2.steplen 5000
setp stepgen.2.stepspace 5000
setp stepgen.2.maxaccel 5000
setp scale.0.gain 60
setp encoder.0.position-scale 1
setp encoder.0.counter-mode 1
# make needed connections to hardware
net spindle-step stepgen.2.step => parport.0.pin-06-out
net spindle-dir stepgen.2.dir => parport.0.pin-07-out
net spindle-signal parport.0.pin-10-in => encoder.0.phase-Z
net spindle-signal encoder.0.phase-A
# internal hal connections
net spindle-index-enable motion.spindle-index-enable <=> encoder.0.index-enable
# encoder velocity is in units per seconds
# we use scale to get it in units per minutes
# in postgui.hal we connect the signal spindle-rpm to the gmoccapy pin
net spindle-rps encoder.0.velocity => scale.0.in
net spindle-rps motion.spindle-speed-in
net spindle-rpm-not_abs abs.0.in <= scale.0.out
net spindle-rpm abs.0.out
net spindle-position encoder.0.position => motion.spindle-revs
net spindle-enable motion.spindle-on => stepgen.2.enable
net spindle-cmd-rpm stepgen.2.velocity-cmd <= motion.spindle-speed-out
#Spindle at speed ?
setp near.0.scale 1.2
setp near.0.difference 10
net spindle-comanded near.0.in1
net spindle-rev_per_min near.0.in2
net spindle-at-speed near.0.out => motion.spindle-at-speed
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
9 years 6 months ago #92455
by andypugh
Replied by andypugh on topic Spindel problems in Gmoccapy
Are you sure of the file names?
Does anything else in postgui.hal seem to work?
If you open a terminal window while LinuxCNC is running and use the command
Does the speed display start to work?
Does anything else in postgui.hal seem to work?
If you open a terminal window while LinuxCNC is running and use the command
Code:
halcmd net spindle-rpm gmoccapy.spindle_feedback_bar
Please Log in or Create an account to join the conversation.
- tecno
- Offline
- Platinum Member
-
Less
More
- Posts: 1850
- Thank you received: 127
9 years 6 months ago #92456
by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
The other parts in postgui was added by Norbert for future use I suppose.
Will go down to shop and see if there is a way to open terminal i gmocccapy and try
Will go down to shop and see if there is a way to open terminal i gmocccapy and try
Please Log in or Create an account to join the conversation.
- tecno
- Offline
- Platinum Member
-
Less
More
- Posts: 1850
- Thank you received: 127
9 years 6 months ago #92457
by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
No there is not any way to open terminal
Please Log in or Create an account to join the conversation.
Moderators: newbynobi, HansU
Time to create page: 0.733 seconds