Early Omniturn gang lathe to Linuxcnc?

More
7 years 3 weeks ago - 7 years 3 weeks ago #147497 by PCW
I have a J3355B and it has about 100 usec worst case latency..
It may be that my boot options are different, you might try idle=poll,
and if that does not work, try some isolcpus options
Last edit: 7 years 3 weeks ago by PCW. Reason: format better

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

More
7 years 3 weeks ago #147508 by gearheaded
Thanks,

I did some research on what idle=poll is and does and learned some interesting things.

I went ahead and tried idle=poll on boot and it made a significant improvement.

It will take a little figuring how to get my setup online at my dads house, and try youtube vids and such.. The house is set up for wireless and the routers aren't particularly convenient for hooking up my pile of parts. I'll figure something out, but in the meantime, I can run 4 instances of glxgears at under 100us, but on the fourth one, if I resize it, the latency jumps to 142us. However, I learned there are a few other tricks I can try on Intel based boards, so I'm going to try a couple of those now.

Thanks again

Karl

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

More
7 years 3 weeks ago - 7 years 3 weeks ago #147524 by gearheaded
So after some more fiddling around, I think I found a good setup.

First, I checked to see if disabling the c states in BIOS was actually taking place...just to be sure. And indeed, the driver is not loading.

One thing I had noticed, was that glxgears would have a barely noticeable pause each revolution in the animation. Booting with idle=poll got rid of this, but resizing windows would cause the latency to skyrocket.

Adding both isolcpus=1 and idle=poll with the boot makes everything work much smoother, The animations remain smooth even while resizing.

With just idle=poll, the servo thread had good latency, but resizing, or opening other software would cause the base thread to shoot up into the 400us range while the servo thread remained at 140us or so.

With both isolcpus=1 and idle=poll the servo and base thread remain quite tight. With 8 glxgears instances in various window sizes and while being resized and moved around, give max servo jitter of 16.5us and base max jitter of 24.5us.

This would appear to be more than good enough for a +/- 10V signal to my servo drives, from what I have read anyway.

I haven't hooked to the internet yet to try vids and such, but then this computer will be installed in and enclosure and used for nothing except running the lathe, so I'm not sure how important it is to test more...I'm not planning on connecting the board to a network or internet, I'm fine loading programs with USB drive.

So next is to setup the 6I25.

Thanks

Karl
Last edit: 7 years 3 weeks ago by gearheaded.

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

More
7 years 2 weeks ago #148254 by gearheaded
Hello:

I've made it home and hooked everything back up. While in Ca., I tried to try my hand at learning to create GUI interfaces, but didn't realize everything I was reading related to packages not available in the 2.7 distribution. Found myself very confused for awhile, and not able to find any of the files and folders. Finally realized that I could just go ahead and run the newer distribution and finally the widgits are available.

So I spent many hours since I got home tracing the circuits and wiring in the machine, so I can draw up a diagram for interfacing everything. The interface board in the machine, has a convenient 39 pin D-Sub which will allow for a tidy cable to the 7I77.

Interestingly, Omniturn spliced the encoder and tach wires when they extended the servo cables, in such a way, that it was an obvious attempt to make trouble shooting difficult for the owner. Swapping wire colors randomly even though the wire colors and count were the same.

I wired up a Sumtak Optcoder MPG that I salvaged many years ago, using the +5 and Ground from Encoder port 5 on the 7I77. I'm using encoders 0-2 for the x,z, and spindle. A/B of the optcoder are connected to inputs 16/17 and they are configured as MPG.

Only the MPG is connected and I'm trying to get to where I can see the count using HAL.

After completing many Pncconf configs, Linuxcnc always closes before launching. I'm assuming the reason is the line I marked in green and is always in the error message:

Debug file information:
Note: Using POSIX realtime
/Lathe_135.hal:10: Ini variable '[HMOT]CARD0.watchdog.timeout_ns' not found..
2625
Stopping realtime threads
Unloading hal components
RTAPI_PCI: Unmapped 65536 bytes at 0xb66fc000
Note: Using POSIX realtime


So I looked in the Hal .ini file and here is what I believe is the relevant line marked in green:

# Generated by PNCconf at Fri Oct 18 15:46:10 2019
# Using LinuxCNC version: UNAVAILABLE
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_pci config=" num_encoders=3 num_pwmgens=0 num_stepgens=0 sserial_port_0=300xxx"
setp [HMOT]CARD0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.z,pid.s
loadrt mux16 names=jogincr


Anyway, I'm running out of ideas and probably missing something simple. Anyone got any ideas or can help?
More than happy to provide more information if needed.

Thanks

Karl

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

More
7 years 2 weeks ago #148260 by PCW
Can you post your complete HAL and INI files?

The
setp [HMOT]CARD0.watchdog.timeout_ns 5000000
line looks weird/broken like pncconf did not make a proper name substitution

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

More
7 years 2 weeks ago - 7 years 2 weeks ago #148262 by gearheaded
Here is the HAL file:

# Generated by PNCconf at Fri Oct 18 15:46:10 2019
# Using LinuxCNC version: UNAVAILABLE
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_pci config=" num_encoders=3 num_pwmgens=0 num_stepgens=0 sserial_port_0=300xxx"
setp [HMOT]CARD0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.z,pid.s
loadrt mux16 names=jogincr

addf [HMOT]CARD0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf jogincr servo-thread
addf [HMOT]CARD0.write servo-thread

# external output signals


# external input signals


#*******************
# AXIS X JOINT 0
#*******************

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

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

# ---PWM Generator signals/setup---

setp [HMOT]CARD0.7i77.0.1.analogout0-scalemax [JOINT_0]OUTPUT_SCALE
setp [HMOT]CARD0.7i77.0.1.analogout0-minlim [JOINT_0]OUTPUT_MIN_LIMIT
setp [HMOT]CARD0.7i77.0.1.analogout0-maxlim [JOINT_0]OUTPUT_MAX_LIMIT

net x-output => [HMOT]CARD0.7i77.0.1.analogout0
net x-pos-cmd <= joint.0.motor-pos-cmd
net x-enable <= joint.0.amp-enable-out
# enable _all_ sserial pwmgens
net x-enable => [HMOT]CARD0.7i77.0.1.analogena

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

setp [HMOT]CARD0.encoder.00.counter-mode 0
setp [HMOT]CARD0.encoder.00.filter 1
setp [HMOT]CARD0.encoder.00.index-invert 0
setp [HMOT]CARD0.encoder.00.index-mask 0
setp [HMOT]CARD0.encoder.00.index-mask-invert 0
setp [HMOT]CARD0.encoder.00.scale [JOINT_0]ENCODER_SCALE

net x-pos-fb <= [HMOT]CARD0.encoder.00.position
net x-vel-fb <= [HMOT]CARD0.encoder.00.velocity
net x-pos-fb => joint.0.motor-pos-fb
net x-index-enable joint.0.index-enable <=> [HMOT]CARD0.encoder.00.index-enable
net x-pos-rawcounts <= [HMOT]CARD0.encoder.00.rawcounts

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

net x-home-sw => 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

#*******************
# AXIS Z JOINT 1
#*******************

setp pid.z.Pgain [JOINT_1]P
setp pid.z.Igain [JOINT_1]I
setp pid.z.Dgain [JOINT_1]D
setp pid.z.bias [JOINT_1]BIAS
setp pid.z.FF0 [JOINT_1]FF0
setp pid.z.FF1 [JOINT_1]FF1
setp pid.z.FF2 [JOINT_1]FF2
setp pid.z.deadband [JOINT_1]DEADBAND
setp pid.z.maxoutput [JOINT_1]MAX_OUTPUT
setp pid.z.error-previous-target true

net z-index-enable <=> pid.z.index-enable
net z-enable => pid.z.enable
net z-pos-cmd => pid.z.command
net z-pos-fb => pid.z.feedback
net z-output <= pid.z.output

# ---PWM Generator signals/setup---

setp [HMOT]CARD0.7i77.0.1.analogout1-scalemax [JOINT_1]OUTPUT_SCALE
setp [HMOT]CARD0.7i77.0.1.analogout1-minlim [JOINT_1]OUTPUT_MIN_LIMIT
setp [HMOT]CARD0.7i77.0.1.analogout1-maxlim [JOINT_1]OUTPUT_MAX_LIMIT

net z-output => [HMOT]CARD0.7i77.0.1.analogout1
net z-pos-cmd <= joint.1.motor-pos-cmd
net z-enable <= joint.1.amp-enable-out

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

setp [HMOT]CARD0.encoder.01.counter-mode 0
setp [HMOT]CARD0.encoder.01.filter 1
setp [HMOT]CARD0.encoder.01.index-invert 0
setp [HMOT]CARD0.encoder.01.index-mask 0
setp [HMOT]CARD0.encoder.01.index-mask-invert 0
setp [HMOT]CARD0.encoder.01.scale [JOINT_1]ENCODER_SCALE

net z-pos-fb <= [HMOT]CARD0.encoder.01.position
net z-vel-fb <= [HMOT]CARD0.encoder.01.velocity
net z-pos-fb => joint.1.motor-pos-fb
net z-index-enable joint.1.index-enable <=> [HMOT]CARD0.encoder.01.index-enable
net z-pos-rawcounts <= [HMOT]CARD0.encoder.01.rawcounts

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

net z-home-sw => joint.1.home-sw-in
net z-neg-limit => joint.1.neg-lim-sw-in
net z-pos-limit => joint.1.pos-lim-sw-in

#*******************
# SPINDLE
#*******************

setp pid.s.Pgain [SPINDLE_0]P
setp pid.s.Igain [SPINDLE_0]I
setp pid.s.Dgain [SPINDLE_0]D
setp pid.s.bias [SPINDLE_0]BIAS
setp pid.s.FF0 [SPINDLE_0]FF0
setp pid.s.FF1 [SPINDLE_0]FF1
setp pid.s.FF2 [SPINDLE_0]FF2
setp pid.s.deadband [SPINDLE_0]DEADBAND
setp pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp pid.s.error-previous-target true

net spindle-index-enable <=> pid.s.index-enable
net spindle-enable => pid.s.enable
net spindle-vel-cmd-rpm => pid.s.command
net spindle-vel-fb-rpm => pid.s.feedback
net spindle-output <= pid.s.output

# ---PWM Generator signals/setup---

setp [HMOT]CARD0.7i77.0.1.analogout2-scalemax [SPINDLE_0]OUTPUT_SCALE
setp [HMOT]CARD0.7i77.0.1.analogout2-minlim [SPINDLE_0]OUTPUT_MIN_LIMIT
setp [HMOT]CARD0.7i77.0.1.analogout2-maxlim [SPINDLE_0]OUTPUT_MAX_LIMIT

net spindle-output => [HMOT]CARD0.7i77.0.1.analogout2

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

setp [HMOT]CARD0.encoder.02.counter-mode 0
setp [HMOT]CARD0.encoder.02.filter 1
setp [HMOT]CARD0.encoder.02.index-invert 0
setp [HMOT]CARD0.encoder.02.index-mask 0
setp [HMOT]CARD0.encoder.02.index-mask-invert 0
setp [HMOT]CARD0.encoder.02.scale [SPINDLE_0]ENCODER_SCALE

net spindle-revs <= [HMOT]CARD0.encoder.02.position
net spindle-vel-fb-rps <= [HMOT]CARD0.encoder.02.velocity
net spindle-index-enable <=> [HMOT]CARD0.encoder.02.index-enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-enable <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
net spindle-index-enable <=> spindle.0.index-enable

# ---Setup spindle at speed signals---

sets spindle-at-speed true


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

# ---HALUI signals---

net axis-select-x halui.axis.x.select
net jog-x-pos halui.axis.x.plus
net jog-x-neg halui.axis.x.minus
net jog-x-analog halui.axis.x.analog
net x-is-homed halui.joint.0.is-homed
net axis-select-z halui.axis.z.select
net jog-z-pos halui.axis.z.plus
net jog-z-neg halui.axis.z.minus
net jog-z-analog halui.axis.z.analog
net z-is-homed halui.joint.1.is-homed
net jog-selected-pos halui.axis.selected.plus
net jog-selected-neg halui.axis.selected.minus
net spindle-manual-cw halui.spindle.0.forward
net spindle-manual-ccw halui.spindle.0.reverse
net spindle-manual-stop halui.spindle.0.stop
net machine-is-on halui.machine.is-on
net jog-speed halui.axis.jog-speed
net MDI-mode halui.mode.is-mdi

# ---coolant signals---

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

# ---probe signal---

net probe-in => motion.probe-input

# ---jogwheel signals to mesa encoder - shared MPG---

net axis-selected-count <= [HMOT]CARD0.7i77.0.0.enc0.count

# ---mpg signals---

# for axis x MPG
setp axis.x.jog-vel-mode 0
net selected-jog-incr => axis.x.jog-scale
net axis-select-x => axis.x.jog-enable
net axis-selected-count => axis.x.jog-counts


# for axis z MPG
setp axis.z.jog-vel-mode 0
net selected-jog-incr => axis.z.jog-scale
net axis-select-z => axis.z.jog-enable
net axis-selected-count => axis.z.jog-counts


# connect selectable mpg jog increments

net jog-incr-a => jogincr.sel0
net jog-incr-b => jogincr.sel1
net jog-incr-c => jogincr.sel2
net jog-incr-d => jogincr.sel3
net selected-jog-incr <= jogincr.out-f
setp jogincr.debounce-time 0.200000
setp jogincr.use-graycode False
setp jogincr.suppress-no-input False
setp jogincr.in00 0.000000
setp jogincr.in01 0.000100
setp jogincr.in02 0.000500
setp jogincr.in03 0.001000
setp jogincr.in04 0.005000
setp jogincr.in05 0.010000
setp jogincr.in06 0.050000
setp jogincr.in07 0.100000
setp jogincr.in08 0.125000
setp jogincr.in09 0.125000
setp jogincr.in10 0.125000
setp jogincr.in11 0.125000
setp jogincr.in12 0.125000
setp jogincr.in13 0.125000
setp jogincr.in14 0.125000
setp jogincr.in15 0.125000

# ---motion control signals---

net in-position <= motion.in-position
net machine-is-enabled <= motion.motion-enabled

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

# ---estop signals---

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

# ---toolchange signals for custom tool changer---

net tool-number <= iocontrol.0.tool-prep-number
net tool-change-request <= iocontrol.0.tool-change
net tool-change-confirmed => iocontrol.0.tool-changed
net tool-prepare-request <= iocontrol.0.tool-prepare
net tool-prepare-confirmed => iocontrol.0.tool-prepared

***************************************************************************************************************
****************************************************************************************************************
Here is the .ini:

# Generated by PNCconf at Fri Oct 18 15:46:10 2019
# Using LinuxCNC version: UNAVAILABLE
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

[EMC]
MACHINE = Lathe_135
DEBUG = 0
VERSION = 1.1

[DISPLAY]
DISPLAY = axis
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.000000
MAX_SPINDLE_OVERRIDE = 1.000000
MIN_SPINDLE_OVERRIDE = 0.500000
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/gearhead/linuxcnc/nc_files
INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
LATHE = 1
POSITION_FEEDBACK = ACTUAL
DEFAULT_LINEAR_VELOCITY = 0.250000
MAX_LINEAR_VELOCITY = 1.000000
MIN_LINEAR_VELOCITY = 0.016670
DEFAULT_ANGULAR_VELOCITY = 12.000000
MAX_ANGULAR_VELOCITY = 180.000000
MIN_ANGULAR_VELOCITY = 1.666667
EDITOR = gedit
GEOMETRY = xz

[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]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = linuxcnc.var

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
SERVO_PERIOD = 20000

[HMOT]
CARD0=hm2_5i25.0

[HAL]
HALUI = halui
HALFILE = Lathe_135.hal
HALFILE = custom.hal
POSTGUI_HALFILE = postgui_call_list.hal
SHUTDOWN = shutdown.hal

[HALUI]

[KINS]
JOINTS = 2
KINEMATICS = trivkins coordinates=XZ

[TRAJ]
COORDINATES = XZ
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 0.67
MAX_LINEAR_VELOCITY = 6.67

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

#******************************************
[AXIS_X]
MAX_VELOCITY = 3.33333333333
MAX_ACCELERATION = 50.0
MIN_LIMIT = -0.001
MAX_LIMIT = 10.0

[JOINT_0]
TYPE = LINEAR
HOME = 0.0
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 3.33333333333
MAX_ACCELERATION = 50.0
P = 50.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
ENCODER_SCALE = 20000.0
OUTPUT_SCALE = 10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0
MIN_LIMIT = -0.001
MAX_LIMIT = 10.0
HOME_OFFSET = 0.0
#******************************************

#******************************************
[AXIS_Z]
MAX_VELOCITY = 6.66666666667
MAX_ACCELERATION = 200.0
MIN_LIMIT = -0.001
MAX_LIMIT = 10.0

[JOINT_1]
TYPE = LINEAR
HOME = 0.0
FERROR = 0.5
MIN_FERROR = 0.05
MAX_VELOCITY = 6.66666666667
MAX_ACCELERATION = 200.0
P = 50.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 0.0
ENCODER_SCALE = 20000.0
OUTPUT_SCALE = 10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0
MIN_LIMIT = -0.001
MAX_LIMIT = 10.0
HOME_OFFSET = 0.0
#******************************************

[SPINDLE_0]
P = 0.0
I = 0.0
D = 0.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 2000.0
ENCODER_SCALE = 4000.0
OUTPUT_SCALE = 2000
OUTPUT_MIN_LIMIT = -2000
OUTPUT_MAX_LIMIT = 2000


Thanks

Karl
Last edit: 7 years 2 weeks ago by gearheaded.

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

Time to create page: 0.128 seconds
Powered by Kunena Forum