Servo To Go v2 8axis EMC interface woes



Hello all,

    I'm having difficulty with the IO control with the STG2 8axis board (I'm
using 3 axes currently). There are several things, probably inter-related.

    Various related error listings are appended, with my .run mod for the
stg_v2_8axis_mod.o, and .ini listing.

    EMC does run on my machine with other emcmot modules.

    I'm thinking the IO isn't properly addressed, though usrmot can get to
the DACs.
    Do I need to terminate the IO connectors in some special way?

    The setup is a AMD K5 166, 32mb, 10mb ethernet, no sound card, STGv2
8axis, 0x200 base address, running a BDI installation of EMC. I'm running
EMC
un-connected to my machine at this point.

    Ideas, anyone?

    - Keith Rumley

DETAILED DESCRIPTION:
    - Using stg_v2_8axis_mod as the emcmot module, and attempting to run
tkemc, the EMCtask  gets invalid return values from axis functions at
startup. The error buffer fills up, then  a failure with tkemc interface
occurs.
    - Using emcpanel, the interface comes up after filling the buffer,
 but only the 'emcio' portion of emcpanel works.
    - Using the usrmot utility in separate 'konsole' window, with EMC
running emcpanel in the hobbled, emcio-only state, I find the DACs output
correct voltages if directly commanded 'dac <axis#> <voltage>' from usrmot.
The home function and axis functions appear not to work.
    - I can't enable or disable the e-stop in either emcio or usrmot.
    - On the occasions that tkemc runs, my IO is either locked off, or
flickering
rapidly on and off uncontrollably (e-stop and machine enable - the IO
visible on-screen in tkemc.  The actions are tied to the polarity set in my
.ini file.)
     - I have had one tkemc session when the IO was un-responsive, but I was
getting voltage out of the DACs when homing the X-axis. (-10v)  Perhaps the
revision note below concerns this very thing?
 " 7-Aug-2000 WPS made several changes. The Servo-To-Go 2 code had a bug
where STG_BASE_ADDRESS was not set to match wStg->wBaseAddress or vice versa
when the port was found automatically. This meant that digital IO might work
but the encoder/motion stuff not or vice versa depending on which was
correct. Set FIND_STG_BASE_ADDRESS to 1 to disable automatic finding of the
base address. " (from the source code for 'stg2.c')

__________________________________
The error output while trying to run tkemc is :
-------------------------------------------------------------
> [root-at-lserv /usr/local/emc]# ./generic.run
> ./generic.run: which:: No such file or directory
> Current platform is linux_2_2_18
> Current real-time platform is rtlinux_3_0
> inivar = plat/linux_2_2_18/bin/inivar
> INIFILE = generic.ini
> starting emc...
> starting EMC MOTION PROGRAM -- stg_v2_8axis_mod.o...done
> starting EMC IO PROGRAM --  bridgeportio...done
> starting EMC TASK PROGRAM -- bridgeporttask...done
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> bad return from emcTrajSetIndex
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> bad return value from emcTrajSetCycleTime
> running EMC DISPLAY PROGRAM -- tkemc...
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 466: bad return from emcAxisSetGains
> bad return value from emcTrajSetCycleTime
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 466: bad return from emcAxisSetGains
> ...

then a script (tc/tkl?) gets messed up....

> bad return value from emcTrajSetCycleTime
> emctaskmain.cc 2372: can't initialize motion
> Maximum number of errors to print exceeded!
> _shm.c 543: shmget(1002(0x3EA),8192,0) failed: (errno = 2): No such file
or directory
> cms_cfg.cc 1071: cms_config: -4(CMS_NO_MASTER_ERROR: An error occured
becouse the master was not started.) Error occured during SHMEM create.
> nml.cc 479: NML: cms_config returned -1.

