sherline computer w/Linuxcnc 2.7 parallel communication??

More
20 Dec 2017 02:39 #103374 by garyl
I have an old Sherline computer that had Linux emc 4.51 which was working fine. I called Sherline and they sent me the latest disks with Debian Wheezy 7 and Linux CNC 2.7 for free, nice of them.

I did a fresh install with the provided disks and everything went well. When I open the Sherline files for the CNC machine it opens and I can run G codes. However when I power on the stepper motors they all buzz and do not respond to commands. Is there any known issues with the parallel communication not working with 2.7?

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

More
20 Dec 2017 03:57 #103378 by InMyDarkestHour
No known issues, if can post your ini & hal file it should not be too hard to suss out. Could be a stepper driver timing issue.

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

More
20 Dec 2017 11:40 #103383 by garyl
Thanks for the reply! Just to let you know, I know just enough about computers to be dangerous :). I will see if I can get that information later today after work.

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

More
20 Dec 2017 11:46 #103384 by InMyDarkestHour
At least you are aware of that.......that's a huge bonus, some are not so quite self aware. :)

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

More
20 Dec 2017 21:39 - 20 Dec 2017 21:43 #103407 by garyl
Here is the INI.



# EMC controller parameters for generic controller. Make these what you need
# for your system.

# General note: Comments can either be preceded with a # or ; - either is
# acceptable, although # is in keeping with most linux config files.

# Settings with a + at the front of the comment are likely needed to get
# changed by the user.
# Settings with a - at the front are highly unneeded to be changed
###############################################################################
# General section
###############################################################################
[EMC]

#- Version of this INI file
VERSION = $Revision$

#+ Name of machine, for use with display, etc.
MACHINE = Sherline 3d printer

#+ Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
DEBUG = 0
# DEBUG = 0x00000007
# DEBUG = 0x7FFFFFFF

###############################################################################
# Sections for display options
###############################################################################
[DISPLAY]

#+ Name of display program, e.g., xemc
DISPLAY = mini
# DISPLAY = usrmot
# DISPLAY = mini
# DISPLAY = tkemc
# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME = 0.200

#- Path to help file
HELP_FILE = doc/help.txt

#- Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET = RELATIVE

#- Initial display setting for position, COMMANDED or ACTUAL
POSITION_FEEDBACK = ACTUAL

#+ Highest value that will be allowed for feed override, 1.0 = 100%
MAX_FEED_OVERRIDE = 1.20

#- Prefix to be used
PROGRAM_PREFIX = /home/sherline/linuxcnc/nc_files

#- Introductory graphic
INTRO_GRAPHIC = open.gif
INTRO_TIME = 5

GEOMETRY = AXYZ

###############################################################################
# Task controller section
###############################################################################
[TASK]

#- Name of task controller program, e.g., bridgeporttask
TASK = milltask
# TASK = minimilltask

#- Cycle time, in seconds, that task controller will sleep between polls
CYCLE_TIME = 0.010

###############################################################################
# Part program interpreter section
###############################################################################
[RS274NGC]

#- File containing interpreter variables
PARAMETER_FILE = stepper.var

###############################################################################
# Motion control section
###############################################################################
[EMCMOT]

#- Name of the motion controller to use (only one exists for nontrivkins)
EMCMOT = motmod

#- Timeout for comm to emcmot, in seconds
COMM_TIMEOUT = 1.0

#- Interval between tries to emcmot, in seconds
COMM_WAIT = 0.010

#+ Base task period, in nanosecs - this is the fastest thread in the machine
BASE_PERIOD = 50000
#- Servo task period, in nanosecs - will be rounded to an int multiple of BASE_PERIOD
SERVO_PERIOD = 1000000

###############################################################################
# Hardware Abstraction Layer section
###############################################################################
[HAL]

# The run script first uses halcmd to execute any HALFILE
# files, and then to execute any individual HALCMD commands.
#

# list of hal config files to run through halcmd
#+ files are executed in the order in which they appear
HALFILE = stepper_xyza.hal
#HALFILE = xylotex_pinout.hal
HALFILE = standard_pinout.hal

#- list of halcmd commands to execute
# commands are executed in the order in which they appear
#HALCMD = save neta

###############################################################################
# Trajectory planner section
###############################################################################
[TRAJ]
#+ machine specific settings
AXES = 4
# COORDINATES = X Y Z R P W
COORDINATES = X Y Z A
HOME = 0 0 0
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 4.6
DEFAULT_ANGULAR_VELOCITY = 25
MAX_VELOCITY = 25
MAX_ANGULAR_VELOCITY = 25
DEFAULT_ACCELERATION = 50
MAX_ACCELERATION = 50

# for gui only
MAX_LINEAR_VELOCITY = 8
DEFAULT_LINEAR_VELOCITY = 4.6
MAX_ANGULAR_VELOCITY = 25
DEFAULT_ANGULAR_VELOCITY = 25



###############################################################################
# Axes sections
###############################################################################

#+ First axis
[AXIS_0]

TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 8
# NOTE: the step generator module applies its own limits to
# acceleration and velocity. We have discovered that it needs
# to have a little "headroom" over the accel by the trajectory
# planner, otherwise it can fall slightly behind during accel
# and later overshoot as it catches up. In the long term we
# hope to come up with a clean fix for this problem. In the
# meantime, please set STEPGEN_MAXACCEL below to a few percent
# higher than the regular acceleration limit MAX_ACCELERATION
MAX_ACCELERATION = 50
STEPGEN_MAXVEL = 10
STEPGEN_MAXACCEL = 60
BACKLASH = 0.000
INPUT_SCALE = 800
MIN_LIMIT = -508.0
MAX_LIMIT = 508.0
FERROR = 026.00
MIN_FERROR = 0.2600
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO

#+ Second axis
[AXIS_1]

TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 8
MAX_ACCELERATION = 50
STEPGEN_MAXVEL = 10
STEPGEN_MAXACCEL = 60
BACKLASH = 0.000
INPUT_SCALE = -800
MIN_LIMIT = -508.0
MAX_LIMIT = 508.0
FERROR = 026.00
MIN_FERROR = 0.260
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO

#+ Third axis
[AXIS_2]

TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 8
MAX_ACCELERATION = 50
STEPGEN_MAXVEL = 10
STEPGEN_MAXACCEL = 60
BACKLASH = 0.000
INPUT_SCALE = -800
MIN_LIMIT = -508.0
MAX_LIMIT = 508.0
FERROR = 026.00
MIN_FERROR = 0.260
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO

#+ Third axis
[AXIS_3]

TYPE = ANGULAR
HOME = 0.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 160.0
STEPGEN_MAXVEL = 26.0
STEPGEN_MAXACCEL = 196.0
BACKLASH = 0.000
INPUT_SCALE = 25
MIN_LIMIT = -36000.0
MAX_LIMIT = 36000.0
FERROR = 5.0
MIN_FERROR = 1.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO


###############################################################################
# section for main IO controller parameters
###############################################################################
[EMCIO]

#- Name of IO controller program, e.g., io
EMCIO = io

#- cycle time, in seconds
CYCLE_TIME = 0.100

#- tool table file
TOOL_TABLE = stepper.tbl



Here is the HAL.


# core HAL config file for steppers

# first load the core RT modules that will be needed
# kinematics
loadrt trivkins
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD
# stepper module
loadrt stepgen step_type=0,0,0,0

# hook its functions to realtime threads
addf stepgen.make-pulses base-thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread

# connect position commands from motion module to step generator
net Xpos-cmd <= axis.0.motor-pos-cmd
net Xpos-cmd => stepgen.0.position-cmd
net Ypos-cmd <= axis.1.motor-pos-cmd
net Ypos-cmd => stepgen.1.position-cmd
net Zpos-cmd <= axis.2.motor-pos-cmd
net Zpos-cmd => stepgen.2.position-cmd
net Apos-cmd <= axis.3.motor-pos-cmd
net Apos-cmd => stepgen.3.position-cmd

# connect position feedback from step generators
# to motion module
net Xpos-fb <= stepgen.0.position-fb
net Xpos-fb => axis.0.motor-pos-fb
net Ypos-fb <= stepgen.1.position-fb
net Ypos-fb => axis.1.motor-pos-fb
net Zpos-fb <= stepgen.2.position-fb
net Zpos-fb => axis.2.motor-pos-fb
net Apos-fb <= stepgen.3.position-fb
net Apos-fb => axis.3.motor-pos-fb

# send the position commands thru differentiators to
# generate velocity and accel signals
# first 8 differentiators
loadrt ddt count=8
# link the differentiator functions into the code
addf ddt.0 servo-thread
addf ddt.1 servo-thread
addf ddt.2 servo-thread
addf ddt.3 servo-thread
addf ddt.4 servo-thread
addf ddt.5 servo-thread
addf ddt.6 servo-thread
addf ddt.7 servo-thread
# define the signals, and hook them up
net Xpos-cmd => ddt.0.in
net Xvel <= ddt.0.out
net Xvel => ddt.1.in
net Xacc <= ddt.1.out
net Ypos-cmd => ddt.2.in
net Yvel <= ddt.2.out
net Yvel => ddt.3.in
net Yacc <= ddt.3.out
net Zpos-cmd => ddt.4.in
net Zvel <= ddt.4.out
net Zvel => ddt.5.in
net Zacc <= ddt.5.out
net Apos-cmd => ddt.6.in
net Avel <= ddt.6.out
net Avel => ddt.7.in
net Aacc <= ddt.7.out

# connect enable signals for step generators
net Xen <= axis.0.amp-enable-out
net Xen => stepgen.0.enable
net Yen <= axis.1.amp-enable-out
net Yen => stepgen.1.enable
net Zen <= axis.2.amp-enable-out
net Zen => stepgen.2.enable
net Aen <= axis.3.amp-enable-out
net Aen => stepgen.3.enable

# connect signals to step pulse generator outputs
net Xstep stepgen.0.step
net Xdir stepgen.0.dir
net Ystep stepgen.1.step
net Ydir stepgen.1.dir
net Zstep stepgen.2.step
net Zdir stepgen.2.dir
net Astep stepgen.3.step
net Adir stepgen.3.dir

# set stepgen module scaling - get values from ini file
setp stepgen.0.position-scale [AXIS_0]INPUT_SCALE
setp stepgen.1.position-scale [AXIS_1]INPUT_SCALE
setp stepgen.2.position-scale [AXIS_2]INPUT_SCALE
setp stepgen.3.position-scale [AXIS_3]INPUT_SCALE

# set stepgen module velocity limits - get values from ini file
setp stepgen.0.maxvel [AXIS_0]STEPGEN_MAXVEL
setp stepgen.1.maxvel [AXIS_1]STEPGEN_MAXVEL
setp stepgen.2.maxvel [AXIS_2]STEPGEN_MAXVEL
setp stepgen.3.maxvel [AXIS_3]STEPGEN_MAXVEL

# set stepgen module accel limits - get values from ini file
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
Last edit: 20 Dec 2017 21:43 by garyl.

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

More
20 Dec 2017 22:24 #103410 by InMyDarkestHour
Seems to be missing the values for the stepper driver timings.

linuxcnc.org/docs/2.7/html/man/man9/stepgen.9.html

wiki.linuxcnc.org/cgi-bin/wiki.pl?Stepper_Drive_Timing
There is an entry for Sherline

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

More
21 Dec 2017 00:07 - 21 Dec 2017 01:53 #103416 by garyl
Where and how do I add that?

In the ini file it refers to "HALFILE = stepper_xyza.hal"

Below is the contents of the stepper_xyza.hal file.


# core HAL config file for steppers

# first load the core RT modules that will be needed
# kinematics
loadrt trivkins
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD
# stepper module
loadrt stepgen step_type=0,0,0,0

# hook its functions to realtime threads
addf stepgen.make-pulses base-thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread

# connect position commands from motion module to step generator
net Xpos-cmd <= axis.0.motor-pos-cmd
net Xpos-cmd => stepgen.0.position-cmd
net Ypos-cmd <= axis.1.motor-pos-cmd
net Ypos-cmd => stepgen.1.position-cmd
net Zpos-cmd <= axis.2.motor-pos-cmd
net Zpos-cmd => stepgen.2.position-cmd
net Apos-cmd <= axis.3.motor-pos-cmd
net Apos-cmd => stepgen.3.position-cmd

# connect position feedback from step generators
# to motion module
net Xpos-fb <= stepgen.0.position-fb
net Xpos-fb => axis.0.motor-pos-fb
net Ypos-fb <= stepgen.1.position-fb
net Ypos-fb => axis.1.motor-pos-fb
net Zpos-fb <= stepgen.2.position-fb
net Zpos-fb => axis.2.motor-pos-fb
net Apos-fb <= stepgen.3.position-fb
net Apos-fb => axis.3.motor-pos-fb

# send the position commands thru differentiators to
# generate velocity and accel signals
# first 8 differentiators
loadrt ddt count=8
# link the differentiator functions into the code
addf ddt.0 servo-thread
addf ddt.1 servo-thread
addf ddt.2 servo-thread
addf ddt.3 servo-thread
addf ddt.4 servo-thread
addf ddt.5 servo-thread
addf ddt.6 servo-thread
addf ddt.7 servo-thread
# define the signals, and hook them up
net Xpos-cmd => ddt.0.in
net Xvel <= ddt.0.out
net Xvel => ddt.1.in
net Xacc <= ddt.1.out
net Ypos-cmd => ddt.2.in
net Yvel <= ddt.2.out
net Yvel => ddt.3.in
net Yacc <= ddt.3.out
net Zpos-cmd => ddt.4.in
net Zvel <= ddt.4.out
net Zvel => ddt.5.in
net Zacc <= ddt.5.out
net Apos-cmd => ddt.6.in
net Avel <= ddt.6.out
net Avel => ddt.7.in
net Aacc <= ddt.7.out

# connect enable signals for step generators
net Xen <= axis.0.amp-enable-out
net Xen => stepgen.0.enable
net Yen <= axis.1.amp-enable-out
net Yen => stepgen.1.enable
net Zen <= axis.2.amp-enable-out
net Zen => stepgen.2.enable
net Aen <= axis.3.amp-enable-out
net Aen => stepgen.3.enable

# connect signals to step pulse generator outputs
net Xstep stepgen.0.step
net Xdir stepgen.0.dir
net Ystep stepgen.1.step
net Ydir stepgen.1.dir
net Zstep stepgen.2.step
net Zdir stepgen.2.dir
net Astep stepgen.3.step
net Adir stepgen.3.dir

# set stepgen module scaling - get values from ini file
setp stepgen.0.position-scale [AXIS_0]INPUT_SCALE
setp stepgen.1.position-scale [AXIS_1]INPUT_SCALE
setp stepgen.2.position-scale [AXIS_2]INPUT_SCALE
setp stepgen.3.position-scale [AXIS_3]INPUT_SCALE

# set stepgen module velocity limits - get values from ini file
setp stepgen.0.maxvel [AXIS_0]STEPGEN_MAXVEL
setp stepgen.1.maxvel [AXIS_1]STEPGEN_MAXVEL
setp stepgen.2.maxvel [AXIS_2]STEPGEN_MAXVEL
setp stepgen.3.maxvel [AXIS_3]STEPGEN_MAXVEL

# set stepgen module accel limits - get values from ini file
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
Last edit: 21 Dec 2017 01:53 by garyl.

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

More
21 Dec 2017 04:06 - 21 Dec 2017 04:11 #103418 by InMyDarkestHour
You can add a section in your stepper_xyza.hal such as:

The values were taken from the aforementioned wiki page.

# set stepgen driver timings
# X axis
setp stepgen.0.steplen 1000
setp stepgen.0.stepspace 6000
setp stepgen.0.dirhold 24000
setp stepgen.0.dirsetup 24000

# Y axis
setp stepgen.1.steplen 1000
setp stepgen.1.stepspace 6000
setp stepgen.1.dirhold 24000
setp stepgen.1.dirsetup 24000

# Z axis
setp stepgen.2.steplen 1000
setp stepgen.2.stepspace 6000
setp stepgen.2.dirhold 24000
setp stepgen.2.dirsetup 24000

# A axis
setp stepgen.3.steplen 1000
setp stepgen.3.stepspace 6000
setp stepgen.3.dirhold 24000
setp stepgen.3.dirsetup 24000

This should get you going with a bit of luck. If you want to be a little conservative you can increase the steplen & stepspace by double the amount.
Last edit: 21 Dec 2017 04:11 by InMyDarkestHour. Reason: dropped a zero dirsetup.

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

More
21 Dec 2017 23:22 #103444 by garyl
Sorry to say that did not work. I even tried increasing the numbers.

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

More
22 Dec 2017 00:45 #103448 by InMyDarkestHour
Same buzzing again ?


Your std_pinout.hal is the same as this ? The pins as shown in the file below are going to the correct places ?
ie:
Xstep goes to pin 3 on your parallel port
Xdir goes to pin 2 on your parallel port


# standard pinout config file for 3-axis steppers
# using a parport for I/O
#
# first load the parport driver
loadrt hal_parport cfg="0x0378"
#
# next connect the parport functions to threads
# read inputs first
addf parport.0.read base-thread 1
# write outputs last
addf parport.0.write base-thread -1
#
# finally connect physical pins to the signals
#net estop-out => parport.0.pin-01-out
net Xstep parport.0.pin-03-out
net Xdir parport.0.pin-02-out
net Ystep parport.0.pin-05-out
net Ydir parport.0.pin-04-out
net Zstep parport.0.pin-07-out
net Zdir parport.0.pin-06-out
net Astep parport.0.pin-09-out
net Adir parport.0.pin-08-out


# create a signal for the estop loopback

net estop-ext <= parport.0.pin-10-in
net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in
# create signals for tool loading loopback
#linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared
#linkpp iocontrol.0.tool-change iocontrol.0.tool-changed

# create a signal for "spindle on"
#newsig spindle_on bit

# commented out till we resolve this issue
# connect it to the iocontroller
#linksp spindle_on motion.spindle-on
# connect it to a physical pin
#linksp spindle_on parport.0.pin-01-out

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

Time to create page: 0.101 seconds
Powered by Kunena Forum