TOC PREV NEXT INDEX

Put your logo here!


4 STRUCTURE AND CONFIGURATION OF THE LOCAL DATABASE

All the routines of the MCM make use of data stored in the LCU local database. The following chapter describes how a motor branch is built up and configured.

4.1 Overview

Each motor to be controlled by MCM must have a dedicated branch in the LCU database. This branch may be located at any place. A motor branch is created by instanciation of a specific database class that describes the physical environment of the motor.

4.2 Classes

A set of standard classes are available, that helps the user to create the database branches needed for the application.

The class definition file <path>/mot/dbl/motMOTORS.class contains a set of sub-classes of the generic class motMOTOR, that corresponds to the various HW configurations supported by MCM.

Code explanation:

From the class name, it is possible to decode the corresponding HW configuration.

mot<m><a><v><c><t>

m : motor type : D -> DC-motor => a in [X,V]

v in [X,A]

c in [0,M,C]

t in [X,I,A]

S -> Stepper motor => a in [X,V]

v in [X,S]

c in [M,C]

t in [X,S]

a : amplifier : X -> Stand-alone amplifier => v set to X

V -> ESO-VME4SA/ST => v in [A,S]

v : ampl type : X -> do not care

A -> VME4SA-X1

S -> VME4ST-STP (Stand-Alone)

c : controller : 0 -> No controller => t set to X

M -> MAC4 => t in [I,A,S]

C -> CAMAC => t in [I,A]

t : mcon type : X -> do not care

I -> INC

A -> SSI

S -> STP

Class
Motor
Type
Amplifier
Board
Controller
Board
Encoder
on Motion Controller
motDVAMI
DC
VME4SA-X1
MAC4-INC
Incremental
motDVAMA
DC
VME4SA-X1
MAC4-SSI
Absolute
motDXXMI
DC
Stand-Alone
MAC4-INC
Incremental
motDXXMA
DC
Stand-Alone
MAC4-SSI
Absolute
motSVSMS
STP
VME4SA-STP
MAC4-STP
Incremental / None
motDVA0X
DC
VME4SA-X1
none
None
The following six classes are available:

Their structures differ only from the SDL point (mapping the HW configuration) as shown Figure 3 to Figure 6 below.

These classes are sub-classes of the generic class motMOTOR; its structure does not contain any instanciation of SDL sub-points as show Figure 7.

Figure 3 - Classes motDVAMI,motDVAMA

Figure 4 - Class motDVA0X

Figure 5 - Classes motDXXMI,motDXXMA

Figure 6 - Class motSVSMS

Figure 7 - Generic class motMOTOR

4.3 Motor Database Branch Structure

For each motor intended to be controlled by MCM, a database branch must be provided in the local database. The path to this branch is: <path>:<motorName>. Each motor must have a defined alias (see [1]), character string of up to 14 characters including the string terminator zero. The definition of aliases for the other sub-points is not mandatory.

The motor database branch is designed so that each SW module refers to its related sub-points only.

A motor database branch is divided into three main sections

1. general status information section, which contains all necessary status information about a motor; the DB point of this section is <path>:<motorName>:STATUS
2. server section, which contains all data needed by the server (Configuration, HW initialization procedure, unit conversion); the DB point of this section is <path>:<motorName>:SERVER
3. single device library section, which contains all single device specific data; the DB point of this section is <path>:<motorName>:SDL. This sub-branch is accessed only by the SDL SW modules. This point contains as many sub-points as SDL devices used. Each SDL device sub-point is divided in two parts: CFG that contains the configuration parameters, and RUN that contains the run-time values (copy of the configuration values + run-time values).

In the next sections, attributes in each section are described more in detail.

Note: All the literals motXXX used are defined in motDefines.h or mot.h.

4.4 Motor Database Branch Configuration

The points STATUS (see 4.5), SERVER:INTERN (see 4.6.4) and SDL:<SDL>:RUN (see 4.7.2) shall not be modified, since their content is reinitialized at installation.

The macros for enumerated values are located in the files mot.h or motDefines.h.

The following points and attributes must be configured for the motor to operate correctly:

· SERVER:CONF This is the main configuration part. (see 4.6.1)

The following attributes must be preset to appropriate values (These attributes are already preset according to the instanciation class of the motor branch so that they can be defaulted, with exception of the attributes axis -preset to linear- and encoder) :

· motor motor type and timeouts
· boards board configuration description
· events event configuration
· signals signal configuration
· axis axis type
· encoder encoder type and description

The remaining attributes may not be set (the full usage of the MCM functions is not granted). These attributes are preset so that their content have little effect on MCM:

· specialPositions description of the special positions (limits, etc...)
· offsets position default offsets
· namedPositions named positions description
· namedSpeeds named speeds description
· twoStepOffset offset and speed description for this type of motion
· indexPulseSpeed speed description for fine search of encoder index pulse
· defaultSpeed index of named speed when defaulted
· SERVER:INIT This is the description of the HW Initialization Procedure (see 4.6.2)

No action is preset (motACTION_END)

· SERVER:UNIT This is the description of all the unit conversion methods (see 4.6.3)

No method is preset.

The default units are preset to the board standard units:

motBOARD_UNIT_POS, motBOARD_UNIT_SPD and motBOARD_UNIT_CUR.

· SDL:<SDL>:CFG This is the description of device driver and configuration parameters of the <SDL> board (see 4.7.1, 4.8.1 for the VME4SA board and 4.8.2 for the MAC4 board). The configuration values are the board default values, as set after the board has been reset.

4.5 General Status Section

The structure of this section is a mirror image of the status data structure returned to the user by the motGetStatus function. For this section, nothing has to be configured. The attributes are of type dbSCALAR or dbVECTOR for the SCAN system to be able to read them.

· opMode actual operational mode (enumeration type motOPMODE):
· motDETACHED the motor is not attached (internal)
· motNOT_AVAILABLE the motor is not available (status access only)
· motFIXED_POSITION the motor is in fixed position (status access only)
· motSIMULATION the actions are simulated
· motNORMAL the actions are performed normally
· motHANDSET the motor is controlled manually (status access only)
· motionMode actual motion mode (enumeration type motMOTIONMODE):
· motPOSITION the motor moves in POSITION mode
· motTRACKING the motor moves in TRACKING mode
· motSPEED the motor moves in SPEED mode
· motDIRECT the motor moves in DIRECT mode (amplifier control only)
· motionStatus actual motion status (enumeration type motMOTION_STATUS):
· motSTANDING the motor does not move
· motMOVING the motor is moving
· motTIMEOUT the position could not be reached within the specified time
· motABORTED the motor stopped because of an abnormal event
· motREDEFINED the motion has been redefined while moving
· motionStep step number in a motion sequence
· initStatus initialization status (enumeration type motINIT_STATUS):
· motNOT_INIT no initialization done
· motSW_INIT motor is SW initialize
· motHW_INIT_RUN HW initialization procedure is executing
· motINIT_DONE motor is SW & HW initialized; the motor can be moved.
· initStep step number of the HW initialization procedure
· brakeClamped value of the I/O "brake clamped" signal (see [1])
possible values are ccsTRUE or ccsFALSE
· axisEnabled status of the motion control loop:
possible values are ccsTRUE when enabled or ccsFALSE when disabled
· eventMask special (abnormal) events; the events are bitwise coded
· motMOTION_END the motion is completed
· motDRIVE_FAULT a drive fault error has occurred
· motEMERGENCY_STOP the emergency stop line is active
· motOVER_TEMPERATURE the temperature of the amplifier is too high
· motOVER_CURRENT the required current is too high
· motPOSITIONING_ERROR the positioning failed
· motON_LIMIT the motor has reached a limit (HW or SW)
· motNORMAL_STOP the motor shall stop
· motINTERLOCK_ACTIVE the interlock line is active
· motNEW_MOTION the motion has been redefined while moving
· motBOARD_INIT_READY the on-board HW initialization procedure is completed
· amplStatus actual amplifier board status motNOT_AVAILABLE, OK or ERROR
· powerStatus state of the electrical connection of the motor (enumeration type motCONNECTION):
· motDISCONNECTED the motor is electrically disconnected
· motNEGATIVE only the lower relay of the electrical connection is closed
· motPOSITIVE only the upper relay of the electrical connection is closed
· motBOTH the motor is electrically connected
· overCurrent the amplifier current if too high (see also eventMask)
possible values are ccsTRUE or ccsFALSE
· overTemperature the amplifier temperature is too high (see also eventMask)
possible values are ccsTRUE or ccsFALSE
· mconStatus actual motion controller board status motNOT_AVAILABLE, OK or ERROR
· driveFault the motion controller is in fault (see also eventMask)
possible values are ccsTRUE or ccsFALSE
· emergencyStop the emergency stop HW switch has been activated (see also eventMask)
possible values are ccsTRUE or ccsFALSE
· posError the motion is aborted (see also eventMask)
possible values are ccsTRUE or ccsFALSE
· inPos the motor has reached the required position
possible values are ccsTRUE or ccsFALSE
· onLimit the motor is on limit (see also eventMask)
possible values are ccsTRUE or ccsFALSE
· amplOnLimit amplifier HW limit flag (enumeration type motLIMITS):
· motNOT_ON_LIMIT
· motHW_UPPER motor reached upper amplifier HW limit
· motHW_LOWER motor reached lower amplifier HW limit
· mconOnLimit motion controller SW/HW limit flag (enumeration type motLIMITS):
· motNOT_ON_LIMIT
· motSW_UPPER motor reached upper motion controller SW limit
· motSW_LOWER motor reached lower motion controller SW limit
· motHW_UPPER motor reached upper motion controller HW limit
· motHW_LOWER motor reached lower motion controller HW limit
· motHW_BOTH both HW limits are indicated
(for example if cable to motor is disconnected)
· mconOnRef motor on Reference switch, possible values are ccsTRUE or ccsFALSE
· mconOnInd motor on encoder index pulse, possible values are ccsTRUE or ccsFALSE
· interlock value of the I/O "interlock" signal (see [1])
possible values are ccsTRUE or ccsFALSE
· speed actual speed of the motor in user speed unit
· speedUnit unit of the speed value (is the default speed unit)
· current actual motor current in user current unit
· currentUnit unit of the motor current value (is the default current unit)
· posEnc actual position in encoder ticks
· posUser actual position in user position unit (attribute posUnit)
· posUnit unit of the position values (is the default position unit)
· posName actual position name
· posSection section where the name was found (enumeration type motSECTION):
· motOBSERVATION
· motMAINTENANCE
· motUSER_DEFINED
· motNO_SECTION
· posIndex index of the named position in the table (-1 if none)
· nextPosEnc next position in encoder ticks
· nextPosUser next position in user position unit
· nextPosName next position name
· nextPosSection section where the name was found (see attribute posSection)
· nextPosIndex index of the named position in the table (-1 if none)
· followingErr actual following error in user unit
· time UTC start and end times of the last motion

Note 1: the ccsTIMEVAL structure of the UTC times is mapped into a dbTABLE structure of one vltUINT32 for the seconds and one vltINT32 for the micro-seconds. The first record of the attribute time contains the start time, whereas the second the end time of the motion.

4.6 Server Section

This section includes all information about configuration, position and speed parameters, unit conversion and HW initialization of a motor. This section is divided into three subsections.

For each motor to be controlled by MCM, all attributes described in the following have to be set up. Attribute and field names must not be changed.

4.6.1 Configuration Section

This section includes the following attributes:

· motor describes the motor type and motor dependent parameters; this attribute contains only one record with the following parameters
· type indicates the motor type (enumeration type motMOTOR_TYPE).
· timeout indicates the time-out value in ms for a motion step.
· timelim indicates the time-out value in ms for the motor to move out of limit.
· timemon indicates the period in ms for automatic status sampling.
· opMode indicates the operational mode on the first attachment.
· motNORMAL
· motSIMULATION
· motHANDSET
· motNOT_AVAILABLE
· motFIXED_POSITION

Note: The following fields of the attribute motor are only relevant for the operational mode FIXED_POSITION; they define the position of the motor to be retrieved by motGetStatus. This position can not be modified by the API functions.

· posEnc indicates the position value in encoder ticks
· posUser indicates the position value in user units
· posUnit indicates the unit of posUser
· posName indicates the position name
· posSection indicates the corresponding section of posName

The last field is a logical flag that indicates how the HW limits have to be handled:

· chkHwLimit when set tells the SW to check the HW limits for simultaneous activation indicating a possible HW problem (connection broken).

Instance DC motor in normal mode, motion timeout is 100s, limit timeout is 5s and the status is refreshed every 1 second, with HW limits check
ATTRIBUTE Table SERVER:CONF.motor (1)
BEGIN
Value ((motDC_MOTOR,100000,5000,1000,motNORMAL,0,0.0,"","",0,1))
END
Instance Stepper motor in Fixed-Position mode, set to 50 deg, no HW limit check
ATTRIBUTE Table SERVER:CONF.motor (1)
BEGIN
Value ((motSTEPPER_MOTOR,10000,5000,1000,motFIXED_POSITION,0,50.0,"deg","",0,0))
END

· boards contains all necessary information about the boards, the order must be strictly respected, so that index in the table is the board type.
· type indicates the type of the board (enumeration type motBOARD_TYPE):
· motAMPLIFIER
· motCONTROLLER
· motDIGITAL_IO
· available indicates if the board is available ccsTRUE or ccsFALSE.
For the Digital I/O board, the signals will be configured and processed if this field is TRUE.
· prefix specifies the prefix of the SDL SW module to be used for interfacing the device driver. If no prefix is given, it will be assumed that the board is not controlled by MCM (Stand-Alone). This applies mainly for the amplifier which must be present (available must be set to ccsTRUE), but shall not be accessed by MCM.
Since no SDL module is associated to the Digital I/O board, the prefix shall be left empty.
Instance (for stand-alone amplifier (e.g. Stepper) and no I/O signals)
ATTRIBUTE Table SERVER:CONF.boards (motMAX_BOARD)
BEGIN
Value ((motAMPLIFIER,motAVAILABLE,""),
(motCONTROLLER,motAVAILABLE,"mac4"),
(motDIGITAL_IO,motNOT_APPLICABLE,""))
END

Instance (for DC motor and I/O signals)
ATTRIBUTE Table SERVER:CONF.boards (motMAX_BOARD)
BEGIN
Value ((motAMPLIFIER,motAVAILABLE,"vme4sa"),
(motCONTROLLER,motAVAILABLE,"mac4"),
(motDIGITAL_IO,motAVAILABLE,"/acro0"))
END

· events contains all necessary information about event/signal handling; it is possible to configure up to 32 events; for each event, a literal is defined in the file mot.h.
For each event to be configured one record has to be defined containing the following fields:
· type indicates the event type
· motMOTION_END Interrupt generated by the motion controller
· motDRIVE_FAULT Interrupt generated by the motion controller
· motEMERGENCY_STOP Interrupt generated by the motion controller
· motOVER_TEMPERATURE Status bit set by the servo amplifier
· motOVER_CURRENT Status bit set by the servo amplifier
· motPOSITIONING_ERROR Status bit set by the motion controller
· motON_LIMIT Status bit set by the motion controller
· motNORMAL_STOP Software event
· motINTERLOCK_ACTIVE Event set by I/O Signal
· motNEW_MOTION Software event
· motBOARD_INIT_READY Status bit set by the motion controller
· source indicates the source by which the event is indicated (enumeration type motEVENT_TYPE):
· motNO_EVENT the event is not handled
· motEVENT_SIGNAL the event is indicated by a signal (see [1] and 2.4.11)
· motEVENT_INTERRUPT the event is flagged by an interrupt (see 2.4.10)
· motEVENT_SOFTWARE the event is detected by software (status polling)
· boardType indicates in case of motEVENT_INTERRUPT, by which board the interrupt is generated (enumeration type motBOARD_TYPE)
· eventName indicates in case of motEVENT_INTERRUPT, the name of the signal as configured by the LCC common software facility

Example:
The event MOTION_END shall be reported by an interrupt generated by the motion controller board:
· type = motMOTION_END
· source = motEVENT_INTERRUPT
· boardType = motCONTROLLER
· eventName = "motionEnd"
Instance
ATTRIBUTE Table SERVER:CONF.events (motMAX_EVENT)
BEGIN
Value (
(motMOTION_END, motEVENT_INTERRUPT, motCONTROLLER,"motionEnd"),
(motDRIVE_FAULT, motEVENT_INTERRUPT,motCONTROLLER,"driveFault"),
(motEMERGENCY_STOP,motEVENT_INTERRUPT,motCONTROLLER,"emergencyStop"))
(motINTERLOCK_ACTIVE,motEVENT_SOFTWARE,motCPU_BOARD,""))
END

· signals This attribute contains information relative to the three I/O signals:
· brakeSignal acts on the brakes of the motor (clamp/unclamp)
· brakeStatusSignal reports the status of the brake
· interlockSignal reports the state of the interlock line.
· signal indicates the type of the signal (motSIGNAL_TYPE)
· motNO_SIGNAL no signal is connected
· motSIGNAL_BRAKE_ACTION signal to clamp/unclamp the brake
· motSIGNAL_BRAKE_STATUS brake status signal
· motSIGNAL_INTERLOCK interlock line signal
· device name of the device which shall process the signals. The standard device is the digital I/O board, but some special applications may use a different board such as the CAMAC Motion Controller which can also handle I/O signals.
The board must be declared as available (see attribute boards).
Example: /acro0 for the Acromag digital I/O board device (1 device , 64 I/O lines / board).

The two following fields apply only for the standard digital I/O board.
· startBit indicates which I/O line of the device shall be linked to the signal

The signals are mapped on one line only

· level indicates the logic level of the signal
· motSIGNAL_OFF the signal is disconnected
· motSIGNAL_ACTIVE_LOW the signal is active low
· motSIGNAL_ACTIVE_HIGH the signal is active high

Instance
ATTRIBUTE Table SERVER:CONF.signals (motMAX_SIGNAL)
BEGIN
Value (
(motSIGNAL_BRAKE_ACTION,"/acro0",0,motSIGNAL_ACTIVE_HIGH),
(motSIGNAL_BRAKE_STATUS,"/acro0",1,motSIGNAL_ACTIVE_HIGH),
(motSIGNAL_INTERLOCK, "/acro0",2,motSIGNAL_ACTIVE_HIGH))
END

· axis indicates the type of the axis (enumeration type motAXIS_TYPE):
· motAXIS_LINEAR the axis is linear
· motAXIS_CIRCULAR the axis is circular (no SW nor HW limits)
· motAXIS_CIRCULAR_OPT ditto but optimized
Instance
ATTRIBUTE SERVER:CONF.axis motAXIS_CIRCULAR_OPT

· encoder Encoder Configuration
· type Encoder type (enumeration type motENC_TYPE)
· motENC_NONE no encoder is used (STP only, internal step counting)
· motENC_INC the encoder is incremental (INC/STP internal, or external)
· motENC_ABS the encoder is absolute (SSI internal, or external encoder)
· motENC_ABS_REL the encoder is absolute, but the information is processed as relative (SSI internal, or external encoder)
· board Interface board (see enumeration type motBOARD_TYPE).
· motCONTROLLER the encoder is connected to the motion controller board
· motEXT_BOARD the encoder is connected to an external interface board
· motCPU_BOARD the encoder is connected to the CPU
· coding Coding type (enumeration type motENC_CODING) is not yet used
· address VME Address where to read the position information, for encoder connected to an external interface board only (must be ZERO for motCPU_BOARD).
· resolution Encoder resolution (bits) for Absolute encoder only
· count Encoder counts / Encoder revolution
· circularRange Encoder counts / Device turn
· stepCount Encoder counts / Motor turn (STP only)
· bitShift Bit shift (Absolute encoder only)

Instance (incremental encoder, stepper motor with 25000 steps/turn, linear axis)
ATTRIBUTE Table SERVER:CONF.encoder (1)
BEGIN
Value ((motENC_INC,motCONTROLLER,motCODE_BINARY,0,15,32767,0,25000,0))
END

Instance (absolute encoder, 16 bits, 2 bits right shift, linear axis)
ATTRIBUTE Table SERVER:CONF.encoder (1)
BEGIN
Value ((motENC_ABS,motCONTROLLER,motCODE_BINARY,0,16,65536,0,0,2))
END

Instance (stepper 2000 steps/turn, no encoder, circular axis 72000 steps/turn)
ATTRIBUTE Table SERVER:CONF.encoder (1)
BEGIN
Value ((motENC_NONE,0,0,0,0,0,72000,2000,0))
END
Instance (incremental encoder supported by the CPU, 16 bits, linear axis)
ATTRIBUTE Table SERVER:CONF.encoder (1)
BEGIN
Value ((motENC_INC,motCPU_BOARD,motCODE_BINARY,0,16,65535,0,0,0))
END
Instance (absolute encoder, external encoder interface,24 bits, address 0xAAAE04)
ATTRIBUTE Table SERVER:CONF.encoder (1)
BEGIN
Value ((motENC_ABS,motEXT_BOARD,motCODE_BINARY,0xAAAE04,24,16777215,0,0))
END

· specialPositions contains information for the configuration of the special positions (resp. lower and upper SW limits, lower and upper HW limits, Reference Switch, Home Position and Index-Pulse). If the position is not reached during the HW initialization procedure, the positions flagged TRUE are activated as if they had been reached; the associated position is then the one stored below. The position type shall reference an absolute or a relative position (relative to the current position or to one of the valid hardware positions). For the hardware positions, the position type shall not reference a SW limit; only valid hardware positions shall be referenced (the setting follows the order of the array).
· setLimit Position set flag (ccsTRUE or ccsFALSE), if TRUE, the position will be set as declared here.
· posType Position type (see motPOS_TYPE enumeration)
· posUser Position in user unit
· unit Position unit
Instance
ATTRIBUTE Table SERVER:CONF.specialPositions (motMAX_SPECIAL_POSITION)
BEGIN
Value (
(motSET,motLOWER_LIMIT,1.0,"deg"), set lower SW limit to 1 deg above the lower HW limit
(motNONE,0,0.0,""), do not set the upper SW limit
(motNONE,0,0.0,""), do not set the lower HW limit
(motSET,motABSOLUTE,300,"deg"), set the upper HW limit to 300 deg
(motNONE,0,0.0,""), do not set the Reference Switch position
(motSET,motREFERENCE_SWITCH,-10.0,"Enc"), set the Home position 10 Enc below REF
(motSET,motRELATIVE,100.0,"Enc")) set the Index Pulse position 100 Enc above the actual position
END

· offsets contains the default offsets from observation positions to maintenance and user defined positions, these offsets are used is the offsets are marked not available in the named positions table; one record has to be defined containing the following parameters:
· maintOffset indicates the default offset to maintenance positions
· userOffset indicates the default offset to user defined positions
· unit indicates the unit of the offset values defined above
The following 2 fields are reserved for internal use only

Example
The default offsets from observation to the maintenance/user defined positions should be resp. 90deg/180deg.
· maint = 90
· user = 180
· unit = "deg"
Instance
ATTRIBUTE Table SERVER:CONF.offsets (1)
BEGIN
Value ((90.0,180.0,"deg",0,0))
END

· namedPositions contains the definition of the named positions, the table is preset with one empty row; for each named position one record has to be specified. The total number of named positions must be set in the instance.
· name indicates the position name (up to 31 characters)
· posType indicates the position type of the named position
(enumeration type motPOS_TYPE)
· obsPos defines the position value for the observation section
· lowRange defines the lower range of the named position relative to obsPos
lower limit of the named position = obsPos - lowRange
· upRange defines the upper range of the named position relative to obsPos
upper limit of the named position = obsPos + upRange
· maintOffsetAvail indicates whether the default offset for the maintenance position should be used or not; possible values are
· maintOffset contains the offset for the maintenance position, if default one should not be used
· userOffsetAvail indicates whether the default offset for the user defined position should be used or not
· userOffset contains the offset for the user defined position, if default one should not be used
· posUnit Position unit for all fields defined above
The following 10 fields are reserved for internal use only
Note: It is recommended to use the filler macro motDB_CONF_NPOS_FILLER defined in motCOMMON.class when instanciating the named positions.

Example
The position "RED" should be defined; the exact position, lower and upper range should be 100deg/800deg/110deg. For the maintenance position, the default offset should be used, for the user defined position the offset +30deg should be used.
· name = "red"
· posType = motABSOLUTE
· obsPos = 100.0
· lowRange = 20.0
· upRange = 10.0
· maintFlag = FALSE
· maintOffset = 0
· userFlag = TRUE
· userOffset = 30.0
· posUnit = "deg"
Instance
ATTRIBUTE Table SERVER:CONF.namedPositions (2)
BEGIN

Value (

("red", motABSOLUTE, 100.0,20.0, 10.0,0, 0.0,1,30.0,"deg",motDB_CONF_NPOS_FILLER),

("blue",motABSOLUTE,1500.0,50.0,150.0,1,100.0,0, 0.0,"Enc",motDB_CONF_NPOS_FILLER))

END

· namedSpeeds contains the definition of the named speeds, the table is preset with one empty row; for each named speed one record has to be specified. The total number of named speeds must be set in the instance.
· name indicates the speed name (up to 31 characters)
· speed indicates the speed value
· unit indicates the unit of the speed value
· pollInt indicates the polling interval (ms) (see 2.4.7)
· endPollInt indicates the end polling interval (ms)
· inPosTime indicates the in position time (ms)
The last field is reserved for internal use only.

Example
The speed "fast" should be defined; its value should be 10deg/sec. The polling interval during the "far" phase should be 100ms, during the "near" phase 30ms; the motor must be 150ms in position until the status "in position" is set.
· name = "fast"
· value = 10
· unit = "deg/sec"
· pollInt = 100
· endPollInt = 30
· inPosTime = 150
Instance
ATTRIBUTE Table SERVER:CONF.namedSpeeds (2)
BEGIN

Value (

("fast",10.0,"deg/sec", 100, 30, 150,0.0),

("fine", 2.0,"Enc/ms", 1000,100,2000,0.0))

END

· twoStepOffset contains the offset and speed definition for Two Step type motions.
· offset Offset
· unit Offset unit
· speedHow Speed definition (enumeration type motSPEC_TYPE)
· speedValue Speed value
· speedUnit Speed unit
· speedName Speed name
· speedIndex Speed index
· pollInt Polling interval (ms)
· endPollInt End polling interval (ms)
· inPosTime In position time (ms)
The following 2 fields are reserved for internal use only
Instance
ATTRIBUTE Table SERVER:CONF.twoStepOffset (1)
BEGIN

Value ((10.0,"deg",motBY_NAME,0.0,"","fine",0,0,0,0,0,0.0))

END

· indexPulseSpeed contains the definition of the speed to be used for the fine search (second step) of the motion to the Index Pulse
· speedHow Speed definition (enumeration type motSPEC_TYPE)
· speedValue Speed value
· speedUnit Speed unit
· speedName Speed name
· speedIndex Speed index
· pollInt Polling interval (ms)
· endPollInt End polling interval (ms)
· inPosTime In position time (ms)
The last field is reserved for internal use only
Instance
ATTRIBUTE Table SERVER:CONF.indexPulseSpeed (1)
BEGIN
Value((motBY_INDEX,0.0,"","",3,0,0,0,0,0.0))
END

· defaultSpeed is the index of the named speed to use by default (speedHow = motBY_DEFAULT)
Instance
ATTRIBUTE SERVER:CONF.defaultSpeed 3

Important Note: the units for the positions (attributes specialPositions, offsets, namedPositions and twoStepOffset) must be either Enc or the default position unit (attribute <path>:SERVER:UNIT.defaultUnits(1,position)). During installation, SW and HW initialization, the system will attempt to resolve these attributes in board position unit Enc; if some special positions or named positions can not be fully resolved by completion of the HW initialization sequence, the motor will not go in the motINIT_DONE initialization state, thus no motion can be initiated.

4.6.2 Initialization Section

This section contains the information describing the HW initialization procedure.

The attribute actions contains one record for each action to be performed.

· actions table of actions (the table is preset with one action, being motACTION_END). The total number of actions must be set in the instance.
· actionType specifies the action type (enumeration type motACTION_TYPE)
· motACTION_END the last action of the HW initialization procedure (optional)
· motACTION_MOVE initiate a motion
· motACTION_SET_UP_SW_LIMIT set the upper SW limit
· motACTION_SET_LOW_SW_LIMIT set the lower SW limit
· motACTION_SET_ENC_VALUE set the current position
· motACTION_CLAMP_BRAKE clamp the brake
· motACTION_DISCONNECT disconnect the power lines
· motACTION_USERFUNCTION execute a user-defined function
· motACTION_BOARD_PROCEDURE start an on-board HW initialization procedure
· motACTION_DELAY delay next init step
The following two fields are required for the action motACTION_USERFUNCTION:
· userFctName User initialization function name (up to 31 characters) (see 2.4.12)
· userParList Address of user parameter list (see 2.4.12)
The following field is shared for the actions motACTION_BOARD_PROCEDURE and motACTION_DELAY:
· initCode Initialization procedure code / delay in milliseconds
The following field is required for the action motACTION_MOVE:
· motionMode Motion mode (see enumeration type motMOTIONMODE)
The following fields are required for the actions
motACTION_MOVE,
motACTION_SET_UP_SW_LIMIT,
motACTION_SET_LOW_SW_LIMIT and
motACTION_SET_ENC_VALUE :
· posHow Position definition (see enumeration type motSPEC_TYPE)
· posValue Position in user unit
· posUnit Position unit
· posName Position name
· posSection Position section
· posIndex Position index
· posType Position type (see enumeration type motPOS_TYPE)
The following fields are required for the action motACTION_MOVE:
· speedHow Speed definition (see enumeration type motSPEC_TYPE)
· speedValue Speed in user unit
· speedUnit Speed unit
· speedName Speed name
· speedIndex Speed index
· pollInt Polling interval (ms)
· endPollInt End polling interval (ms)
· inPosTime In position time (ms)

Example
The HW initialization sequence should consist in the six following actions
1. move to the lower HW limit at the named speed "coarse"
2. move to the reference switch at the indexed speed 1
3. initialize current position to 0 deg
4. set lower SW limit to +1000 Enc relative to the lower HW limit
5. move to observation position "red" at the speed 2deg/sec
6. clamp the brake
Accordingly, the attribute actions contains seven records set up in the following way (the fields not mentioned are not relevant for the action).
1. record #0
actionType = motACTION_MOVE
motionMode = motSPEED_MODE
posType = motLOWER_LIMIT
posHow = motBY_VALUE
posValue = 0.0
posUnit = "deg"
speedHow = motBY_NAME
speedName = "coarse"
2. record #1
actionType = motACTION_MOVE
motionMode = motSPEED_MODE
posType = motREFERENCE_SWITCH
posHow = motBY_VALUE
posValue = 0.0
posUnit = "deg"
speedHow = motBY_INDEX
speedIndex = 1
3. record #2
actionType = motACTION_SET_ENC_VALUE
posType = motABSOLUTE
posHow = motBY_VALUE
posValue = 0.0
posUnit = "deg"
4. record #3
actionType = motACTION_SET_LOWER_SW_LIMIT
posType = motLOWER_LIMIT
posHow = motBY_VALUE
posValue = +1000
posUnit = "Enc"
5. record #4
actionType = motACTION_MOVE
motionMode = motPOSITION_MODE
posType = motABSOLUTE
posHow = motBY_NAME
posName = "red"
posSection = motOBSERVATION
speedHow = motBY_VALUE
speedValue = 2.0
speedUnit = "deg/sec"
pollInt = 2000
endPollInt = 200
inPosTime = 1500
6. record #5
actionType = motACTION_CLAMP_BRAKE
7. record #6 (optional)
actionType = motACTION_END
Instance
ATTRIBUTE Table SERVER:INIT.actions (7)
BEGIN
Value(
(motACTION_MOVE,"",0,0,motSPEED_MODE,motNONE,0.0,"","",0,0,
motLOWER_LIMIT,motBY_NAME,0.0,"","coarse",0,0,0,0),
(motACTION_MOVE,"",0,0,motSPEED_MODE,motNONE,0.0,"","",0,0,
motREFERENCE_SWITCH,motBY_INDEX,0.0,"","",1,0,0,0),
(motACTION_SET_ENC_VALUE,"",0,0,0,motBY_VALUE,0.0,"deg","",0,0,
motABSOLUTE,motNONE,0.0,"","",0,0,0,0),
(motACTION_SET_LOWER_SW_LIMIT,"",0,0,0,motBY_VALUE,1000.0,"Enc","",0,0,
motLOWER_LIMIT,motNONE,0.0,"","",0,0,0,0),
(motACTION_MOVE,"",0,0,motBY_NAME,0.0,"","red",motOBSERVATION,0,
motPOSITION_MODE,motBY_VALUE,2.0,"deg/sec","",0,2000,200,1500),
(motACTION_CLAMP_BRAKE,"",0,0,0,0,0.0,"","",0,0,0,0,0.0,"","",0,0,0,0),
(motACTION_END,"",0,0,0,motNONE,0.0,"","",0,0,0,0,0.0,"","",0,0,0,0))
END

4.6.3 Unit Conversion Section

This section contains the definition of the unit conversion methods to be used.

The first attribute of this section contains the definition of the default user units:

· defaultUnits defining the default user units; this attribute contains only one record with the following parameters
· position indicates the default user unit for position values
· speed indicates the default user unit for speed values
· current indicates the default user unit for motor current values

Example
The default user units for position, speed and motor current should be deg, deg/sec and mA
· position = "deg"
· speed = "deg/sec"
· current = "mA"
Instance
ATTRIBUTE Table SERVER:UNIT.defaultUnits (1)
BEGIN
Value(("deg","deg/sec","mA"))
END

Furthermore, for each user unit and at least for the default user units the following unit conversions have to be specified

a. user unit position value to an encoder unit (Enc)
b. user unit speed value to an encoder unit (Enc/ms)
c. user unit speed value to a velocity reference value (Ref for amplifier only)
d. user unit value of the motor current to amplifier (Dig) unit

Each unit conversion has to be specified by one record in the table attribute unitConversion, whereby origin and destination units are defined in the name stored in the first field of the record.

The names have to be built up in the following way:

· a position <user position unit>ToEnc (a)
· a speed <user speed unit>ToEnc/ms (b)
<user speed unit>ToRef (c)
· a motor current <user current unit>ToDig (d)

Example
According to the example above the following methods must be provided:
· degToEnc
· deg/secToEnc/ms
· deg/secToRef
· mAToDig

Note: All the conversion method shall apply on values and return values of type vltDOUBLE.


Each record of the attribute unitConversion contains the following fields:

· unitConversion contains the definition of the conversion methods, the table is preset with four empty rows. The total number of conversion methods must be set in the instance.
· name indicates the unit conversion (for example "degToEnc")
· method indicates the conversion method
· motEXTERN the conversion is performed by a user provided function (see 2.4.12).
· motLINEAR for a linear transformation
<destination value> = offset + slope * <origin value>
· motINTERPOLATION the destination value is calculated by linear interpolation
The two following fields are required for the method motEXTERN.
· userFctName is the name of the user-defined conversion function
· userParList contains the address of the data structure to be passed to the user-defined function (see 2.4.12).
The two following fields are required for the method motLINEAR.
· offset is the coordinate at x = 0 in board unit
· slope is the slope of the line (y = slope * x + offset) in board unit/user unit
The following 101 fields are required for the method motINTERPOLATION. They must contain the interpolation table (entries (x1,y1) to (x50,y50)), which must define the complete domain of validity of the physical measures (the values are not extrapolated), but all the 50 points do not need to be defined.
· numPoints indicates the number of entries in the interpolation table; up to 50 entries are allowed (macro motMAX_INTERPOL_POINTS).
· x1,y1 first point
...
· x50,y50 50th point
The last field is reserved for internal use only (should be set to zero).

Important Note: The conversion apply only for Absolute values. For relative positions, dedicated treatment must be implemented.



Examples
The conversion of a speed from "m/s" to an encoder specific value and vice versa should be done by the user function "convertSpeed".
· Therefore one record has to be set up containing
name = "m/sToEnc/ms"
method = motEXTERN
userFctName = "convertSpeed'

The relation between a position value in "deg" and the encoder specific unit is linear:
position[Enc] = 10.0 [Enc] + 200 [Enc/deg] * position [deg]
· Therefore one record has to be set up containing
name = "degToEnc"
method = motLINEAR
offset = 10.0
slope = 200.0
Note: the conversion will fail if the slope is smaller than 10-10.

To get the motor current value in "mA" out of the digital one a linear interpolation has to be performed. An interpolation table with 20 entries shall be made available
· Therefore one record has to be set up containing
name = "mAToDig"
method = motINTERPOLATION
numPoints = 20
x1 = 1.0 y1 = 0.05
x2 = 2.0 y2 = 0.06
....
x20 = 20.0 y20 = 3.576
x21 = 0.0 x21 = 0.0
....
x50 = 0.0 y50 = 0.0
Note: The conversion will fail for x values smaller than 1.0 or greater than 20.0 or y values smaller than 0.05 or greater than 3.576

Note : when instanciating the unit conversion methods, it is recommended to use the filler macros provided in motCOMMON.class as follows:

· LINEAR :
("degToEnc",motLINEAR,"",0,10.0,200.0,motDB_UNIT_LINEAR_FILLER)
· INTERPOLATION:
· EXTERN:
("m/sToEnc/ms",motEXTERN,"convertSpeed",0,0.0,0.0,motDB_UNIT_EXTERN_FILLER)

4.6.4 Internal Section

This section is reserved for internal use.

4.7 SDL section

The implementation of this part depends upon the hardware configuration. Its structure is identical for all types of SDL devices. The following rules shall apply:

1. The name of the SDL device point MUST be the name of the associated SDL software module in uppercase.
2. The SDL device point must be an instanciation of a sub-class of the generic class sdlBASE, as described in sdlCOMMON.class. Specialized sub-classes are available in the class definition files mconCOMMON.class for a motion controller, and amplCOMMON.class for an amplifier.
3. The RUN part must contain first the copy of the configuration parameters in the same order as in the CFG part and then the specific run-time parameters.

4.7.1 CFG section

This section contains the configuration parameters to be used for the SDL board. These values will be loaded onto the board during the SW initialization stage.

· device defines the SDL device driver to use for communications with the board.
· driver name of the driver module
· number channel number
· configValues vector containing the values of all the parameters to be set during SW initialization; these attribute is Read-Only.

4.7.2 RUN section

This section contains the run-time parameters to used by the SDL board. These values are updated every time they are read from/written to the board..

· currentValues vector containing the current values of all the parameters of the board. The first part of the vector contains the values of the configuration parameters as set. The second part contains pure run-time parameters.
· status vector containing the board status word(s).

For Motion Controllers only,

· interrupts table containing the information for all interrupts configured on the board.

4.8 SDL Sections of supported boards

The following sub-sections describe the implementation of the SDL points for the two boards supported by ESO for motion control.

4.8.1 Servo Amplifier VME4SA-X1

This section describes the board parameters for the ESO standard DC motor servo amplifier VME4SA-X1.

For the Stepper motors, the ESO standard amplifier VME4ST is not controlled by MCM (Stand-Alone).

4.8.1.1 CFG section
· device defines the SDL device driver to use for communications with the board.
· driver preset to ampl
· number channel number
· configValues vector containing one value.
Mnemonic Description Range Preset Unit
Min Max
DO DAC Offset -128 127 0 -
4.8.1.2 RUN section
· currentValues vector containing 3 values.
Mnemonic Description Range Preset Unit
Min Max

CFG Parameters

(see CFG configValues)

RUN Parameters

VR Velocity Reference -255 255 0 -1
MC Motor Current (read only)
· status vector containing 2 status words (Read only).

AS Axis Status

BS Board Status

4.8.2 Motion Controller MAC4

This section describes the board parameters for all hardware types (INC, SSI and STP).

4.8.2.1 CFG section
· device defines the SDL device driver to use for communications with the board.
· driver preset to mcon
· number channel number preset to zero (0)
· configValues vector containing 47 values.