> **********************************************************
> * Current Directory = /usr/local/emc
> * -at-(#)$Info: RCS_LIBRARY_VERSION 4.37 Compiled on  Mar 14 2001 at 22:44:47
for the linux_2_2_18 platform with compiler version egcs-2.91.66
19990314/Linux (egcs-1.1.2 release) $ .

> **********************************************************
> * BufferName = emcStatus
> * BufferType = 0
> * ProcessName = xemc
> * Configuration File = emc.nml
> * CMS Status = -4 (CMS_NO_MASTER_ERROR: An error occured becouse the
master was not started.)
> * Recent errors repeated:

> shmget(1002(0x3EA),8192,0) failed: (errno = 2): No such file or directory

> cms_config: -4(CMS_NO_MASTER_ERROR: An error occured becouse the master
was not started.) Error occ
> ML: cms_config returned -1.

> * BufferLine: B emcStatus             SHMEM   localhost       8192    0
0       2
>   16 1002 TCP=5005 xdr
> * ProcessLine: P xemc          emcStatus       LOCAL   localhost       R
0       10.0    0       10
> * Config File = emc.nml
> * error_type = 0 (NML_NO_ERROR)
> ************************************************************

> _shm.c 543: shmget(1002(0x3EA),8192,0) failed: (errno = 2): No such file
or directory
> cms_cfg.cc 1071: cms_config: -4(CMS_NO_MASTER_ERROR: An error occured
becouse the master was not started.) Error occured during SHMEM create.
> nml.cc 479: NML: cms_config returned -1.
> emcsh.cc 4572: can't connect to emc

________________________________________
For emcpanel it's similar, but w/o the script stuff:
------------------------------------------------------------------------
> ...
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> bad return value from emcTrajSetCycleTime
> running EMC DISPLAY PROGRAM -- emcpanel...
> trying emcError...got it
> trying toolCmd...got it
> tring toolSts...got it
> trying emcCommand...got it
> trying emcStatus...failed
> emcio> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 466: bad return from emcAxisSetGains
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> ...
> emctaskmain.cc 2372: can't initialize motion
> emcio>
_______________________
The emcio header at this point:
------------------------------------------
> emcio status:    1102 3 DONE S0 1 417 bridgeporttool.cc
> heartbeat:    3045
> ...
> emcio>


_____________________________
Occasionally tkemc WILL load, when random sets of IO
polarities meet its fancy.
-------------------------------------------------------------
> [root-at-lserv /usr/local/emc]# ./generic.run
> ./generic.run: which:: No such file or directory
> Current platform is linux_2_2_18
> Current real-time platform is rtlinux_3_0
> inivar = plat/linux_2_2_18/bin/inivar
> INIFILE = generic.ini
> starting emc...
> starting EMC MOTION PROGRAM -- stg_v2_8axis_mod.o...done
> starting EMC IO PROGRAM --  bridgeportio...done
> starting EMC TASK PROGRAM -- bridgeporttask...done
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> iniaxis.cc 541: bad return from emcAxisSetInputScale
> Minimum Hardware Limit on axis 2 exceeded.
> Maximum Hardware Limit on axis 2 exceeded.
> running EMC DISPLAY PROGRAM -- tkemc...
> Maximum Hardware Limit on axis 2 exceeded.
> command (EMC_AXIS_JOG) cannot be executed until the machine is out of
E-stop and turned on
>[root-at-lserv /usr/local/emc]# vi generic.ini

* Note that I couldn't get it out of e-stop, so the jog returned an error. I
jumped into 'vi' to change .ini polarities of the max/min limits and e-stop.
Of course tkemc wouldn't start afterward.
So, changed the .ini back - still won't start. Aaargh. This particular time,
the axis 0 FAULT_POLARITY had to be set to zero. Lasted about 3 program
start/stops.

___________________________________
generic.ini  listing:
---------------------------------------------------------------
; Servo-To-Go II 8 axis controller. BDI install
; 6.25.01 - KHR added symlink stg_v2_8axis_mod.o
;   to the usr/local/emc/plat/realtime/bin directory
;  and added it to the generic.run file, so it would
;  accept it as a valid emcmot module
;   - in stg2.c Will Shackleford notes that
;  it has a fix for STG2 addressing bug, where either IO
;  or the task run, but not both at once.
;  I seem to be getting this bug anyway?
;
; 6.25.01 -  Some modules don't 'insmod' because the kernel version the
;  module was compiled for can't be found:
;  stg.o
;  stg2.o
;  stg8.o
;  stgdiag.o
;


; General
section -------------------------------------------------------------
[EMC]

; Version of this INI file
  VERSION =               $Revision: 1.5 $

; Name of machine, for use with display, etc.
  MACHINE=              stg_v2_8axis_mod.o

; Name of NML file to use, default is emc.nml
  NML_FILE =            emc.nml

; Debug level, 0 means no messages. See emc/src/emcnml/emcglb.h for others
  DEBUG =               0x00000003
; DEBUG =               0x7FFFFFFF

; Default settings
RS274NGC_STARTUP_CODE=G20

; Sections for display
options ------------------------------------------------
[DISPLAY]

; Platform for GUI
  PLAT =                nonrealtime

; Name of display program, e.g., xemc
; DISPLAY =             xemc
; DISPLAY =             tkemc
; DISPLAY =             yemc
; DISPLAY =             keystick
DISPLAY =             emcpanel

; Cycle time, in seconds, that display will sleep between polls
  CYCLE_TIME =            0.1

; Path to help file
  HELP_FILE =             doc/help.txt

; Initial display setting for position, RELATIVE or ABSOLUTE
  POSITION_OFFSET =       RELATIVE

; Initial display setting for position, COMMANDED or ACTUAL
  POSITION_FEEDBACK =     COMMANDED

; Highest value that will be allowed for feed override, 1.0 = 100%
  MAX_FEED_OVERRIDE =     1.2

; Prefix to be used
  PROGRAM_PREFIX =        programs/

; Introductory graphic
; INTRO_GRAPHIC = emc.gif
; INTRO_TIME = 5

; Task controller
section -----------------------------------------------------
[TASK]

; Platform for task controller
  PLAT =                nonrealtime

; Name of task controller program, e.g., bridgeporttask
  TASK =                bridgeporttask
; TASK =                minimilltask

; Cycle time, in seconds, that task controller will sleep between polls
  CYCLE_TIME =          0.100

; Part program interpreter
section --------------------------------------------
[RS274NGC]

; File containing interpreter variables
  PARAMETER_FILE =        emc.var

; Motion control
section ------------------------------------------------------
[EMCMOT]

; Platform for motion
  PLAT =                  realtime
; PLAT =                  nonrealtime

; Name of motion control program
; EMCMOT =              steppermod.o
; EMCMOT =              freqmod.o
; EMCMOT =              stgmod.o
EMCMOT =             stg_v2_8axis_mod.o
; EMCMOT =              emcmotsim
; EMCMOT =              stg8mod.o
; EMCMOT =              stg2mod.o
; EMCMOT =              stg2.o

; Key for real OS shared memory, e.g., for simulated motion
  SHMEM_KEY =             100

; Base address for physical shared memory, e.g., for real-time motion.
; Note that if you change this, you may need to change OS parameters, e.g.,
; /etc/lilo.conf
  SHMEM_BASE_ADDRESS =  0x1F00000
; SHMEM_BASE_ADDRESS =  0x3F00000

; Base address of Servo To Go board
  STG_BASE_ADDRESS =    0x200
; STG_BASE_ADDRESS =    0x300

; Address for parallel port used for steppers
  PARPORT_IO_ADDRESS =    0x378

; Timeout for comm to emcmot, in seconds
  COMM_TIMEOUT =          .01

; Interval between tries to emcmot, in seconds
  COMM_WAIT =             0.010

; Base task period, in seconds
 PERIOD =                0.00016

; Trajectory planner
section --------------------------------------------------
[TRAJ]

AXES =                  3
COORDINATES =           X Y Z
HOME =                  0 0 0
LINEAR_UNITS =          0.03937007874016
ANGULAR_UNITS =         1.0
CYCLE_TIME =            0.010
DEFAULT_VELOCITY =      0.16700
MAX_VELOCITY =          3.3
DEFAULT_ACCELERATION =  10.0
MAX_ACCELERATION =      20.0

; Axes
sections ---------------------------------------------------------------

; First axis
[AXIS_0]

TYPE =                          LINEAR
UNITS =                         0.03937007874016
HOME =                          0.000

; MAX VELOCITY per axis set to a small percentage below overall max velocity
; to avoid algorithm bin overflow errors, as discussed by Ray Henry, June
2001

MAX_VELOCITY =                  3.0

P = 1000.000
I = 0.000
D = 0.000
FF0 = 0.000
FF1 = 0.000
FF2 = 0.000
BACKLASH = 0.000
BIAS = 0.000
MAX_ERROR = 0.000
DEADBAND = 0.000
CYCLE_TIME =                    0.001

; (Info from emcsoft.html at the NIST EMC site, Nov. 2000)
; Input scale as encoder counts per user units, and offset from home
position
; 4096 pulses per rev, .200" pitch = 4096 * 5 = 20480 counts per inch, no
offset to start

INPUT_SCALE =                   20480 0.000

; Output scale for DAC output to amplifier, and offset
OUTPUT_SCALE = 1.000 0.000

MIN_LIMIT =                     -40.0
MAX_LIMIT =                     40.0

MIN_OUTPUT =                    -10
MAX_OUTPUT =                    10

; Big following error allowances to give me time to check for DAC output
voltages
FERROR = 100.0000
MIN_FERROR = 0.000

HOMING_VEL =                    0.1
HOME_OFFSET =                   0.0

; Polarity 0 = enabled normally off on my machine
ENABLE_POLARITY =               0
MIN_LIMIT_SWITCH_POLARITY =     1
MAX_LIMIT_SWITCH_POLARITY =     1
HOME_SWITCH_POLARITY =          1
HOMING_POLARITY =               1
JOGGING_POLARITY =              1
FAULT_POLARITY =                0

; Second axis
[AXIS_1]

TYPE =                          LINEAR
UNITS =                         0.03937007874016
HOME =                          0.000
MAX_VELOCITY =                  3.0
P = 1000.000
I = 0.000
D = 0.000
FF0 = 0.000
FF1 = 0.000
FF2 = 0.000
BACKLASH = 0.000
BIAS = 0.000
DEADBAND = 0.000
CYCLE_TIME =                    0.001000
INPUT_SCALE =                   20480 0.00
OUTPUT_SCALE =                  1.000 0.000
MIN_LIMIT =                     -40.0
MAX_LIMIT =                     40.0
MIN_OUTPUT =                    -10
MAX_OUTPUT =                    10
FERROR = 0.010
MIN_FERROR = 0.0001
HOMING_VEL =                    0.1
HOME_OFFSET =                   0.0
ENABLE_POLARITY =               1
MIN_LIMIT_SWITCH_POLARITY =     1
MAX_LIMIT_SWITCH_POLARITY =     1
HOME_SWITCH_POLARITY =          1
HOMING_POLARITY =               1
JOGGING_POLARITY =              1
FAULT_POLARITY =                1

; Third axis
[AXIS_2]

TYPE =                          LINEAR
UNITS =                         0.03937007874016
HOME =                          0.000
MAX_VELOCITY=   3.0
P = 1000.000
I = 0.000
D = 0.000
FF0 = 0.000
FF1 = 0.000
FF2 = 0.000
BACKLASH = 0.000
BIAS = 0.000
DEADBAND = 0.000
CYCLE_TIME =                    0.001000
INPUT_SCALE =                   20480 0.000
OUTPUT_SCALE =                  1.000 0.000
MIN_LIMIT =                     -40.0
MAX_LIMIT =                     40.0
MIN_OUTPUT =                    -10
MAX_OUTPUT =                    10
FERROR = 1.000
MIN_FERROR = 0.010
HOMING_VEL =                    0.1
HOME_OFFSET =                   0.0
ENABLE_POLARITY =               1
MIN_LIMIT_SWITCH_POLARITY =     1
MAX_LIMIT_SWITCH_POLARITY =     1
HOME_SWITCH_POLARITY =          1
HOMING_POLARITY =               1
JOGGING_POLARITY =              1
FAULT_POLARITY =                1

; section for main IO controller
parameters -----------------------------------
[EMCIO]

; Platform for IO controller
  PLAT =                nonrealtime

; Name of IO controller program, e.g., bridgeportio
  EMCIO =               bridgeportio
; EMCIO =               minimillio
; EMCIO =               simio

; cycle time, in seconds
CYCLE_TIME =    0.100

; tool table file
  TOOL_TABLE =    emc.tbl

; address for parallel port used for auxiliary IO
  PARPORT_IO_ADDRESS =    0x278

; wait times in seconds for spindle brake, release
  SPINDLE_OFF_WAIT          =     1.0
  SPINDLE_ON_WAIT           =     1.5

; external digital inputs, outputs are always 0 for 0V, 1 for 5/24V

; digital in bits
; * STG boards have their IO index numbers set in the board wrapper
; ESTOP_SENSE_INDEX         =     1
; LUBE_SENSE_INDEX          =     2

; digital in polarity, 0 is inverted, 1 is normal
; controller compares with polarity, equal means on, not equal means off

  ESTOP_SENSE_POLARITY      =     0
  LUBE_SENSE_POLARITY       =     1

; digital out bits - * STG IO index numbers set in the c code for the board
wrapper


; SPINDLE_FORWARD_INDEX     =     1
; SPINDLE_REVERSE_INDEX     =     0
; MIST_COOLANT_INDEX        =     6
; FLOOD_COOLANT_INDEX       =     10
; SPINDLE_DECREASE_INDEX    =     8
; SPINDLE_INCREASE_INDEX    =     9
; ESTOP_WRITE_INDEX         =     7
; SPINDLE_BRAKE_INDEX       =     11
;
; analog out bits

; SPINDLE_ON_INDEX          =     3

; digital out polarity, 0 is inverted, 1 is normal
; controller writes the polarity to turn on, opposite of polarity to turn
off

  SPINDLE_FORWARD_POLARITY  =     0
  SPINDLE_REVERSE_POLARITY  =     0
  MIST_COOLANT_POLARITY     =     0
  FLOOD_COOLANT_POLARITY    =     0
  SPINDLE_DECREASE_POLARITY =     0
  SPINDLE_INCREASE_POLARITY =     0
  ESTOP_WRITE_POLARITY      =     0
  SPINDLE_BRAKE_POLARITY    =     0
  SPINDLE_ENABLE_POLARITY   =     0

; section for external NML server
parameters ----------------------------------
[EMCSERVER]

; Name of NML server, e.g., emcsvr; if not found then none will run
; EMCSERVER =           emcsvr

; section for emc stripchart  parameters ----------------------------------
[EMCSTRIP]

; Name of strip chart display program e.g.  emcstripchart; if not found then
none will run
; EMCSTRIP =            emcstripchart

; OPTIONS for emcstripchart ussually -f something.conf; This file says which
; variables to plot, colors etc. -u  changes the update rate.
; OPTIONS = -f emcstrip.conf.ferror

__________________________________________
generic.run changes ...(added stg_v2_8axis_mod.o)
---------------------------------------------------------------------------
> # Kill any emcmots lying around
>   case $emcmot in
>     stgmod.o|stg2mod.o|stg8mod.o | stg_v2_8axis_mod.o | stg28mod.o )
>       /sbin/rmmod $(echo $emcmot | sed s/\\.o//g) 2> ${ERROR_OUT_FILE}
>     ;;

> ....
>  # run emcmot in background
> echo -n "starting EMC MOTION PROGRAM -- $emcmot..."
> case $emcmot in
>  stgmod.o|stg2mod.o|stg8mod.o | stg_v2_8axis_mod.o | stg28mod.o)
> # STG modules need SHMEM_BASE_ADDRESS and STG_BASE_ADDRESS





_________________________________________________________
Do You Yahoo!?
Get your free -at-yahoo.com address at http://mail.yahoo.com




Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact