Spindel problems in Gmoccapy

More
01 May 2017 09:20 #92418 by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
Edit spindel hal
# IMHO should be 1.0
setp stepgen.2.position-scale 1

tuned LM circuitry reading with halmeter commanded 200 to closest rpm that is approx 204rpm

So please tell me what to measure and with what instrument.

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

More
01 May 2017 11:55 #92432 by Todd Zuercher
I think the missing link to the puzzle lies somwhere in your postguihal file. What you are missing is the hal pin connection of the spindle speed to the gui's spindle speed input pin.

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

More
01 May 2017 12:01 #92435 by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
net spindle-rpm gmoccapy.spindle_feedback_bar
net spindle-at-speed gmoccapy.spindle_at_speed_led

Spindle hal
net spindle-rpm abs.0.out

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

More
01 May 2017 12:10 #92436 by andypugh
Using Halmeter (or halshow) check if the spindle-rpm signal is non-zero. Check the input and the output of the abs, too.
We know that a good number is coming out of encoder.0.velocity, the question is where it is getting "lost" in the HAL

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

More
01 May 2017 12:20 #92438 by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
commanded 200 rpm
Spindle-rpm 204 rpm
Abs-in 204 rpm
Abs-out 204 rpm

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

More
01 May 2017 13:13 #92444 by andypugh
What number do you see on gmoccapy.spindle_feedback_bar ?

If your HAL file has "net spindle-rpm gmoccapy.spindle_feedback_bar" and you see a number on spindle-rpm and not on gmoccapy.spindle.feedback-bar, then it seems likely that the HAL file isn't being run.

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

More
01 May 2017 13:20 - 01 May 2017 13:43 #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
Last edit: 01 May 2017 13:43 by tecno.

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

More
01 May 2017 14:53 #92448 by andypugh
Which HAL file makes the connections to the spindle speed bar?

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

More
01 May 2017 14:58 #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

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

More
01 May 2017 16:12 #92455 by andypugh
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
halcmd net spindle-rpm gmoccapy.spindle_feedback_bar
Does the speed display start to work?

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

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