From 975824224992c1be648e8a0eb601db21a4253be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstro=CC=88m?= Date: Sat, 28 Sep 2024 13:51:15 +0200 Subject: [PATCH 1/8] Fix spelling in manual --- hugo/content/manual/PLC_cfg/_index.md | 4 +- hugo/content/manual/PLC_cfg/best_practice.md | 12 ++-- hugo/content/manual/PLC_cfg/function_libs.md | 10 ++-- hugo/content/manual/PLC_cfg/syntax.md | 16 +++--- .../manual/general_cfg/best_practice.md | 2 +- .../manual/general_cfg/data_storage.md | 8 +-- .../content/manual/general_cfg/iocsh_utils.md | 4 +- .../manual/general_cfg/startup/_index.md | 4 +- .../manual/knowledgebase/ethercatCLI.md | 2 +- .../manual/knowledgebase/hardware/EL5042.md | 18 +++--- .../manual/knowledgebase/hardware/EL70x1.md | 8 +-- .../manual/knowledgebase/hardware/EL9xxx.md | 6 +- .../manual/knowledgebase/hardware/host.md | 20 +++---- hugo/content/manual/knowledgebase/motion.md | 34 +++++------ hugo/content/manual/motion_cfg/_index.md | 2 +- hugo/content/manual/motion_cfg/axisPLC.md | 2 +- hugo/content/manual/motion_cfg/axisYaml.md | 16 +++--- .../manual/motion_cfg/best_practice/_index.md | 8 +-- .../manual/motion_cfg/best_practice/servo.md | 10 ++-- .../best_practice/stepper_biss_c.md | 16 +++--- hugo/content/manual/motion_cfg/direction.md | 4 +- hugo/content/manual/motion_cfg/homing.md | 56 +++++++++---------- hugo/content/manual/motion_cfg/scaling.md | 24 ++++---- 23 files changed, 143 insertions(+), 143 deletions(-) diff --git a/hugo/content/manual/PLC_cfg/_index.md b/hugo/content/manual/PLC_cfg/_index.md index 8134d163b..4b4498e5e 100644 --- a/hugo/content/manual/PLC_cfg/_index.md +++ b/hugo/content/manual/PLC_cfg/_index.md @@ -42,7 +42,7 @@ All keys are mandatory. - `id`: PLC id, unique **uint** - `enable`: PLC enabled at start -- `rateMilliseconds`: execution rate in ms. To execute every cycle, independant of cycle rate, use `-1`. +- `rateMilliseconds`: execution rate in ms. To execute every cycle, independent of cycle rate, use `-1`. - `code`: dictionary of code lines. {{% notice note %}} @@ -73,7 +73,7 @@ All keys are mandatory. - `id`: PLC id, unique **uint** - `enable`: PLC enabled at start -- `rateMilliseconds`: execution rate in ms. To execute every cycle, independant of cycle rate, use `-1`. +- `rateMilliseconds`: execution rate in ms. To execute every cycle, independent of cycle rate, use `-1`. - `file`: PLC text file to load. {{% notice warning %}} diff --git a/hugo/content/manual/PLC_cfg/best_practice.md b/hugo/content/manual/PLC_cfg/best_practice.md index 7167aab3a..328e0c932 100644 --- a/hugo/content/manual/PLC_cfg/best_practice.md +++ b/hugo/content/manual/PLC_cfg/best_practice.md @@ -5,13 +5,13 @@ chapter = false +++ ## best practice -Here you can find some best practice configurations for common usecases. +Here you can find some best practice configurations for common use cases. * Macros * MSI include, substitute * Printouts * Description -The complete examples with starup files can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice) +The complete examples with startup files can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice) ### macros Use of macros makes the code more generic. When loading a PLC file with "loadPLCFile.cmd", custom macros can be defined in "PLC\_MACROS": @@ -27,7 +27,7 @@ In addition to the custom macros, a few macros, that are often needed, are prede 4. M : ec #### SELF_ID and SELF example -A common usecase is that some initiation is needed, could be triggering of a custom homing sequence: +A common use case is that some initiation is needed, could be triggering of a custom homing sequence: ```C if(${SELF}.firstscan) { @@ -72,8 +72,8 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=.:./cf The "INC" parameter can contain several directories separated with a ":", making it possible to include PLC files from several locations/modules. #### example: Toggle a few outputs -As a demo usecase let's consider that a few outputs needs to be toggled. -NOTE: There are simpler ways to write this specifc code but it's used to demo how code can be divided. +As a demo use case let's consider that a few outputs needs to be toggled. +NOTE: There are simpler ways to write this specific code but it's used to demo how code can be divided. Lets first define some code that toggles a bit (toggle\_output.plc\_inc): ```shell @@ -104,7 +104,7 @@ The resulting code will toggle two different outputs, the state of the last outp NOTE: Macros cannot be used in the filename when including a file. Instead the dir should be defined in the INC param when loading the PLC, see above. ### printouts -Adding a DBG macro can be usefull to be able to turn on/off printouts. Typically during commsioning it can be usefull to have many printouts but later when system goes into production, it could be a good idea to turn (some) printouts off. +Adding a DBG macro can be use full to be able to turn on/off printouts. Typically during commissioning it can be use full to have many printouts but later when system goes into production, it could be a good idea to turn (some) printouts off. Example of a printout that can be turned on/off (default off) ```C diff --git a/hugo/content/manual/PLC_cfg/function_libs.md b/hugo/content/manual/PLC_cfg/function_libs.md index b5530f6c2..abf4c9e0e 100644 --- a/hugo/content/manual/PLC_cfg/function_libs.md +++ b/hugo/content/manual/PLC_cfg/function_libs.md @@ -22,7 +22,7 @@ Example: ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadPLCLib.cmd, "FILE=./plc/test.plc_lib, PLC_MACROS='OFFSET=3'" ``` -The functions must be defined accordning to this template (max 5 parameters): +The functions must be defined according to this template (max 5 parameters): ```C function (,...,) { ; @@ -38,9 +38,9 @@ function () { * Several functions can be defined in the same file. * For syntax of the "code body", check [plc syntax](../syntax) and the exprtk website. -* The parameters aswell as the return value must be scalars, however, local vectors can be defined and used in calculations (initiations of vector can be done with MACROS, constants or parameters). +* The parameters as well as the return value must be scalars, however, local vectors can be defined and used in calculations (initiations of vector can be done with MACROS, constants or parameters). * "#" as a first char in a line is considered a comment (the line will be removed before compile). -* The lib file will be parsed through MSI allowing macro expansion, "include" and "subsitute" commands. For more info check [best practice](../best_practice) and msi documentation/help. +* The lib file will be parsed through MSI allowing macro expansion, "include" and "substitute" commands. For more info check [best practice](../best_practice) and msi documentation/help. ### can be used in functions 1. The parameters @@ -105,8 +105,8 @@ function testm2m() { ``` ### debugging -Unfortunately debugging of function libs is not as easy as normal PLC:s since exprtk returns less infomation at compile failure. +Unfortunately debugging of function libs is not as easy as normal PLC:s since exprtk returns less information at compile failure. {{% notice tip %}} -In order to troubleshoot, load the code as a normal PLC instead. This way you will get more diagnostics. Also remember, ecmc varaibles cannot be accessed in plc libs. +In order to troubleshoot, load the code as a normal PLC instead. This way you will get more diagnostics. Also remember, ecmc variables cannot be accessed in plc libs. {{% /notice %}} diff --git a/hugo/content/manual/PLC_cfg/syntax.md b/hugo/content/manual/PLC_cfg/syntax.md index 528510def..19977bc5d 100644 --- a/hugo/content/manual/PLC_cfg/syntax.md +++ b/hugo/content/manual/PLC_cfg/syntax.md @@ -14,8 +14,8 @@ For detailed syntax help please visit the [exprtk website](https://github.com/Ar ### functions PLC do _not_ immediately write to the bus! -The PLC will excecute synchronous to the cycle, or at an integer fraction of it. -The prcessed data will be send to the bus with the next cycle. +The PLC will execute synchronous to the cycle, or at an integer fraction of it. +The processed data will be send to the bus with the next cycle. PLCs do _not_ delay the bus! ### statement terminator @@ -25,7 +25,7 @@ Statements are terminated by a semicolon `;` All variables are initiated to `0` ### comments -The hash charactoer `#` is reserved for comments. +The hash character `#` is reserved for comments. Everything after this char will be removed before compile. {{% notice warning %}} `println('########');` will be seen by the compiler as `println('` ! @@ -66,7 +66,7 @@ Custom plc functions can be written in c in plugins. # 1. Assignment: # ec0.s1.VALUE:=100; # -# 2. if-else (note the equl sign): +# 2. if-else (note the equal sign): # if(ec0.s1.VALUE=100) { # # code # } @@ -215,14 +215,14 @@ Custom plc functions can be written in c in plugins. ```shell # 1. plc.enable plc enable (rw) # (end exe with "plc.enable:=0#" -# Could be usefull for startup +# Could be use full for startup # sequences) # 2. plc.error plc error (rw) # Will be forwarded to user as # controller error. # 3. plc.scantime plc sample time in seconds (ro) # 4. plc.firstscan true during first plc scan only (ro) -# usefull for initiations of variables +# use full for initiations of variables # 5. ax.plc.enable Same as plc.enable but for # axis sync plc. # 6. ax.plc.error Same as plc.error but for @@ -319,9 +319,9 @@ Custom plc functions can be written in c in plugins. # ); # Copies data from source memmap to dest memmap. The memmap ids are defined by the # order they are created (starting at 0). The smallest memmap size will define the -# amout of data copied. Returns 0 for success or an error code. +# amount of data copied. Returns 0 for success or an error code. # -# Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): +# Note: The mmId can be retrieved by the bellow ecmc command (and feed into plc via macro): # ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" # epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) # diff --git a/hugo/content/manual/general_cfg/best_practice.md b/hugo/content/manual/general_cfg/best_practice.md index f8c146157..413a4468b 100644 --- a/hugo/content/manual/general_cfg/best_practice.md +++ b/hugo/content/manual/general_cfg/best_practice.md @@ -5,7 +5,7 @@ chapter = false +++ ## EtherCAT rate (EC_RATE) -The default EtherCAT frame rate in ecmc is set to 1kHz. For most applications this is however not needed and can therefore be reduced. A reduced EtherCAT rate reduces the load on the controller. In general, a good value for the frame rate is in the range 100Hz to 1kHz. For motion systems, a frame rate of 100Hz..500Hz is normally enough. Rates ouside the 100Hz..1kHz range is normally not a good idea, and some slaves might not support it. However, in special cases both lower and higher rates might be possible and required. +The default EtherCAT frame rate in ecmc is set to 1kHz. For most applications this is however not needed and can therefore be reduced. A reduced EtherCAT rate reduces the load on the controller. In general, a good value for the frame rate is in the range 100Hz to 1kHz. For motion systems, a frame rate of 100Hz..500Hz is normally enough. Rates outside the 100Hz..1kHz range is normally not a good idea, and some slaves might not support it. However, in special cases both lower and higher rates might be possible and required. Example: Set rate to 500Hz ``` diff --git a/hugo/content/manual/general_cfg/data_storage.md b/hugo/content/manual/general_cfg/data_storage.md index 2a12be429..b750c410a 100644 --- a/hugo/content/manual/general_cfg/data_storage.md +++ b/hugo/content/manual/general_cfg/data_storage.md @@ -7,8 +7,8 @@ chapter = false ## data storage examples This dir contains two examples: [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/test/dataStorage). -1. Continiously add value to data storage. Push to epics by hw trigger. -2. Continiously add value to data storage. Push to epics by epics pv trigger. +1. Continuously add value to data storage. Push to epics by hw trigger. +2. Continuously add value to data storage. Push to epics by epics pv trigger. Data buffered data can be accessed by the "IOC_TEST:ds0-Data-Act" waveform pv (NELM 10000) Custom scale and offset can be applied to the stored values by MACROS (to the plc) in the startup file. @@ -17,7 +17,7 @@ Custom scale and offset can be applied to the stored values by MACROS (to the pl In this example the data stored in dataStorage 0 is pushed to epics at a falling edge of the axis 1 high limit. -Example 1 is started with the following stratup file: "add_data_to_buffer_trigg_push_hw.script" +Example 1 is started with the following startup file: "add_data_to_buffer_trigg_push_hw.script" ``` iocsh.bash add_data_to_buffer_trigg_push_hw.script @@ -55,7 +55,7 @@ static.highlimOld:=ax1.mon.highlim; In this example the data stored in dataStorage 0 is pushed to epics at a rising edge of the "IOC_TEST:Set-PushDataTrigger-RB" pv. -Example 2 is started with the following stratup file: "add_data_to_buffer_trigg_push_hw.script" +Example 2 is started with the following startup file: "add_data_to_buffer_trigg_push_hw.script" ``` iocsh.bash add_data_to_buffer_trigg_push_epics.script ``` diff --git a/hugo/content/manual/general_cfg/iocsh_utils.md b/hugo/content/manual/general_cfg/iocsh_utils.md index 5097251a0..94fb4c5e3 100644 --- a/hugo/content/manual/general_cfg/iocsh_utils.md +++ b/hugo/content/manual/general_cfg/iocsh_utils.md @@ -48,7 +48,7 @@ ecmcEpicsEnvSetCalc("test2", "061+1+2+3+4+5*10.1", "This is the number: 0x%06x") epicsEnvShow("test2") test2=This is the number: 0x00007a -#### Calculate scalings (floating point) +#### Calculate scaling (floating point) epicsEnvSet("IORange",32768) # ecmcEpicsEnvSetCalc("scaling", "$(test1)/$(IORange)*10", "%lf") ecmcEpicsEnvSetCalc("scaling", "061/32768*10", "%lf") @@ -87,7 +87,7 @@ result=0 ``` ### Iocsh function "ecmcEpicsEnvSetCalcTernary()" "ecmcEpicsEnvSetCalcTernary()" is used o evaluate expressions and set EPCIS environment variables to different strings. - depending on if the expression evaluates to "true" or "false". Can be usefull for: + depending on if the expression evaluates to "true" or "false". Can be useful for: * Choose different files to load like plc-files, axis configurations, db-files or.. * making conditional ecmc settings * ... diff --git a/hugo/content/manual/general_cfg/startup/_index.md b/hugo/content/manual/general_cfg/startup/_index.md index 0bf8222ca..e238faa16 100644 --- a/hugo/content/manual/general_cfg/startup/_index.md +++ b/hugo/content/manual/general_cfg/startup/_index.md @@ -12,7 +12,7 @@ startup.cmd takes the following arguments: ECMC_VER = 9.5.4 EthercatMC_VER = 3.0.2 (obsolete) INIT = initAll - MASTER_ID = 0 <-- put negatuve number to disable master, aka non ec-mode + MASTER_ID = 0 <-- put negative number to disable master, aka non ec-mode SCRIPTEXEC = iocshLoad NAMING = mXsXXX (default), ClassicNaming, ESSnaming EC_RATE = 1000 @@ -39,7 +39,7 @@ startup.cmd takes the following arguments: ECMC_SUPPORT_MOTION = Variable to be used to block use of motion (""/empty=support motion or "#-"=disable motion) ECMC_TMP_DIR = directory for temporary files, defaults to "/tmp/${IOC}/EcMaster_${ECMC_EC_MASTER_ID}}/" ECMC_EC_TOOL_PATH = path to ethercat tool - ECMC_SAMPLE_RATE_MS = current record update rate in milli seconds + ECMC_SAMPLE_RATE_MS = current record update rate in milliseconds ECMC_SAMPLE_RATE_MS_ORIGINAL = ECMC_SAMPLE_RATE_MS (used for restore to default if ECMC_SAMPLE_RATE_MS is changed) ``` diff --git a/hugo/content/manual/knowledgebase/ethercatCLI.md b/hugo/content/manual/knowledgebase/ethercatCLI.md index 56178b64b..fb6976b67 100644 --- a/hugo/content/manual/knowledgebase/ethercatCLI.md +++ b/hugo/content/manual/knowledgebase/ethercatCLI.md @@ -69,7 +69,7 @@ Ethernet devices: If the link is `DOWN`, try bringing the network device up manually. This, can be done with `ip link set up` -If the device name is unkown, check with `ip link show` and search for the MAC the EtherCAT master is bound to. +If the device name is unknown, check with `ip link show` and search for the MAC the EtherCAT master is bound to. ### `ethercat slaves` As the command suggest, this will provide a list of the EtherCAT slaves. diff --git a/hugo/content/manual/knowledgebase/hardware/EL5042.md b/hugo/content/manual/knowledgebase/hardware/EL5042.md index cc5fbeb15..c21b0c503 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL5042.md +++ b/hugo/content/manual/knowledgebase/hardware/EL5042.md @@ -15,7 +15,7 @@ chapter = false ### error/warning Could be caused by: -* Wrong settings (bit counts, ..), see futher below on this page (and also motion/best practice). +* Wrong settings (bit counts, ..), see further below on this page (and also motion/best practice). * Bad electrical connection * Wrong power supply * Defect encoder or EL5042 @@ -25,7 +25,7 @@ Always start troubleshooting by checking the error, warning and ready bits and r #### Bad electrical connection -The serial communication is hanled by two RS422 channels, one for the clock and one for data. These channels can be measured with a scope: +The serial communication is handled by two RS422 channels, one for the clock and one for data. These channels can be measured with a scope: * The clock should output periodic "bursts" with clock pulses with a short break in between. The bursts should appear in the same rate as the ethercat frame rate (EC_RATE, default 1kHz). And the frequency of the clock pulses should correspond with the setting in your startup script (normally 250kHz..10Mhz depending on configuration) * The data channel should return bits in sync with the clock pulses. @@ -76,22 +76,22 @@ Long cable lengths can affect both power supply levels and the serial data chann **Power supply:** -Longer cables will normally also result in a higher voltage drops. Especaillay for 5V encoders this can be an issue. Make sure that the voltage are within the specified range by measuring the voltage level close to the encoder. +Longer cables will normally also result in a higher voltage drops. Especially for 5V encoders this can be an issue. Make sure that the voltage are within the specified range by measuring the voltage level close to the encoder. If the voltage is to low (mainly for 5V encoders): 1. Can cabling length be reduced 2. Can cable impedance be reduced (higher area) -3. Add a separate (5V) power supply with possabilities to adjust the voltage level to a slightly higher voltage. Make sure the voltage is not too high at the encoder end. +3. Add a separate (5V) power supply with possibilities to adjust the voltage level to a slightly higher voltage. Make sure the voltage is not too high at the encoder end. **Serial communication:** -The serial communication is also affected by the cable legth. For long cable lengths a reduction of the clock rate can be needed. The clock rate can be reduced by setting the CLK_FRQ_KHZ macro in the call to applyComponent.cmd (set clock freq. to 500kHz): +The serial communication is also affected by the cable length. For long cable lengths a reduction of the clock rate can be needed. The clock rate can be reduced by setting the CLK_FRQ_KHZ macro in the call to applyComponent.cmd (set clock freq. to 500kHz): ```bash ${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=1,MACROS='CLK_FRQ_KHZ=500'" ``` -For EL5042 the following rates are availble: +For EL5042 the following rates are available: * 10 MHz * 5 MHz * 3.33 MHz @@ -144,7 +144,7 @@ Note: The tool ecmccfg/utils/PDO_read can also be used for reading the diagnosti **When using the LSB offset, the same amount of ones ("1") will be shifted in as MSB. Therefore the LSB offset should normally not be used.** {{% /notice %}} -When using the LSB offset setting, the same amout of bits needs to be subtracted from the ST_BITS or MT_BITS +When using the LSB offset setting, the same amount of bits needs to be subtracted from the ST_BITS or MT_BITS Example: 26bit RLS, no LSB offset ``` @@ -153,7 +153,7 @@ ${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BIS Example: 26bit RLS with 3 bits offset (ST_BITS=23, OFF_BITS=0) ``` -#If the offset is needed then the sum of the bit's still need to match the bitcount of the encoder. Example: Offset 3 LSB bits, set ST_BITS=23 (26-3) +#If the offset is needed then the sum of the bit's still need to match the bit-count of the encoder. Example: Offset 3 LSB bits, set ST_BITS=23 (26-3) ${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-Generic-BISS-C,CH_ID=1,MACROS=MT_BITS=0,ST_BITS=23,CLK_FRQ_KHZ=1000,OFF_BITS=3" ``` @@ -180,7 +180,7 @@ Example: Posital kit SSI encoder, KCD-S1X3B-1617-IE4F-GRQ # Startup bits 8 (zeros) # This then results in: # MT_BITS=16 + 8 = 24 (multi turn bits + startup bits) -# ST_BITS=17 + 2 = 19 (single trun bits + status bits) +# ST_BITS=17 + 2 = 19 (single turn bits + status bits) ${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-Generic-SSI,CH_ID=1,MACROS=MT_BITS=24,ST_BITS=19" ``` diff --git a/hugo/content/manual/knowledgebase/hardware/EL70x1.md b/hugo/content/manual/knowledgebase/hardware/EL70x1.md index 2b977dea5..a89093572 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL70x1.md +++ b/hugo/content/manual/knowledgebase/hardware/EL70x1.md @@ -17,7 +17,7 @@ If the drive is in error or warning state, further information about the reason In order to use the ethercat command, you must first login to the server where the ecmc IOC is running. {{% /notice %}} -The diagnostic data can be read from register [Index A010 STM Diag data Ch.1](https://infosys.beckhoff.com/english.php?content=../content/1033/el70x1/2286662027.html&id=126846504617985959) with the folowing syntax: +The diagnostic data can be read from register [Index A010 STM Diag data Ch.1](https://infosys.beckhoff.com/english.php?content=../content/1033/el70x1/2286662027.html&id=126846504617985959) with the following syntax: The ecmccfg/utils/read_el70xx_diag.sh tool can be used to read all the diagnostic registers: ```bash @@ -57,7 +57,7 @@ Note: The tool ecmccfg/utils/PDO_read can also be used for reading the diagnosti #### under voltage -Use a multimeter to verify that the voltage level corresponds to voltage levels described in the electrical drawings. If the voltage is correct, then the under voltage alarm could be related to worng setting of nominal drive voltage setting (48V but the drive is powered with 24V). +Use a multimeter to verify that the voltage level corresponds to voltage levels described in the electrical drawings. If the voltage is correct, then the under voltage alarm could be related to wrong setting of nominal drive voltage setting (48V but the drive is powered with 24V). The nominal drive voltage setting can be changed by the U_NOM_MV macro when applying the component (ecmccomp). @@ -73,7 +73,7 @@ For the EL703x drives the nominal voltage must be set to 24V (ecmccomp handles t #### over voltage -Use a multimeter to verify that the voltage level corresponds to voltage levels described in the electrical drawings. If the voltage is correct, then the over voltage alarm could be related to worng setting of nominal drive voltage setting (24V but the drive is powered with 48V). +Use a multimeter to verify that the voltage level corresponds to voltage levels described in the electrical drawings. If the voltage is correct, then the over voltage alarm could be related to wrong setting of nominal drive voltage setting (24V but the drive is powered with 48V). The nominal drive voltage setting can be changed by the U_NOM_MV macro when applying the component (ecmccomp). @@ -99,7 +99,7 @@ However, for the EL70x1 drives there's no dedicated velocity loop (however some For more information on tuning the position loop see [tuning](../../tuning) #### Current loop -For most usecases, the default current controller parameters are already well tuned. Sometimes when operating at higher speeds the current loop needs to be tuned. +For most use cases, the default current controller parameters are already well tuned. Sometimes when operating at higher speeds the current loop needs to be tuned. The following parameters can be tuned for a EL70x1 stepper drive: * 8011:07 Ka factor diff --git a/hugo/content/manual/knowledgebase/hardware/EL9xxx.md b/hugo/content/manual/knowledgebase/hardware/EL9xxx.md index 222f24cea..a5d037408 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL9xxx.md +++ b/hugo/content/manual/knowledgebase/hardware/EL9xxx.md @@ -12,7 +12,7 @@ chapter = false ### over current protection In the standard setup at PSI over current protection modules are used to feed 24V to both the EtherCAT communication bus (E-bus) and the power bus of the EtherCAT slaves. If the over current protection is not enabled then the EtherCAT slaves will not receive power. -First time, (and only first time), a system is in use, the overcurrent modules needs to be enabled in order to allow current to flow. Enabling is done by push buttons in the LED area of the module. The long horizontal LEDs are in fact buttons that can be used to activate or tripp the over current protection. +First time, (and only first time), a system is in use, the over-current modules needs to be enabled in order to allow current to flow. Enabling is done by push buttons in the LED area of the module. The long horizontal LEDs are in fact buttons that can be used to activate or tripp the over current protection. {{% notice warning %}} **Before pressing any button, check the electrical drawings and make sure it's safe to power on the system.** @@ -22,12 +22,12 @@ First time, (and only first time), a system is in use, the overcurrent modules n The EL9221-5000 has one channel and therefore only the top button is needed to be pressed. #### el9227-5500 -The EL9227-5500 is a 2 channel module and normally both channels needs to be enabled by pressing both the top and bottom long LED. if only one are pressed it could result in that the power to the communication is fine but the power to the i/o bus is lacking. This can result in starnge issues. Both EL9227-5500 and EL9221-5000 have dedicated panels whre status of the over current protection can be seen. +The EL9227-5500 is a 2 channel module and normally both channels needs to be enabled by pressing both the top and bottom long LED. if only one are pressed it could result in that the power to the communication is fine but the power to the i/o bus is lacking. This can result in strange issues. Both EL9227-5500 and EL9221-5000 have dedicated panels where status of the over current protection can be seen. ### passive terminals Some terminals are passive. Passive terminals are not EtherCAT slaves and do not communicate over EtherCAT (not equipped with EtherCAT slave controller). Passive terminals are normally used to simplify electrical connections (avoiding external terminals). For instance for distributing potential, 24V and 0V, an EL9184 can be used (8Ch 24V and 8Ch 0V). -The passive terminals will not show up as an EtherCAT slave when issueing the "ethercat slaves" command. However, they are normally visible in the electrical drawings. This could result in that the slave id in the electrical drawing is **NOT** corresponding to the EtherCAT slave index used when configuring ecmc. In worst case this could lead to that the wrong hardware/drive is configured. +The passive terminals will not show up as an EtherCAT slave when issuing the "ethercat slaves" command. However, they are normally visible in the electrical drawings. This could result in that the slave id in the electrical drawing is **NOT** corresponding to the EtherCAT slave index used when configuring ecmc. In worst case this could lead to that the wrong hardware/drive is configured. {{% notice warning %}} **When configuring ecmc, make sure the EtherCAT slave index is correct, do not blindly trust the electrical drawings since a passive terminal could introduce an shift in the slave indices.** diff --git a/hugo/content/manual/knowledgebase/hardware/host.md b/hugo/content/manual/knowledgebase/hardware/host.md index f39c418e8..1be519054 100644 --- a/hugo/content/manual/knowledgebase/hardware/host.md +++ b/hugo/content/manual/knowledgebase/hardware/host.md @@ -36,7 +36,7 @@ After editing the file, the host needs to be rebooted in order for the changes t #### high load on system ** Reduce sample rate** -Reducing the ethercat cycle time is often very effichient when it comes to reduce latency. Do not run the ecmc systems faster than needed. +Reducing the ethercat cycle time is often very efficient when it comes to reduce latency. Do not run the ecmc systems faster than needed. The default ecmc sample rate is 1Khz, which in many cases is not needed. The sample rate is defined when require ecmccfg (example set to 500Hz, instead of 1kHz): @@ -48,7 +48,7 @@ There are some restrictions on the sample rate. Normally, a rate in the range 10 {{% /notice %}} ** Affinity** -Setting the affinity of the ecmc realtiem thread can often improve the performace. First check how many cores the controller has. +Setting the affinity of the ecmc realtime thread can often improve the performance. First check how many cores the controller has. {{% notice warning %}} At PSI, core 0 is always isolated, do not move any threads to core 0. {{% /notice %}} @@ -61,9 +61,9 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd #- Set affinity of ecmc_rt (core 5) epicsThreadSetAffinity ecmc_rt 5 ``` -If more than one ecmc ioc is running on the server, then make sure the ecmc_rt threads run on differnt cores. +If more than one ecmc ioc is running on the server, then make sure the ecmc_rt threads run on different cores. -Also other threads might take a lot of resources, for instace the epics thread "cbLow": +Also other threads might take a lot of resources, for instance the epics thread "cbLow": ``` afterInit "epicsThreadSetAffinity cbLow 6" ``` @@ -72,32 +72,32 @@ cbLow is created at iocInit, therefore the "epicsThreadSetAffinity" must be exec {{% /notice %}} ### EtherCAT rate (EC_RATE) -The default EtherCAT frame rate in ecmc is set to 1kHz. For most applications this is however not needed and can therefore be reduced. A reduced EtherCAT rate reduces the load on the controller. In general, a good value for the frame rate is in the range 100Hz to 1kHz. For motion systems, a frame rate of 100Hz..500Hz is normally enough. Rates ouside the 100Hz..1kHz range is normally not a good idea, and some slaves might not support it. However, in special cases both lower and higher rates might be possible and required. +The default EtherCAT frame rate in ecmc is set to 1kHz. For most applications this is however not needed and can therefore be reduced. A reduced EtherCAT rate reduces the load on the controller. In general, a good value for the frame rate is in the range 100Hz to 1kHz. For motion systems, a frame rate of 100Hz..500Hz is normally enough. Rates outside the 100Hz..1kHz range is normally not a good idea, and some slaves might not support it. However, in special cases both lower and higher rates might be possible and required. Example: Set rate to 500Hz ``` require ecmccfg "EC_RATE=500" ... ``` -For more information see the chapter descriping startup.cmd. +For more information see the chapter describing startup.cmd. As a comparison, TwinCAT default EtherCAT rates are: * 100Hz for PLC * 500Hz for motion #### Lower rates -Issues that could occour in rates below 100Hz: +Issues that could occur in rates below 100Hz: * triggering of slave watchdogs -* issues with dc clock syncs (DC capabale slaves normally performs best with at a rate of atleast 500Hz) +* issues with dc clock syncs (DC capable slaves normally performs best with at a rate of at least 500Hz) * some slaves might not support it #### Higher rates -Issues that could occour in rates over 1Kz: +Issues that could occur in rates over 1Kz: * missed frames * issues with dc clock syncs * some slaves might not support it. -NOTE: Some slave might support a high rate but could have built in signal filters of several ms which then makes sampling at higher freqs unneccesarry/not needed. +NOTE: Some slave might support a high rate but could have built in signal filters of several ms which then makes sampling at higher freqs unnecessary/not needed. In order to successfully run an ecmc ethercat system at higher rates some tuning might be needed: * minimize slave count (and ensure that the slaves support it) diff --git a/hugo/content/manual/knowledgebase/motion.md b/hugo/content/manual/knowledgebase/motion.md index 3dae2bce3..d744bc0a7 100644 --- a/hugo/content/manual/knowledgebase/motion.md +++ b/hugo/content/manual/knowledgebase/motion.md @@ -14,7 +14,7 @@ chapter = false --- ## both_limits error -The "BOTH_LIMITS" error can be related to that limits switches are not powered with 24V. As standard at PSI, limts are feed from 24V outputs, normally an EL2819 terminal. Basically the ouptputs needs then to be set to 1 in order to power the switches. Check the schematics in order to find out which output that powers the switches for a certain axis and then use one the following approaches to set it to 1: +The "BOTH_LIMITS" error can be related to that limits switches are not powered with 24V. As standard at PSI, limits are feed from 24V outputs, normally an EL2819 terminal. Basically the outputs needs then to be set to 1 in order to power the switches. Check the schematics in order to find out which output that powers the switches for a certain axis and then use one the following approaches to set it to 1: Define the output in axis yaml file: ``` @@ -25,17 +25,17 @@ axis: ... ``` -By using the commad Cfg.WriteEcEntryEcPath(ec\.s\.binaryOutput\,\): +By using the command Cfg.WriteEcEntryEcPath(ec\.s\.binaryOutput\,\): ``` ecmcConfigOrDie "Cfg.WriteEcEntryEcPath(ec0.s5>.binaryOutput02,1)" ``` ## position lag error -A position lag error (following error) can be genereated in the following situations: +A position lag error (following error) can be generated in the following situations: 1. The motor torque is too low, making it hard for the motor to keep up with the setpoint. 2. The scaling factors are wrong resulting in that the feed forward part of the controller is not working well. 3. The velocity setpoint is too high resulting in motor stall (common for stepper motors). -4. The velocity setpoint is higher than what the drive can achive (saturated velocity setpoint). +4. The velocity setpoint is higher than what the drive can achieve (saturated velocity setpoint). ### 1. motor torque to low @@ -44,7 +44,7 @@ A position lag error (following error) can be genereated in the following situat 3. Check the current setting of the motor. If possible increase the current setting to get a higher torque. {{% notice warning %}} -Before increase current to the motor, make sure that both motor and drive can handle the higher current. Extra care needs to be taken for vaccum applications. +Before increase current to the motor, make sure that both motor and drive can handle the higher current. Extra care needs to be taken for vacuum applications. {{% /notice %}} ### 2. scaling factors are wrong @@ -52,24 +52,24 @@ Check the scaling documentation [here](https://paulscherrerinstitute.github.io/e One way to test if the scaling is correct is to set all controller parameters (except Kff) to 0 and then initiate a move. Basically the actual position of the axis should follow the setpoint closely with teh same slope. If the slope differs, then the scaling factors are wrong. ### 3. the velocity setpoint is too high resulting in stall -If a stepper motor stalls because of too high velocity there's a few thing that can be done in order to improve the ability to reach higehr velocities: -1. Add a damper: This is nromally very effichient but not always possible. -2. Tune controller parameters (both position loop in ecmc andn the controller loops in the drive), see hardware/tuning +If a stepper motor stalls because of too high velocity there's a few thing that can be done in order to improve the ability to reach higher velocities: +1. Add a damper: This is normally very efficient but not always possible. +2. Tune controller parameters (both position loop in ecmc and the controller loops in the drive), see hardware/tuning 3. If possible, test to increase or reduce current (make sure you do not burn the motor if increasing). {{% notice warning %}} -Before increase current to the motor, make sure that both motor and drive can handle the higher current. Extra care needs to be taken for vaccum applications. +Before increase current to the motor, make sure that both motor and drive can handle the higher current. Extra care needs to be taken for vacuum applications. {{% /notice %}} ### 4. velocity higher than allowed by driver -For EL704x stepper drives are default setup to maximum veleocity range of +-2000fullsteps/s. The 16bit velocity setpoint that are sent to the drive correspons to this range. Bascially trying to write a higehr value than that will saturate the velocity setpoint resulting in that the required speed is not achived, resulting in position lag error. The speed range for the EL704x can however be changed by setting SDO 8012:05: +For EL704x stepper drives are default setup to maximum velocity range of +-2000 full-steps/s. The 16bit velocity setpoint that are sent to the drive corresponds to this range. Basically trying to write a higher value than that will saturate the velocity setpoint resulting in that the required speed is not achieved, resulting in position lag error. The speed range for the EL704x can however be changed by setting SDO 8012:05: ``` -0 for 1000 full steps/second -1 for 2000 full steps/second (default) -2 for 4000 full steps/second -3 for 8000 full steps/second -4 for 16000 full steps/second -5 for 32000 full steps/second +0 for 1000 full-steps/second +1 for 2000 full-steps/second (default) +2 for 4000 full-steps/second +3 for 8000 full-steps/second +4 for 16000 full-steps/second +5 for 32000 full-steps/second ``` After changing this value you also need to change the drive scaling in the axis yaml file. @@ -80,7 +80,7 @@ Possible reasons: 1. For systems with safety, tripp off STO or power to the drive removed by contactor. Check status of safety system. 2. Over current protection of 48V tripped. 3. No 48V connected. -4. ecmc PLC disabaling axis, check PLC sources. +4. ecmc PLC disabling axis, check PLC sources. 5. Motion axis in error state. Some errors prevent the axis from being enabled. Check axis error state 6. Drive hardware enable input not set high (valid for EP7211-0034, EL70xx if special cfgs). 7. Axis object configured with external interlock (yaml->input.interlock). diff --git a/hugo/content/manual/motion_cfg/_index.md b/hugo/content/manual/motion_cfg/_index.md index 00475d4a2..41b3a4408 100644 --- a/hugo/content/manual/motion_cfg/_index.md +++ b/hugo/content/manual/motion_cfg/_index.md @@ -25,7 +25,7 @@ Additionally the schema of the yaml file is checked by Cerberus. This check will point out errors in the structure of the configuration as well as certain type errors. ### [plc yaml config](axisPLC) -Syncronization configurations +Synchronization configurations ### [scaling](scaling) Configuration of scaling diff --git a/hugo/content/manual/motion_cfg/axisPLC.md b/hugo/content/manual/motion_cfg/axisPLC.md index 29d7565a4..f698596ed 100644 --- a/hugo/content/manual/motion_cfg/axisPLC.md +++ b/hugo/content/manual/motion_cfg/axisPLC.md @@ -6,7 +6,7 @@ chapter = false ## Introduction Each axis can have a native PLC. -This PLC can be e.g. used for interlocking or synchronisation. +This PLC can be e.g. used for interlocking or synchronization. The axis PLC is part of the [yaml](axisyaml) config. The code can be provided [inline](#inline) or in a separate [file](#file). diff --git a/hugo/content/manual/motion_cfg/axisYaml.md b/hugo/content/manual/motion_cfg/axisYaml.md index 75b95a551..14cdfdfed 100644 --- a/hugo/content/manual/motion_cfg/axisYaml.md +++ b/hugo/content/manual/motion_cfg/axisYaml.md @@ -62,7 +62,7 @@ axis: id: 1 # type: joint # axis types: # 1 (equiv: physical, joint, j, motor, real) - # 2 (equiv: virtual, end_effector, endeffector, ee, e) + # 2 (equiv: virtual, end_effector, end-effector, ee, e) # mode: CSV # supported modes: CSV and CSP # parameters: powerAutoOnOff=2;powerOnDelay=6.0;powerOffDelay=1.0; ``` @@ -235,11 +235,11 @@ mandatory optional - `source`: source of position setpoint, 0=trajectory generator of axis ; 1=from PLC -- `type`: type of velocity profile: 0=trapezoidal ; 1=scurve +- `type`: type of velocity profile: 0=trapezoidal ; 1=s-curve - `axis` - - `deceleration`: deccelerartion setpoint for initialization (in EGU/sec2) + - `deceleration`: deceleration setpoint for initialization (in EGU/sec2) - `emergencyDeceleration`: deceleration setpoint for emergencies. Defaults to acceleration setpoint if not specified. - - `jerk`: jerk for scurved profiles (in EGU/sec3) + - `jerk`: jerk for s-curved profiles (in EGU/sec3) - `jog` * `velocity`: velocity setpoint the axis will be initialized to for jogging * `acceleration`: acceleration setpoint for initialization, for jogging @@ -304,7 +304,7 @@ optional ``` ## homing -This section is should be obsolete at PSI, as for all new installation using EtherCAT, absoulte encoders are mandatory. +This section is should be obsolete at PSI, as for all new installation using EtherCAT, absolute encoders are mandatory. In case a legacy system or temporary installation requires a incremental encoder, or even open loop operation, several procedures for referencing are available. optional @@ -426,14 +426,14 @@ axis: modeCmdHome: 10 # Drive mode value for when homing (written to axis.drvMode.modeSet when homing) features: blockCom: false # Block communication to axis - allowSrcChangeWhenEnabled: false # Allow traj/enc sorce change when axis is enabled + allowSrcChangeWhenEnabled: false # Allow traj/enc source change when axis is enabled allowedFunctions: homing: true # Allow homing constantVelocity: true # Allow constant velocity positioning: true # Allow positioning epics: - name: M1 # Axis anme + name: M1 # Axis name precision: 3 # Decimal count description: very important motor axis # Axis description unit: mm # Unit @@ -514,7 +514,7 @@ encoder: latchCount: 1 # latch number to ref on (1=ref on first latch) controller: - Kp: 15 # Kp proportinal gain + Kp: 15 # Kp proportional gain Ki: 0.02 # Ki integral gain Kd: 0 # Kd derivative gain Kff: 1 # Feed forward gain diff --git a/hugo/content/manual/motion_cfg/best_practice/_index.md b/hugo/content/manual/motion_cfg/best_practice/_index.md index 512b6a7db..b1e3a4112 100644 --- a/hugo/content/manual/motion_cfg/best_practice/_index.md +++ b/hugo/content/manual/motion_cfg/best_practice/_index.md @@ -5,13 +5,13 @@ chapter = false +++ ## best Practice -Here you can find some best practice configurations for common usecases. -The complete examples with starup files can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice) +Here you can find some best practice configurations for common use cases. +The complete examples with startup files can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice) ### [stepper and BISS-C](stepper_biss_c) An example configuration of a EL7041-0052 and a EL5042. -The complete example with starup file can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice/motion/stepper_bissc) +The complete example with startup file can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice/motion/stepper_bissc) ### [servo](servo) An example configuration of a Ex72xx servo drive with AM8xxx motor. -The complete example with starup file can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice/motion/servo) +The complete example with startup file can be found [here](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/PSI/best_practice/motion/servo) diff --git a/hugo/content/manual/motion_cfg/best_practice/servo.md b/hugo/content/manual/motion_cfg/best_practice/servo.md index 5be849e85..4159a3f8b 100644 --- a/hugo/content/manual/motion_cfg/best_practice/servo.md +++ b/hugo/content/manual/motion_cfg/best_practice/servo.md @@ -9,7 +9,7 @@ chapter = false * Lab test stage (1mm/rev) * Motor : AM8111-0F20 -### scalings +### scaling Config for scaling in mm, mm/s, mm/s2 ### motor AM8111-XFX0 @@ -24,16 +24,16 @@ Only the encoder integrated encoder is configured in this example. The specifica ``` One Cable Technology for power and feedback: feedback transmission via motor cable, no feedback cable necessary, electronic nameplate, multi-turn, absolute position within 4096 revolutions, 18 bit resolution. ``` -However, when connecting to an Ex72xx drive the single turn count will be 20bits and 12bits multiturn, resulting in a total of 32bits absolute bits. +However, when connecting to an Ex72xx drive the single turn count will be 20bits and 12bits multi-turn, resulting in a total of 32bits absolute bits. * encoder.numerator: Travels 1 mm/rev * encoder.denominator: Resolution: 1048576 counts (20bits) per = 1mm * encoder.absBits: 32 bits (20bits+12bits) * encoder.type: Absolute (type 1) -* ecnoder.absOffset: Offset to 0 position of linear stage (-1000 in this example) +* encoder.absOffset: Offset to 0 position of linear stage (-1000 in this example) ``` -# The encoder on most motors are 20bit single turn and 12 bit multiturn (4096 turns) +# The encoder on most motors are 20bit single turn and 12 bit multi-turn (4096 turns) encoder: type: 1 position: ec0.s$(DRV_ID).positionActual01 @@ -44,7 +44,7 @@ encoder: absOffset: -1000 ``` -### drive scalings +### drive scaling Max scale for motors depend on the pole count: * 6 pole: Max scale is 8000revs/s (in this case 8000mm/s) * 8 pole: Max scale is 6000revs/s diff --git a/hugo/content/manual/motion_cfg/best_practice/stepper_biss_c.md b/hugo/content/manual/motion_cfg/best_practice/stepper_biss_c.md index 0c5db9095..800136264 100644 --- a/hugo/content/manual/motion_cfg/best_practice/stepper_biss_c.md +++ b/hugo/content/manual/motion_cfg/best_practice/stepper_biss_c.md @@ -15,7 +15,7 @@ chapter = false ## scalings Config for scaling in mm, mm/s, mm/s2 -### encoder scalings +### encoder scaling Two encoders are configured: 1. Closed loop: BISS-C. This is used as the default encoder for control 2. Open loop: EL7041 Step counter @@ -29,7 +29,7 @@ RLS BISS-C: * encoder.denominator: Resolution: 4096 counts per = 1mm * encoder.absBits: 26 bits * encoder.type: Absolute (type 1) -* ecnoder.absOffset: Offset to 0 position of linear stage (-1408.794 in this example) +* encoder.absOffset: Offset to 0 position of linear stage (-1408.794 in this example) ``` encoder: @@ -51,13 +51,13 @@ encoder: **Hardware configuration EL5042** {{% notice warning %}} -Do not use the LSB offset functionality of the EL5042 (0x80p8:17). The same amount of ones ("1") will be shifted in as MSB which then normally leads to a higher position value, which is confusing. For more information see the troubleshootuing/hardware section. +Do not use the LSB offset functionality of the EL5042 (0x80p8:17). The same amount of ones ("1") will be shifted in as MSB which then normally leads to a higher position value, which is confusing. For more information see the knowledge-base/hardware section. {{% /notice %}} #### open loop (encoder 2) -The EL7041 drive has a build in micro step counter (64 microsteps/fullstep): +The EL7041 drive has a build in micro step counter (64 micro-steps/full-step): * encoder.numerator: Travels 1 mm/rev -* encoder.denominator: Resolution: 200*64=12800 microsteps/rev = 12800 microsteps/mm +* encoder.denominator: Resolution: 200*64=12800 micro-steps/rev = 12800 micro-steps/mm * encoder.bits: The counter is 16bit (default) * encoder.type: Incremental (type 0) @@ -79,13 +79,13 @@ encoder: ### drive scalings The EL7041 is default setup to operate in a velocity range of +-2000 full steps/s which then corresponds to the 16bit drive.setpoint parameter (ec0.s$(DRV_SID).velocitySetpoint01): -* drive.numerator: Max velo = 2000 fullsteps/s == 10mm/s +* drive.numerator: Max velo = 2000 full-steps/s == 10mm/s * drive.denominator: velocity setpoint is 16bit == +-15bit = 32768 * drive.type: Stepper drive, set to 0 ``` drive: - numerator: 10 # Fastest speed in eng. units (2000 Fullsteps/s==10mm/s) + numerator: 10 # Fastest speed in eng. units (2000 Full-steps/s==10mm/s) denominator: 32768 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET (normally +-16bit) type: 0 # Stepper: 0. DS402: 1 (DS402 = servos and advanced stepper drives) setpoint: ec0.s$(DRV_SID).velocitySetpoint01 # Velocity setpoint if CSV. Position setpoint if CSP @@ -113,7 +113,7 @@ axis: ``` -At PSI, the limit switches are connected directlly to the 2 inputs of the EL70xx stepper drives and are accessible in the status word, bit 11 and 12: +At PSI, the limit switches are connected directly to the 2 inputs of the EL70xx stepper drives and are accessible in the status word, bit 11 and 12: ``` input: limit: diff --git a/hugo/content/manual/motion_cfg/direction.md b/hugo/content/manual/motion_cfg/direction.md index daf3636f6..e195276fe 100644 --- a/hugo/content/manual/motion_cfg/direction.md +++ b/hugo/content/manual/motion_cfg/direction.md @@ -26,11 +26,11 @@ Consult the respective slave manual for the correct SDO. ### encoder direction -In many cases inverstion of the encoder value is possible in the ethercat slave. +In many cases inversion of the encoder value is possible in the ethercat slave. By using INV_DIR macro to applyComponent.cmd, the direction can be changed. {{% notice info %}} -For EL5042, example below, the invertion leads to a very high number since the data size is 64bit. Therefore, it's advisable to switch sign in the axis configuration instead. +For EL5042, example below, the inversion leads to a very high number since the data size is 64bit. Therefore, it's advisable to switch sign in the axis configuration instead. {{% /notice %}} ```shell diff --git a/hugo/content/manual/motion_cfg/homing.md b/hugo/content/manual/motion_cfg/homing.md index 2214ecddb..0e7699b70 100644 --- a/hugo/content/manual/motion_cfg/homing.md +++ b/hugo/content/manual/motion_cfg/homing.md @@ -6,7 +6,7 @@ chapter = false ## homing -The follwoing sequences are available: +The following sequences are available: ``` ECMC_SEQ_HOME_NOT_VALID = 0, ECMC_SEQ_HOME_LOW_LIM = 1, @@ -33,67 +33,67 @@ Not a valid homing sequence, can be used if encoder is absolute. ### ECMC_SEQ_HOME_LOW_LIM = 1, 1. Axis moves backward until low limit switch and stops -2. Axis moves forward untill edge detected in limit switch signal. Position is latched. +2. Axis moves forward until edge detected in limit switch signal. Position is latched. 3. Axis stops 4. Homing is performed. ECMC_HOME_POS will be the new position at the position latched in step 2. ### ECMC_SEQ_HOME_HIGH_LIM = 2, 1. Axis moves forward until high limit switch and stops -2. Axis moves backward untill edge detected in limit switch signal. Position is latched. +2. Axis moves backward until edge detected in limit switch signal. Position is latched. 3. Axis stops 4. Homing is performed. ECMC_HOME_POS will be the new position at the position latched in step 2. ### ECMC_SEQ_HOME_LOW_LIM_HOME = 3, 1. Axis moves backward until low limit switch and stops -2. Axis moves forward untill edge detected in home switch signal. Position is latched. +2. Axis moves forward until edge detected in home switch signal. Position is latched. 3. Axis stops 4. Homing is performed. ECMC_HOME_POS will be the new position at the position latched in step 2. ### ECMC_SEQ_HOME_HIGH_LIM_HOME = 4, 1. Axis moves forward until high limit switch and stops -2. Axis moves backward untill edge detected in home switch signal. Position is latched. +2. Axis moves backward until edge detected in home switch signal. Position is latched. 3. Axis stops 4. Homing is performed. ECMC_HOME_POS will be the new position at the position latched in step 2. ### ECMC_SEQ_HOME_LOW_LIM_HOME_HOME = 5, 1. Axis moves backward until low limit switch and stops -2. Axis moves forward untill edge detected in home switch signal. Position is latched. -3. Axis continues untill second edge of home sensor. Motion is stopped. -4. Axis moves backward untill edge of home sensor. Position is latched. +2. Axis moves forward until edge detected in home switch signal. Position is latched. +3. Axis continues until second edge of home sensor. Motion is stopped. +4. Axis moves backward until edge of home sensor. Position is latched. 5. Homing is performed. ECMC_HOME_POS will be the new position at the center point of the two latched positions in step 2 and 4. ### ECMC_SEQ_HOME_HIGH_LIM_HOME_HOME = 6, 1. Axis moves forward until low limit switch and stops -2. Axis moves backward untill edge detected in home switch signal. Position is latched. -3. Axis continues untill second edge of home sensor. Motion is stopped. -4. Axis moves forward untill edge of home sensor. Position is latched. +2. Axis moves backward until edge detected in home switch signal. Position is latched. +3. Axis continues until second edge of home sensor. Motion is stopped. +4. Axis moves forward until edge of home sensor. Position is latched. 5. Homing is performed. ECMC_HOME_POS will be the new position at the center point of the two latched positions in step 2 and 4. ### ECMC_SEQ_HOME_BWD_HOME = 7, -1. Axis moves backward untill positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) +1. Axis moves backward until positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) 2. Axis stops 3. Homing is performed. ECMC_HOME_POS will be the new position at the position latched in step 1. ### ECMC_SEQ_HOME_FWD_HOME = 8, -1. Axis moves forward untill positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) +1. Axis moves forward until positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) 2. Axis stops 3. Homing is performed. ECMC_HOME_POS will be the new position at the position latched in step 1. ### ECMC_SEQ_HOME_BWD_HOME_HOME = 9, -1. Axis moves backward untill positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) +1. Axis moves backward until positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) 2. Axis contiues to move until a negative edge of the home sensor is detected. Axis stops. -3. Axis moves forward untill positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) +3. Axis moves forward until positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) 4. Homing is performed. ECMC_HOME_POS will be the new position at the center point of the two latched positions in step 2 and 4. ### ECMC_SEQ_HOME_FWD_HOME_HOME = 10, -1. Axis moves forward untill positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) +1. Axis moves forward until positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) 2. Axis contiues to move until a negative edge of the home sensor is detected. Axis stops. -3. Axis moves backward untill positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) +3. Axis moves backward until positive edge detected in limit switch signal. Position is latched. (polarity of home sensor can be changed) 4. Homing is performed. ECMC_HOME_POS will be the new position at the center point of the two latched positions in step 2 and 4. ### ECMC_SEQ_HOME_LOW_LIM_INDEX = 11, 1. Axis moves backward until low limit switch and stops -2. Axis moves forward untill the predefined index signals (ECMC_HOME_LATCH_COUNT_OFFSET)from the encoder is encountered. Position is latched at the desired index position. +2. Axis moves forward until the predefined index signals (ECMC_HOME_LATCH_COUNT_OFFSET)from the encoder is encountered. Position is latched at the desired index position. 3. Axis stops 4. Homing is performed. ECMC_HOME_POS will be the new position at the position latched in step 2. @@ -107,7 +107,7 @@ epicsEnvSet("ECMC_HOME_LATCH_COUNT_OFFSET","2") # ### ECMC_SEQ_HOME_HIGH_LIM_INDEX = 12, 1. Axis moves forward until high limit switch and stops -2. Axis moves backward untill the predefined index signals (ECMC_HOME_LATCH_COUNT_OFFSET) from the encoder is encountered. Position is latched at the desired index position. +2. Axis moves backward until the predefined index signals (ECMC_HOME_LATCH_COUNT_OFFSET) from the encoder is encountered. Position is latched at the desired index position. 3. Axis stops 4. Homing is performed. ECMC_HOME_POS will be the new position at the position latched in step 2. @@ -139,9 +139,9 @@ caput IOC_TEST:Axis1.SET 0 ### ECMC_SEQ_HOME_LOW_LIM_SINGLE_TURN_ABS = 21, Indented use for resolvers (single turn absolute). Similar to seq 11 and 12. 1. Axis moves backward until low limit switch and stops -2. Axis moves forward untill limit switch change state +2. Axis moves forward until limit switch change state 3. Axis stops -4. Homing is performed. The multi turn bits will be homed to the value of ECMC_HOME_POS also consiering a offset of turns defined in ECMC_HOME_LATCH_COUNT_OFFSET. +4. Homing is performed. The multi-turn bits will be homed to the value of ECMC_HOME_POS also considering a offset of turns defined in ECMC_HOME_LATCH_COUNT_OFFSET. Some additional parameters are important for this homing sequence should work (example): ``` @@ -152,9 +152,9 @@ epicsEnvSet("ECMC_HOME_LATCH_COUNT_OFFSET","2") # Number o ### ECMC_SEQ_HOME_HIGH_LIM_SINGLE_TURN_ABS = 22, 1. Axis moves forward until high limit switch and stops -2. Axis moves backward untill limit switch change state +2. Axis moves backward until limit switch change state 3. Axis stops -4. Homing is performed. The multi turn bits will be homed to the value of ECMC_HOME_POS also consiering a offset of turns defined in ECMC_HOME_LATCH_COUNT_OFFSET. +4. Homing is performed. The multi turn bits will be homed to the value of ECMC_HOME_POS also considering a offset of turns defined in ECMC_HOME_LATCH_COUNT_OFFSET. Note: Only the multi turn bits are updated! @@ -170,18 +170,18 @@ Sequence 25 is the same as 15 but not blocked by motor record. The sequence will ### ECMC_SEQ_HOME_TRIGG_EXTERN = 26 Trigger external homing sequence in drive. -1. Optional: set drive mode to homing (and wait for mode readback) +1. Optional: set drive mode to homing (and wait for mode read-back) 3. Set trigg of homing (bit) -4. Wait for homing ready (bit). Reference the ecmc encoder object on rising edge of the homing reday bit -5. Optional: Change drive mode back to motion (and wait for mode readback) +4. Wait for homing ready (bit). Reference the ecmc encoder object on rising edge of the homing ready bit +5. Optional: Change drive mode back to motion (and wait for mode read-back) 6. Optional: Init post move if configured Currently used for smaract: [smaracat example](https://github.com/paulscherrerinstitute/ecmccfg/tree/master/examples/test/smaract) -In this exmaple also the drive modes is automatically handled by ecmc. +In this example also the drive modes is automatically handled by ecmc. ## setting polarity of home sensor -For some of the sequenceses it could be usefull to change the polarity of the home sensor. That can be done with the follwoing command: +For some of the sequences it could be useful to change the polarity of the home sensor. That can be done with the following command: ``` "Cfg.SetAxisMonHomeSwitchPolarity(int axisIndex, int polarity)"; # polarity==0 is NC (default) diff --git a/hugo/content/manual/motion_cfg/scaling.md b/hugo/content/manual/motion_cfg/scaling.md index fa1a3bc04..beb259daa 100644 --- a/hugo/content/manual/motion_cfg/scaling.md +++ b/hugo/content/manual/motion_cfg/scaling.md @@ -15,16 +15,16 @@ If the drive scaling is changes, make sure to adjust the PID parameters accordin ## drive scaling Drive scaling deals with the relation of the drive output (typically a 16- or 32-bit register) to axis velocity. -Scaling is similar, but slighlty different for [stepper drives](#stepper-motor-drives) and [servo drives](#servo-motor-drives) +Scaling is similar, but slightly different for [stepper drives](#stepper-motor-drives) and [servo drives](#servo-motor-drives) ### stepper motor drives The scaling for the Ex70xx slaves will be explained based on two very common examples. #### simple linear axis Assumptions: -* 200 fullsteps/rev motor +* 200 full-steps/rev motor * lead screw pitch: 5 mm/rev -* Register `0x8012:05` is set to `1` --> 2000 fullsteps max step rate (default for ECMC, check for other slaves!) +* Register `0x8012:05` is set to `1` --> 2000 full-steps max step rate (default for ECMC, check for other slaves!) * `velocitySetpoint` is in 16-bits. ```yaml @@ -36,15 +36,15 @@ drive: ##### explanation The `denominator` is `32768` because the `velocitySetpoint` is a 16-register for the Beckhoff stepper drives. Thus, half of the full range is reserved for positive (forward) motion, the remaining half for negative (backward) motion. -This means that at full output the motor would receive 2000 fullsteps per second. +This means that at full output the motor would receive 2000 full-steps per second. It is irrelevant whether the motor can actually spin this fast as this a purely theoretical value! Since we have established that the motor spins at 10 rev/s at full output, the conversion to engineering units is trivial and yields 50 mm/s, based on the lead screw pitch. #### rotational axis Assumptions: -* 400 fullsteps/rev motor +* 400 full-steps/rev motor * drive train ratio: 36 deg/rev -* Register `0x8012:05` is set to `1` --> 2000 fullsteps max step rate (default for ECMC, check for other slaves!) +* Register `0x8012:05` is set to `1` --> 2000 full-steps max step rate (default for ECMC, check for other slaves!) * `velocitySetpoint` is in 16-bits. ```yaml @@ -54,8 +54,8 @@ drive: ``` ##### explanation -At full output, the motor receives 2000 fullsteps/s, which results in 5 rev/s -due to the higher fullstep count of the motor. The drive train ratio is specified +At full output, the motor receives 2000 full-steps/s, which results in 5 rev/s +due to the higher full-step count of the motor. The drive train ratio is specified as 10 motor revolutions per 360 degree on the output or 36 deg/rev. Therefore, the resulting velocity of the motor in EGUs is 180 deg/s. Please note that this is _not_ the actual maximum velocity, but rather a theoretical scaling @@ -86,7 +86,7 @@ drive: This scaling ratio describes the relation of encoder counts and engineering units of the axis. Unlike the drive scaling, the encoder scaling is much simpler. -It represents merely the realtion between the observed counts on the encoder and the displacement of the load. +It represents merely the relation between the observed counts on the encoder and the displacement of the load. ### closed-loop @@ -112,15 +112,15 @@ In the example below such a case is presented, with an explanation. ```yaml encoder: numerator: 0.125 # 0.125 mm/rev lead screw - denominator: 12800 # 200 fullsteps/rev with 64 microsteps/fullstep + denominator: 12800 # 200 full-steps/rev with 64 micro-steps/full-step type: 0 # Type: 0=Incremental, 1=Absolute bits: 16 # Total bit count of encoder raw data ``` #### explanation -The internal step counter operates in microsteps. +The internal step counter operates in micro-steps. For most drives this value assumes 64, if uncertain consult the respective manual of the drive. -In case of a 200 fullsteps/rev motor, the `denominator` therefore will be set to `200*64=12800`. +In case of a 200 full-steps/rev motor, the `denominator` therefore will be set to `200*64=12800`. As for the `numerator`, this is simply the displacement observed for one full motor revolution. As the step counter is incremental, the `type: 0` has to be set. The step counter is of type `uint16`, thus the `bits: 16` setting, which is important to handle the over-/underflow. From b0b5f8bd5b3c19aec045b2a24e58240141989144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstro=CC=88m?= Date: Sat, 28 Sep 2024 21:16:53 +0200 Subject: [PATCH 2/8] Adjust manual fonts --- hugo/Readme.md | 2 +- hugo/config.toml | 2 ++ hugo/static/css/custom.css | 49 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 hugo/static/css/custom.css diff --git a/hugo/Readme.md b/hugo/Readme.md index ece8e0c4a..e5c617e3e 100644 --- a/hugo/Readme.md +++ b/hugo/Readme.md @@ -36,7 +36,7 @@ Observe the CLI output for details. 1. gawk at the beauty of the produced web-site :) ### editing the code -* contend is found in the `content` directory +* content is found in the `content` directory * mostly everything is done in markdown * the HUGO theme ["learn"](http://github.com/matcornic/hugo-theme-learn) is used. Follow the instructions [here](https://learn.netlify.app/en/) for examples and an overview of it's capabilities. * changes are reflected immediately in the browser after saving your changes. diff --git a/hugo/config.toml b/hugo/config.toml index 8f8ac84f6..a6691ed3d 100644 --- a/hugo/config.toml +++ b/hugo/config.toml @@ -4,6 +4,7 @@ title = 'ecmccfg' theme = "hugo-theme-learn" relativeURLs = true canonifyURLs = true + [markup] [markup.goldmark] [markup.goldmark.renderer] @@ -15,3 +16,4 @@ canonifyURLs = true themeVariant = "green" # Set this to true to disable copy-to-clipboard button for inline code. disableInlineCopyToClipBoard = true + custom_css = ["css/custom.css"] diff --git a/hugo/static/css/custom.css b/hugo/static/css/custom.css new file mode 100644 index 000000000..981805ec3 --- /dev/null +++ b/hugo/static/css/custom.css @@ -0,0 +1,49 @@ +html { + font-size: 40%; /* Adjust this percentage to scale all font sizes */ +} + +/* Target the specific note classes */ +.admonition.note p, +.admonition.warning p, +.admonition.tip p, +.admonition.info p { + font-size: 1.2rem !important; /* Adjust size as needed */ +} + +/* Additional targeting, if needed */ +.note p, .warning p, .tip p, .info p { + font-size: 2.2rem !important; +} + +code { + font-size: 1.8rem !important; /* Adjust size as needed */ +} + +/* General heading font size increases */ +h1 { + font-size: 3rem !important; /* Adjust for h1 */ +} + +h2 { + font-size: 3rem !important; /* Adjust for h2 */ +} + +h3 { + font-size: 3rem !important; /* Adjust for h3 */ +} + +h4 { + font-size: 3rem !important; /* Adjust for h4 */ +} + +h5 { + font-size: 2rem !important; /* Adjust for h5 */ +} + +h6 { + font-size: 2rem !important; /* Adjust for h6 */ +} + +.page-title { + font-size: 4rem !important; +} From 1daf0e534c09f9dbd42a67dc197e9a9132e1608e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstro=CC=88m?= Date: Sat, 28 Sep 2024 23:14:42 +0200 Subject: [PATCH 3/8] Add some content and adjust fontsizes --- .gitignore | 1 + .../content/manual/general_cfg/iocsh_utils.md | 127 ++++++++++++++++-- .../manual/general_cfg/startup/modes.md | 10 +- hugo/content/manual/introduction.md | 2 +- hugo/content/manual/knowledgebase/_index.md | 29 +--- hugo/content/manual/knowledgebase/panel.md | 28 ++++ hugo/static/css/custom.css | 20 +-- 7 files changed, 167 insertions(+), 50 deletions(-) create mode 100644 hugo/content/manual/knowledgebase/panel.md diff --git a/.gitignore b/.gitignore index e2bd7fe6c..22dfcc58c 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ hugo/content/source/ *.pyc .hugo_build.lock +hugo/public diff --git a/hugo/content/manual/general_cfg/iocsh_utils.md b/hugo/content/manual/general_cfg/iocsh_utils.md index 94fb4c5e3..8476b0d55 100644 --- a/hugo/content/manual/general_cfg/iocsh_utils.md +++ b/hugo/content/manual/general_cfg/iocsh_utils.md @@ -14,7 +14,7 @@ chapter = false * record fields * ... -``` +```text ecmcEpicsEnvSetCalc -h Use "ecmcEpicsEnvSetCalc(, , )" to evaluate the expression and assign the variable. @@ -82,8 +82,6 @@ result=0 ecmcEpicsEnvSetCalc("result", "if('ecmcEL3002.cmd'='test.script') {RESULT:=1;}else{RESULT:=0;};") epicsEnvShow("result") result=0 - - ``` ### Iocsh function "ecmcEpicsEnvSetCalcTernary()" "ecmcEpicsEnvSetCalcTernary()" is used o evaluate expressions and set EPCIS environment variables to different strings. @@ -92,7 +90,7 @@ result=0 * making conditional ecmc settings * ... -``` +```text ecmcEpicsEnvSetCalcTernary -h Test iocsh function "ecmcEpicsEnvSetCalcTernary()" t @@ -134,8 +132,6 @@ result=equal ecmcEpicsEnvSetCalcTernary("result", "if('./plc_slow.cfg'='test') {RESULT:=1;}else{RESULT:=0;};","use_this_file.cfg","no_use_this_file.cfg") epicsEnvShow("result") result=no_use_this_file.cfg - - ``` ### Use return value of ecmcConfig(OrDie): @@ -158,10 +154,125 @@ The variable "ECMC_CONFIG_RETURN_VAL" then can be used to set record fields, nam Note: PDO reads need to be after "SetAppMode(1)" since cyclic value ``` ecmcConfig "ReadEcEntryIDString(${ECMC_SLAVE_NUM},"ID")" -2020/02/28 08:58:03.771 1024 ## This is the value of the EK1101 ID switch epicsEnvShow(ECMC_CONFIG_RETURN_VAL) ECMC_CONFIG_RETURN_VAL=1024 - ``` The variable "ECMC_CONFIG_RETURN_VAL" then can be used to set record fields, name or alias for instance.. + +### ecmcIf(\,\,\) +ecmcIf() set two macros depending on the value of the evaluated expression. If it evaluates to true: +1. IF_TRUE="" Allows execution of a line of code +2. IF_FALSE= "#-" Block execution of a line of code + +If expression evaluates to false: +1. IF_TRUE="#-" Block execution of a line of code +2. IF_FALSE= "" Allows execution of a line of code + +Note: These macros is the default names for the macros (but can be changed by assignment of the 2 last params in call to ecmcIf()): +1. IF_TRUE for true +2. IF_FALSE for false + +### ecmcIf +``` +ecmcEndIf(\,\) +``` + +The ecmcEndIf() command unsets the last used macros (for true and false), if different names are passed as arguments then then these macros are unset (for nested if statements). + +#### Example of of syntax +Example 1: +``` +ecmcIf("") +${IF_TRUE} # Code to execute if expression eval true +#- else +${IF_FALSE} # Code to execute if expression eval false +ecmcEndIf() +``` +Example 2: +``` +ecmcIf("$(VAL1)=$(VAL2)") +${IF_TRUE}epicsEnvSet(IS_EQUAL,"1") +#- else +${IF_FALSE}epicsEnvSet(IS_EQUAL,"0") +ecmcEndIf() +``` +Note: For nested calls to ecmcIf() and ecmcEndIf() optional macros must be used. + +### ecmcForLoop +Useful for: +* Large systems with many similar sub systems +* Configuring hardware with many PDOs (oversampling) + +``` +"ecmcForLoop(, , , , , )" to loop execution of file with a changing loop variable. + : Filename to execute in for loop. + : Macros to feed to execution of file. + : start value. + : end value. + : Step to increase each loop cycle. + +``` +Example ("ECMC_LOOP_IDX" as loop variable): + +``` +ecmcForLoop(./loopStep.cmd,"",ECMC_LOOP_IDX,1,5,1) +ecmcEpicsEnvSetCalc("TESTING",1*10) +epicsEnvShow("TESTING") +TESTING=10 +ecmcEpicsEnvSetCalc("TESTING",2*10) +epicsEnvShow("TESTING") +TESTING=20 +ecmcEpicsEnvSetCalc("TESTING",3*10) +epicsEnvShow("TESTING") +TESTING=30 +ecmcEpicsEnvSetCalc("TESTING",4*10) +epicsEnvShow("TESTING") +TESTING=40 +ecmcEpicsEnvSetCalc("TESTING",5*10) +epicsEnvShow("TESTING") +TESTING=50 +``` +where "loopStep.cmd" file looks like this (note the use of "ECMC_LOOP_IDX"): +``` +#- Commands tp execute in each loop of example ecmcForLoop.script +ecmcEpicsEnvSetCalc("TESTING",${ECMC_LOOP_IDX}*10) +epicsEnvShow("TESTING") +``` + +### ecmcFileExist +Useful for checking that configuration files really exist and then can be loaded. +``` +ecmcFileExist(, , , )" to check if a file exists. + : Filename to check. + : Exit EPICS if file not exist. Optional, defaults to 0. + : Look for files in EPICS_DB_INCLUDE_PATH dirs. Optional, defaults to 0.\n"); + : List of dirs to search for file in (separated with ':'). +result will be stored in the EPICS environment variable "ECMC_FILE_EXIST_RETURN_VAL" +``` +Example: +``` +ecmcFileExist("file_exist.cfg") +epicsEnvShow(ECMC_FILE_EXIST_RETURN_VAL) +ECMC_FILE_EXIST_RETURN_VAL=1 + +ecmcFileExist("file_not_exist.cfg",1) +Error: File "file_not_exist.cfg" does not exist. ECMC shuts down. + +ecmcFileExist("ecmcEK1100.substitutions",1,1) +epicsEnvShow(ECMC_FILE_EXIST_RETURN_VAL) +ECMC_FILE_EXIST_RETURN_VAL=1 + +ecmcFileExist("ecmcEK1100.substitutions",0,0,"/home/") +epicsEnvShow(ECMC_FILE_EXIST_RETURN_VAL) +ECMC_FILE_EXIST_RETURN_VAL=0 +``` +### Todo +Add docs for: +* ecmcConfigOrDie +* ecmcConfig +* ecmcGrepParam +* ecmcGrepRecord +* ecmcReport +* ecmcAsynPortDriverConfigure diff --git a/hugo/content/manual/general_cfg/startup/modes.md b/hugo/content/manual/general_cfg/startup/modes.md index 8aef82a53..9ae3b830d 100644 --- a/hugo/content/manual/general_cfg/startup/modes.md +++ b/hugo/content/manual/general_cfg/startup/modes.md @@ -4,7 +4,7 @@ weight = 15 chapter = false +++ -## ecmc modes +### ecmc modes ecmc can be started in different modes by setting the MODE parameter to startup.cmd (or require ecmccfg): 1. FULL 2. DAQ @@ -12,7 +12,7 @@ ecmc can be started in different modes by setting the MODE parameter to startup. A separate mode for commissioning is also available, called ENG_MODE. -### mode==FULL (default) +#### mode==FULL (default) In FULL mode all ecmc functionalities are supported, like motion, daq and plcs. @@ -25,7 +25,7 @@ $(ECMCCFG_INIT)$(SCRIPTEXEC) ${ecmccfg_DIR}startup.cmd, "IOC=$(IOC),ECMC_VER=dev $(ECMCCFG_INIT)$(SCRIPTEXEC) ${ecmccfg_DIR}startup.cmd, "IOC=$(IOC),ECMC_VER=develop" ``` -### mode==DAQ +#### mode==DAQ In DAQ mode, motion functionalities are disabled and the following commands are blocked: 1. configureAxis.cmd 2. configureVirtualAxis.cmd @@ -44,11 +44,11 @@ NOTE: The default record update rate is set to 10ms in initAlll.cmd. For DAQ app epicsEnvSet("ECMC_SAMPLE_RATE_MS",1) ``` -### mode==NO_MR +#### mode==NO_MR In this mode all features are supported, but motor record will not be created for motion axes. -### ENG_MODE +#### ENG_MODE Setting the parameter ENG_MODE=1 will result in loading of extra PVs usefull for commissioning, i.e. controller parameters for motion axes. diff --git a/hugo/content/manual/introduction.md b/hugo/content/manual/introduction.md index 50aa92795..7bceff688 100644 --- a/hugo/content/manual/introduction.md +++ b/hugo/content/manual/introduction.md @@ -12,7 +12,7 @@ During IOC-startup, the requested configuration is validated against the actuall Mismatches will result in an error, the IOC will _not_ start. {{% notice warning %}} -Blindly restarting the IOC, with only partially working EtherCAT hardware, will results in an inoperable IOC! Refer to the [troubleshooting guide](../troubleshooting) for details. +Blindly restarting the IOC, with only partially working EtherCAT hardware, will results in an inoperable IOC! If troubleshooting is needed then check out the [knowledge base](../knowledgebase) for details. {{% /notice %}} ### IOC structure diff --git a/hugo/content/manual/knowledgebase/_index.md b/hugo/content/manual/knowledgebase/_index.md index 2a5371c84..2273d475b 100644 --- a/hugo/content/manual/knowledgebase/_index.md +++ b/hugo/content/manual/knowledgebase/_index.md @@ -8,29 +8,6 @@ chapter = false {{% children %}} --- -## Overview panel -For an overview of an ecmc system, the ecmcMain.ui panel is a good starting point. -The ecmcMain.ui covers most parts of an ecmc system: -* ecmc_rt thread diagnostics: - - Jitter - - Cycle time -* EtherCAT: - - Status - - Lost frames - - Slave count - - master Id - - Links to dedicated sub panels for each slave type. -* Links to all configured objects: - - motion expert panels - - PLC objects - - plugin objects - - data storage objects - -The ecmcMain.ui is started with the following syntax: -``` -caqtdm -macro "IOC=" ecmcMain.ui -``` - ## Knowledge base Due to the complexity an EtherCAT bus topology can assume, troubleshooting can be challenging. This guide should provide the basic means to diagnose simple errors and is by no means complete! @@ -42,8 +19,8 @@ See a summary, incl. some examples of what possible [here](ethercatcli). ### [motion](motion) For motion related issues, a very short troubleshooting guide is provided [here](motion). -### [drive tuning](tuning) -Tune drive control loops - ### [hardware](hardware) For hardware related issues, a very short troubleshooting guide is provided [here](hardware). + +### [tuning](tuning) +Tune drive control loops diff --git a/hugo/content/manual/knowledgebase/panel.md b/hugo/content/manual/knowledgebase/panel.md new file mode 100644 index 000000000..60d72dce4 --- /dev/null +++ b/hugo/content/manual/knowledgebase/panel.md @@ -0,0 +1,28 @@ ++++ +title = "panel" +weight = 20 +chapter = false ++++ + +### Overview panel +For an overview of an ecmc system, the ecmcMain.ui panel is a good starting point. +The ecmcMain.ui covers most parts of an ecmc system: +* ecmc_rt thread diagnostics: + - Jitter + - Cycle time +* EtherCAT: + - Status + - Lost frames + - Slave count + - master Id + - Links to dedicated sub panels for each slave type. +* Links to all configured objects: + - motion expert panels + - PLC objects + - plugin objects + - data storage objects + +The ecmcMain.ui is started with the following syntax: +``` +caqtdm -macro "IOC=" ecmcMain.ui +``` diff --git a/hugo/static/css/custom.css b/hugo/static/css/custom.css index 981805ec3..4a70f4eb9 100644 --- a/hugo/static/css/custom.css +++ b/hugo/static/css/custom.css @@ -1,5 +1,5 @@ html { - font-size: 40%; /* Adjust this percentage to scale all font sizes */ + font-size: 100%; /* Adjust this percentage to scale all font sizes */ } /* Target the specific note classes */ @@ -12,38 +12,38 @@ html { /* Additional targeting, if needed */ .note p, .warning p, .tip p, .info p { - font-size: 2.2rem !important; + font-size: 0.9rem !important; } code { - font-size: 1.8rem !important; /* Adjust size as needed */ + font-size: 0.8rem !important; /* Adjust size as needed */ } /* General heading font size increases */ h1 { - font-size: 3rem !important; /* Adjust for h1 */ + font-size: 1.5rem !important; /* Adjust for h1 */ } h2 { - font-size: 3rem !important; /* Adjust for h2 */ + font-size: 1.3rem !important; /* Adjust for h2 */ } h3 { - font-size: 3rem !important; /* Adjust for h3 */ + font-size: 1.2rem !important; /* Adjust for h3 */ } h4 { - font-size: 3rem !important; /* Adjust for h4 */ + font-size: 1.1rem !important; /* Adjust for h4 */ } h5 { - font-size: 2rem !important; /* Adjust for h5 */ + font-size: 1rem !important; /* Adjust for h5 */ } h6 { - font-size: 2rem !important; /* Adjust for h6 */ + font-size: 1rem !important; /* Adjust for h6 */ } .page-title { - font-size: 4rem !important; + font-size: 1rem !important; } From c536e8ca21e99503dbaaf6555fefa085b9eaa7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstro=CC=88m?= Date: Sun, 29 Sep 2024 18:11:13 +0200 Subject: [PATCH 4/8] Add more info to manual --- hugo/content/manual/PLC_cfg/function_libs.md | 2 +- hugo/content/manual/best_practice.md | 10 +++ .../manual/general_cfg/best_practice.md | 2 +- hugo/content/manual/introduction.md | 14 ++++ .../manual/knowledgebase/hardware/EL1xxx.md | 30 +++++++ .../manual/knowledgebase/hardware/EL51xx.md | 82 +++++++++++++++++++ .../manual/knowledgebase/hardware/EL70x1.md | 6 +- .../manual/knowledgebase/hardware/ELxxxx.md | 23 ++++++ .../manual/knowledgebase/hardware/_index.md | 2 +- .../knowledgebase/{hardware => }/host.md | 4 +- hugo/content/manual/knowledgebase/panel.md | 2 +- 11 files changed, 166 insertions(+), 11 deletions(-) create mode 100644 hugo/content/manual/best_practice.md create mode 100644 hugo/content/manual/knowledgebase/hardware/EL1xxx.md create mode 100644 hugo/content/manual/knowledgebase/hardware/EL51xx.md create mode 100644 hugo/content/manual/knowledgebase/hardware/ELxxxx.md rename hugo/content/manual/knowledgebase/{hardware => }/host.md (99%) diff --git a/hugo/content/manual/PLC_cfg/function_libs.md b/hugo/content/manual/PLC_cfg/function_libs.md index abf4c9e0e..575bb274c 100644 --- a/hugo/content/manual/PLC_cfg/function_libs.md +++ b/hugo/content/manual/PLC_cfg/function_libs.md @@ -6,7 +6,7 @@ chapter = false ## function libs Function libraries can be loaded into ecmc PLCs by loadPLCLib.cmd. The command takes these parameters: -* FILE PLC: definition file, i.e. ./plc/homeSlit.plc +* FILE: definition file, i.e. ./plc/homeSlit.plc * PLC_ID: (optional) PLC number, default last loaded PLC * PLC_MACROS: (optional) Substitution macros for PLC code. The macros "SELF_ID","SELF",M_ID, and M are reserved: - "SELF_ID" = PLC Id of this plc diff --git a/hugo/content/manual/best_practice.md b/hugo/content/manual/best_practice.md new file mode 100644 index 000000000..ee24abdea --- /dev/null +++ b/hugo/content/manual/best_practice.md @@ -0,0 +1,10 @@ ++++ +title = "best practice" +weight = 6 +chapter = false ++++ + +### links to best practice: +* [General](../general_cfg/best_practice/) +* [Motion](../motion_cfg/best_practice/) +* [PLC](../plc_cfg/best_practice/) diff --git a/hugo/content/manual/general_cfg/best_practice.md b/hugo/content/manual/general_cfg/best_practice.md index 413a4468b..af7c9afe4 100644 --- a/hugo/content/manual/general_cfg/best_practice.md +++ b/hugo/content/manual/general_cfg/best_practice.md @@ -18,7 +18,7 @@ As a comparison, TwinCAT default EtherCAT rates are: * 100Hz for PLC * 500Hz for motion -See [ecmc_server](../../knowledgebase/hardware/host/) for more information. +See [host/ecmc_server](../../knowledgebase/host/) for more information. ## ecmc server setup * If possible, make sure you use the native igb ethercat driver. diff --git a/hugo/content/manual/introduction.md b/hugo/content/manual/introduction.md index 7bceff688..438394edb 100644 --- a/hugo/content/manual/introduction.md +++ b/hugo/content/manual/introduction.md @@ -41,6 +41,8 @@ For this purpose scripts can be called for: * **adding and configure** while adding * **applying** a configuration to the previously added slaves +In addition to these ecmccfg scripts also the ecmccomp repo that contains a component library can be used. Settings are then applied with the ecmccomp/applyComponent.cmd, see below examples. + ##### examples The `addSlave` is used for simple slaves, a default configuration is automatically applied. In addition default PVs will created for the basic slave features, i.e. status. @@ -109,17 +111,26 @@ It is theoretically possible to use a mix of `yaml` and classic configuration, b epicsEnvSet("DEV", "STEST-MYDEVICE") ${SCRIPTEXEC} ${ecmccfg_DIR}configureAxis.cmd, "CONFIG=./cfg/axis_1" ``` +{{% notice tip %}} +See [best practice](../motion_cfg/best_practice/) and [yaml cfg](../motion_cfg/axisyaml/) and for more information. +{{% /notice %}} ##### adding a virtual motor axis ```bash ${SCRIPTEXEC} ${ecmccfg_DIR}configureVirtualAxis.cmd, "CONFIG=./cfg/axis_11_virt" ``` +{{% notice tip %}} +See [best practice](../motion_cfg/best_practice/) and [yaml cfg](../motion_cfg/axisyaml/) and for more information. +{{% /notice %}} ##### adding synchronization ```bash ${SCRIPTEXEC} ${ecmccfg_DIR}applyAxisSynchronization.cmd, "CONFIG=./cfg/axis_1_sync" ${SCRIPTEXEC} ${ecmccfg_DIR}applyAxisSynchronization.cmd, "CONFIG=./cfg/axis_11_sync" ``` +{{% notice tip %}} +See [best practice](../motion_cfg/best_practice/) and [yaml cfg](../motion_cfg/axisyaml/) and for more information. +{{% /notice %}} ##### loading a PLC from file The PLC functionality is explained in detail here. @@ -136,6 +147,9 @@ ECMC PLCs can be loaded from classical PLC files, from pure yaml files or from a ```bash ${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlPlc.cmd "FILE=./plc1File.yaml" ``` +{{% notice tip %}} +See [plc cfg](../plc_cfg/best_practice/) for more information. +{{% /notice %}} #### go active ```bash diff --git a/hugo/content/manual/knowledgebase/hardware/EL1xxx.md b/hugo/content/manual/knowledgebase/hardware/EL1xxx.md new file mode 100644 index 000000000..f66fe495a --- /dev/null +++ b/hugo/content/manual/knowledgebase/hardware/EL1xxx.md @@ -0,0 +1,30 @@ ++++ +title = "EL1xxx" +weight = 17 +chapter = false ++++ + +### EL1252, EL1252-0050 +EL1252-xxxx is a 2 ch digital input terminal with timestamps (low to high, high to low): +* EL1252: **24V signals** +* EL1252-0050: **5V signals** + +Both terminals have the product id and process data and can therefore be configured as EL1252: +``` +# One channel: +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL1252" +``` + +These terminals are very powerful since they can latch the time of the positive edge and/or negative edge of the input signal (independent of the ethercat bus rate). These timestamps can then be used to correlated other data, like encoders or analog inputs with timestamps. + +**IMPORTANT** +Sine the EL1252-0050 is a 5V terminal, it needs to be powered with **5V** if the terminal is powered with 24V, the terminal will burn. The simplest way to achieve a correct power supply is by adding an EL9505 (or similar) before the EL1252-0050. +See above for more information [5v-and-24v-terminals](../elxxxx#5v-and-24v-terminals) + +{{% notice warning %}} +**Make sure the EL1252-0050 has a 5V power supply by an EL9505 (or similar), before powering the system. If the terminal is powered with the normal 24V it will most likely break** +{{% /notice %}} + +{{% notice note %}} +A 5v signal will not be detected with the 24V version (EL1252), the terminal will however not be damaged. Further more, it's not a good idea to to power the 24V version with 5V (EL9505, or similar) +{{% /notice %}} diff --git a/hugo/content/manual/knowledgebase/hardware/EL51xx.md b/hugo/content/manual/knowledgebase/hardware/EL51xx.md new file mode 100644 index 000000000..3e6bdfb23 --- /dev/null +++ b/hugo/content/manual/knowledgebase/hardware/EL51xx.md @@ -0,0 +1,82 @@ ++++ +title = "EL51xx" +weight = 20 +chapter = false ++++ + +## Overview +The EL51xx series covers incremental encoder interfaces: +1. EL5101: 1 ch, diff rs422, ttl, 1MHz +2. EL5101-0010: 1 ch, diff rs422, 5MHz +3. EL5101-0011: 1 ch, diff rs422, 5MHz, oversampling 100kHz +4. EL5112: 2 ch ABC or 1ch AB, rs422, 5MHz, **PSI standard** +5. EL5131: 1 ch, diff rs422, 5MHz, 2 digital outputs for cam/trigger + +### General +Normally, the incremental encoder interfaces do not require any SDO configuration. Therefore, the ecmccomp/applyComponent.cmd, which many times are needed after the ecmccfg/addSlave.cmd, is in most cases not needed. + +### Adding the slave +Make sure you use the correct slave type when adding the slave. Some of the slaves have the same product id but totally different process data which can result in that the slave will not go into OP mode and ecmc will fail to start and a timeout will occur. + +For example, the EL5101-**0010** and EL5101-**0011** has the same product id but very different process data. +So, if an EL5101-**0011** is added to the configuration but the actual slave connected is an EL5101-**0010**, the initial product id verification will not catch the miss match. However, later the slave will not go online since the process data is wrong. + +The issue can be diagnosed by checking the dmesg logs: +```bash +# first login to host (ecmc server) +sudo dmesg +``` +Configuring the wrong process data will lead to an error message "* EtherCAT * Invalid input configuration" + +The solution is to use the correct configuration script. + +### EL5101-0010 +This is commonly used at PSI (even though the EL5112 should be teh standard choice). For configuration, use the EL5101-0010 configuration script: +``` +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL5101-0010" +``` +### EL5101-0011 +This is an oversampling slave, use the EL5101-0011 configuration script with an optional NELM which defines the levels of oversampling: +Example: Add an EL5101-0011, with 100 levels of oversampling: +``` +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL5101-0011, NELM=100" +``` +In the above example, for each ethercat frame, an array of 100 elements will be transferred. If the ethercat rate is 1kHz, then the incremental data will be sampled at 100kHz (which also is the maximum rate for this terminal). + +{{% notice note %}} +NELM cannot be freely defined, depending on the ethercat rate different NELM values will be accepted. Consult the EL5101-0011 manual for more information. +Normally, NELM needs to be an integer value, like 10,20,50, 100. +{{% /notice %}} + +### EL5112 +This is the PSI standard incremental encoder interface. The terminal can be used as one channel if index pulse needs to be connected or two channel if only A and B pulse trains are needed. + +For 1 channel operation with index pulse, use the EL5112_ABC configuration script and for two channel, the EL5112_AB script: +``` +# One channel: +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL5112_ABC" + +# Two channel: +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL5112_AB" +``` + +### EL5131 +This terminal support setting cam/trigger outputs at certain counter values (for predefined time, and direction). + +8 predefined threshold counter values can be entered and configured switch outputs on or off. These thresholds can also be accessed/updated during runtime. + +Depending how the terminal should be used, the following startup scripts exists: +* EL5131: Normal increment encoder operation +* EL5131_DC: Normal incremental encoder and DC clock (access to timestamps) +* EL5131_DC_TRG: Incremental encoder, access to timestamps, access to configuration of thresholds for outputs for triggering. + +``` +# EL5131: Normal increment encoder operation: +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL5131" + +# EL5131_DC: Normal incremental encoder and DC clock (access to timestamps) +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL5131_DC" + +# EL5131_DC_TRG: Incremental encoder, access to timestamps and configuration of thresholds for outputs/triggering. +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL5131_DC" +``` diff --git a/hugo/content/manual/knowledgebase/hardware/EL70x1.md b/hugo/content/manual/knowledgebase/hardware/EL70x1.md index a89093572..e4a0b873b 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL70x1.md +++ b/hugo/content/manual/knowledgebase/hardware/EL70x1.md @@ -1,6 +1,6 @@ +++ title = "EL70x1" -weight = 19 +weight = 22 chapter = false +++ @@ -8,10 +8,8 @@ chapter = false 1. [error/warning](#error/warning) 2. [Tuning](#tuning) ---- - ### error/warning -If the drive is in error or warning state, further information about the reason for the warning/error can be read from the drive terminal by using the ethercat command. See [command line interface](ethercatcli) for more info. +If the El70x1 is in error or warning state, further information about the reason for the error/warning can be read from the drives diagnostic register by using the ethercat command. See [command line interface](ethercatcli). {{% notice info %}} In order to use the ethercat command, you must first login to the server where the ecmc IOC is running. diff --git a/hugo/content/manual/knowledgebase/hardware/ELxxxx.md b/hugo/content/manual/knowledgebase/hardware/ELxxxx.md new file mode 100644 index 000000000..87e898062 --- /dev/null +++ b/hugo/content/manual/knowledgebase/hardware/ELxxxx.md @@ -0,0 +1,23 @@ ++++ +title = "ELxxxx" +weight = 16 +chapter = false ++++ + +# 5V and 24V terminals +24V is the most common signal level for the terminals, however, a few terminals also support other voltage levels, for instance 5V. +In that case, normally the terminal needs to be powered with the same voltage. +For 5V terminals, normally this is handled by adding a EL9505 before the 5v terminal in the ethercat chain. The EL9505 will supply the power bus with 5V instead of the normal 24V . + +Example of slaves needing 5V power supply: +* EL1124 +* El1252-0050 +* ... + +{{% notice warning %}} +**If a 5V terminal is supplied with 24V it will most likely break. Make sure the terminals has the correct power supply __before__ powering the system.** +{{% /notice %}} + +{{% notice note %}} +**The voltage level of the power bus after (downstream) of a 5V terminal is normally also 5V, if another voltage is needed then another system terminal is needed to set a new voltage level of the power bus** +{{% /notice %}} diff --git a/hugo/content/manual/knowledgebase/hardware/_index.md b/hugo/content/manual/knowledgebase/hardware/_index.md index 137a40911..857b33364 100644 --- a/hugo/content/manual/knowledgebase/hardware/_index.md +++ b/hugo/content/manual/knowledgebase/hardware/_index.md @@ -1,6 +1,6 @@ +++ title = "hardware" -weight = 15 +weight = 22 chapter = false +++ diff --git a/hugo/content/manual/knowledgebase/hardware/host.md b/hugo/content/manual/knowledgebase/host.md similarity index 99% rename from hugo/content/manual/knowledgebase/hardware/host.md rename to hugo/content/manual/knowledgebase/host.md index 1be519054..4fd9d9e60 100644 --- a/hugo/content/manual/knowledgebase/hardware/host.md +++ b/hugo/content/manual/knowledgebase/host.md @@ -1,5 +1,5 @@ +++ -title = "ecmc server" +title = "host / ecmc server" weight = 17 chapter = false +++ @@ -8,8 +8,6 @@ chapter = false 1. [latency issues](#latency-issues) 2. [EtherCAT rate (EC_RATE)](#EtherCAT-rate-(EC_RATE)) ---- - ### latency issues High latency, more than 10% of the ethercat cycle time, can in worse case result, in lost ethercat frames, which of course is not an ideal situation. High latency of the ecmc_rt thread can be related to: diff --git a/hugo/content/manual/knowledgebase/panel.md b/hugo/content/manual/knowledgebase/panel.md index 60d72dce4..86cf60c2d 100644 --- a/hugo/content/manual/knowledgebase/panel.md +++ b/hugo/content/manual/knowledgebase/panel.md @@ -22,7 +22,7 @@ The ecmcMain.ui covers most parts of an ecmc system: - plugin objects - data storage objects -The ecmcMain.ui is started with the following syntax: +The panel is started with the following syntax: ``` caqtdm -macro "IOC=" ecmcMain.ui ``` From ef5e00a07b0f0764f76e82881762cb39ecead34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstro=CC=88m?= Date: Sun, 29 Sep 2024 19:10:08 +0200 Subject: [PATCH 5/8] Add more info to manual --- .../manual/knowledgebase/hardware/EL1xxx.md | 2 +- .../manual/knowledgebase/hardware/EL70x1.md | 18 +++++++++++- .../manual/knowledgebase/hardware/ELxxxx.md | 6 ++-- hugo/content/manual/knowledgebase/host.md | 4 +-- hugo/content/manual/knowledgebase/motion.md | 29 +++++++++---------- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/hugo/content/manual/knowledgebase/hardware/EL1xxx.md b/hugo/content/manual/knowledgebase/hardware/EL1xxx.md index f66fe495a..65d803b6c 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL1xxx.md +++ b/hugo/content/manual/knowledgebase/hardware/EL1xxx.md @@ -19,7 +19,7 @@ These terminals are very powerful since they can latch the time of the positive **IMPORTANT** Sine the EL1252-0050 is a 5V terminal, it needs to be powered with **5V** if the terminal is powered with 24V, the terminal will burn. The simplest way to achieve a correct power supply is by adding an EL9505 (or similar) before the EL1252-0050. -See above for more information [5v-and-24v-terminals](../elxxxx#5v-and-24v-terminals) +See above for more information [5v-and-24v-terminals](../elxxxx#power-bus-5v-and-24v-terminals) {{% notice warning %}} **Make sure the EL1252-0050 has a 5V power supply by an EL9505 (or similar), before powering the system. If the terminal is powered with the normal 24V it will most likely break** diff --git a/hugo/content/manual/knowledgebase/hardware/EL70x1.md b/hugo/content/manual/knowledgebase/hardware/EL70x1.md index e4a0b873b..1d42c13bc 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL70x1.md +++ b/hugo/content/manual/knowledgebase/hardware/EL70x1.md @@ -6,7 +6,8 @@ chapter = false ## Topics 1. [error/warning](#error/warning) -2. [Tuning](#tuning) +2. [tuning](#tuning) +3. [Speed range](#speed-range) ### error/warning If the El70x1 is in error or warning state, further information about the reason for the error/warning can be read from the drives diagnostic register by using the ethercat command. See [command line interface](ethercatcli). @@ -115,3 +116,18 @@ This is the current loop settings and this is also what affect the performance. For most applications it is important to keep a ration of 40:1. Default is 400 / 10, if you want a stiffer loop, then change to f ex 800 / 20 and onwards. Increase until the motor misbehaves and go back to a safe setting. + +### speed range +The EL704x stepper drives are default setup to a maximum velocity range of +-2000 full-steps/s. The 16bit velocity setpoint that are sent to the drive corresponds to this range. The speed range for the EL704x can however be changed by setting SDO 8012:05: +``` +0 for 1000 full-steps/second +1 for 2000 full-steps/second (default) +2 for 4000 full-steps/second +3 for 8000 full-steps/second +4 for 16000 full-steps/second +5 for 32000 full-steps/second +``` + +{{% notice info %}} +The drive scaling in the axis yaml configuration must be updated if the speed range is changed. See [scaling](../../../motion_cfg/scaling/). +{{% /notice %}} diff --git a/hugo/content/manual/knowledgebase/hardware/ELxxxx.md b/hugo/content/manual/knowledgebase/hardware/ELxxxx.md index 87e898062..22db16183 100644 --- a/hugo/content/manual/knowledgebase/hardware/ELxxxx.md +++ b/hugo/content/manual/knowledgebase/hardware/ELxxxx.md @@ -4,10 +4,10 @@ weight = 16 chapter = false +++ -# 5V and 24V terminals -24V is the most common signal level for the terminals, however, a few terminals also support other voltage levels, for instance 5V. +# Power bus - 5V or 24V terminals +24V is the most common signal level for the terminals, however, some also support other voltage levels, for instance 5V, or 12V or.... In that case, normally the terminal needs to be powered with the same voltage. -For 5V terminals, normally this is handled by adding a EL9505 before the 5v terminal in the ethercat chain. The EL9505 will supply the power bus with 5V instead of the normal 24V . +For 5V terminals, normally a EL9505 is added before the 5v terminal in the ethercat chain supplying the power bus with 5V. Example of slaves needing 5V power supply: * EL1124 diff --git a/hugo/content/manual/knowledgebase/host.md b/hugo/content/manual/knowledgebase/host.md index 4fd9d9e60..86cbc012e 100644 --- a/hugo/content/manual/knowledgebase/host.md +++ b/hugo/content/manual/knowledgebase/host.md @@ -5,10 +5,10 @@ chapter = false +++ ## Topics -1. [latency issues](#latency-issues) +1. [latency issues / lost frames](#latency-issues--lost-frames) 2. [EtherCAT rate (EC_RATE)](#EtherCAT-rate-(EC_RATE)) -### latency issues +### latency issues / lost frames High latency, more than 10% of the ethercat cycle time, can in worse case result, in lost ethercat frames, which of course is not an ideal situation. High latency of the ecmc_rt thread can be related to: 1. The generic device driver is used diff --git a/hugo/content/manual/knowledgebase/motion.md b/hugo/content/manual/knowledgebase/motion.md index d744bc0a7..c83dcf1f6 100644 --- a/hugo/content/manual/knowledgebase/motion.md +++ b/hugo/content/manual/knowledgebase/motion.md @@ -6,8 +6,7 @@ chapter = false ## Topics 1. [both_limits error](#both_limits-error) -2. [position lag error, (following error), tuning](#position-lag-error) -3. [latency issues](#latency-issues) +2. [position lag error, (following error)](#position-lag-error) 4. [drive refuse to enable](#drive-refuse-to-enable) 5. [force manual motion](#force-manual-motion) @@ -48,8 +47,8 @@ Before increase current to the motor, make sure that both motor and drive can ha {{% /notice %}} ### 2. scaling factors are wrong -Check the scaling documentation [here](https://paulscherrerinstitute.github.io/ecmccfg/manual/axis/scaling/). -One way to test if the scaling is correct is to set all controller parameters (except Kff) to 0 and then initiate a move. Basically the actual position of the axis should follow the setpoint closely with teh same slope. If the slope differs, then the scaling factors are wrong. +Check the scaling documentation [here](../../motion_cfg/scaling/). +One way to test if the scaling is correct is to set all controller parameters (except Kff) to 0 and then initiate a move. Basically the actual position of the axis should follow the setpoint closely with the same slope. If the slope differs, then the scaling factors are wrong. ### 3. the velocity setpoint is too high resulting in stall If a stepper motor stalls because of too high velocity there's a few thing that can be done in order to improve the ability to reach higher velocities: @@ -62,24 +61,22 @@ Before increase current to the motor, make sure that both motor and drive can ha {{% /notice %}} ### 4. velocity higher than allowed by driver -For EL704x stepper drives are default setup to maximum velocity range of +-2000 full-steps/s. The 16bit velocity setpoint that are sent to the drive corresponds to this range. Basically trying to write a higher value than that will saturate the velocity setpoint resulting in that the required speed is not achieved, resulting in position lag error. The speed range for the EL704x can however be changed by setting SDO 8012:05: -``` -0 for 1000 full-steps/second -1 for 2000 full-steps/second (default) -2 for 4000 full-steps/second -3 for 8000 full-steps/second -4 for 16000 full-steps/second -5 for 32000 full-steps/second -``` -After changing this value you also need to change the drive scaling in the axis yaml file. +The velocity setpoint of drives covers a certain velocity range: +* EL70xx stepper drives default: 16bit setpoint that corresponds to a velocity range of +-2000full-steps/s. +* EL72xx servo drives default: 32bit setpoint that corresponds to a velocity range of either +-6000Hz or +-8000Hz depending on the motor pole count. + +If a velocity outside the velocity range is requested, the velocity setpoint will be saturated and the requested velocity will not be reached resulting in a position lag error. + +For EL70xx drives the velocity range can be configured to other values than the default +-2000full-steps/s. See +[el70x1 speed range](../hardware/el70x1#speed-range) for setting other velocity range. ## drive refuse to enable -First check the dedicated hardware drive panel for diagnostics. If the drive is in warning or error state the diagnose the problem with the tool described in [hardware](hardware). +First check the dedicated hardware drive panel for diagnostics. If the drive is in warning or error state then, if an EL70x1 drive, diagnose the problem further with the tool described in [hardware](../hardware/el70x1). Possible reasons: 1. For systems with safety, tripp off STO or power to the drive removed by contactor. Check status of safety system. 2. Over current protection of 48V tripped. -3. No 48V connected. +3. No motor power connected (48V or24V). 4. ecmc PLC disabling axis, check PLC sources. 5. Motion axis in error state. Some errors prevent the axis from being enabled. Check axis error state 6. Drive hardware enable input not set high (valid for EP7211-0034, EL70xx if special cfgs). From 7bfc84930be110a7ba39c8459fa17f6b3901de6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstro=CC=88m?= Date: Sun, 29 Sep 2024 20:12:47 +0200 Subject: [PATCH 6/8] Add more info to manual --- .../manual/knowledgebase/hardware/EL51xx.md | 2 +- .../manual/knowledgebase/hardware/EL70x1.md | 21 +++++++------------ hugo/content/manual/knowledgebase/motion.md | 16 ++++++++------ 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/hugo/content/manual/knowledgebase/hardware/EL51xx.md b/hugo/content/manual/knowledgebase/hardware/EL51xx.md index 3e6bdfb23..42e59fd85 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL51xx.md +++ b/hugo/content/manual/knowledgebase/hardware/EL51xx.md @@ -9,7 +9,7 @@ The EL51xx series covers incremental encoder interfaces: 1. EL5101: 1 ch, diff rs422, ttl, 1MHz 2. EL5101-0010: 1 ch, diff rs422, 5MHz 3. EL5101-0011: 1 ch, diff rs422, 5MHz, oversampling 100kHz -4. EL5112: 2 ch ABC or 1ch AB, rs422, 5MHz, **PSI standard** +4. EL5112: 2 ch ABC or 1 ch AB, rs422, 5MHz, **PSI standard** 5. EL5131: 1 ch, diff rs422, 5MHz, 2 digital outputs for cam/trigger ### General diff --git a/hugo/content/manual/knowledgebase/hardware/EL70x1.md b/hugo/content/manual/knowledgebase/hardware/EL70x1.md index 1d42c13bc..0bb387644 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL70x1.md +++ b/hugo/content/manual/knowledgebase/hardware/EL70x1.md @@ -10,15 +10,11 @@ chapter = false 3. [Speed range](#speed-range) ### error/warning -If the El70x1 is in error or warning state, further information about the reason for the error/warning can be read from the drives diagnostic register by using the ethercat command. See [command line interface](ethercatcli). +If the drive is in error/warning state and not possible to enable, see [drive refuse to enable](../../motion/#drive-refuse-to-enable). -{{% notice info %}} -In order to use the ethercat command, you must first login to the server where the ecmc IOC is running. -{{% /notice %}} - -The diagnostic data can be read from register [Index A010 STM Diag data Ch.1](https://infosys.beckhoff.com/english.php?content=../content/1033/el70x1/2286662027.html&id=126846504617985959) with the following syntax: +Further information about the error/warning can be read from from the drive's diagnostic register, [Index A010 STM Diag data Ch.1](https://infosys.beckhoff.com/english.php?content=../content/1033/el70x1/2286662027.html&id=126846504617985959): -The ecmccfg/utils/read_el70xx_diag.sh tool can be used to read all the diagnostic registers: +The ecmccfg/utils/read_el70xx_diag.sh tool can be used to read all the diagnostic registers of any ex70xx drive: ```bash bash read_el70xx_diag.sh ``` @@ -50,9 +46,8 @@ Misc error: 0x00 0 ######################################################### - ``` -Note: The tool ecmccfg/utils/PDO_read can also be used for reading the diagnostics. +Note: The tool```ecmccfg/utils/PDO_read``` can also be used for reading the diagnostics. #### under voltage @@ -89,13 +84,11 @@ For the EL703x drives the nominal voltage must be set to 24V (ecmccomp handles t ### Tuning There are normally several control loops in an ecmc system: -* Position loop (centralized in ecmc if CSV) +* Position loop (centralized in ecmc if CSV), see [tuning](../../tuning) * Velocity loop (in drive) * Current loop (in drive) -However, for the EL70x1 drives there's no dedicated velocity loop (however some current boost settings that can be applied in acc/dec, see below) - -For more information on tuning the position loop see [tuning](../../tuning) +However, for the EL70x1 drives there's no dedicated velocity loop. #### Current loop For most use cases, the default current controller parameters are already well tuned. Sometimes when operating at higher speeds the current loop needs to be tuned. @@ -129,5 +122,5 @@ The EL704x stepper drives are default setup to a maximum velocity range of +-20 ``` {{% notice info %}} -The drive scaling in the axis yaml configuration must be updated if the speed range is changed. See [scaling](../../../motion_cfg/scaling/). +When changing the speed range of the drive, also the drive scaling in the axis yaml configuration must be updated, see [scaling](../../../motion_cfg/scaling/). {{% /notice %}} diff --git a/hugo/content/manual/knowledgebase/motion.md b/hugo/content/manual/knowledgebase/motion.md index c83dcf1f6..63d97a394 100644 --- a/hugo/content/manual/knowledgebase/motion.md +++ b/hugo/content/manual/knowledgebase/motion.md @@ -71,16 +71,20 @@ For EL70xx drives the velocity range can be configured to other values than the [el70x1 speed range](../hardware/el70x1#speed-range) for setting other velocity range. ## drive refuse to enable -First check the dedicated hardware drive panel for diagnostics. If the drive is in warning or error state then, if an EL70x1 drive, diagnose the problem further with the tool described in [hardware](../hardware/el70x1). +First check the dedicated hardware drive panel for diagnostics and errors/warnings. +For EL70x1 drive diagnostics, check [el70x1](../hardware/el70x1). Possible reasons: -1. For systems with safety, tripp off STO or power to the drive removed by contactor. Check status of safety system. -2. Over current protection of 48V tripped. +1. For systems equipped with motion safety (STO or power to the drive removed by contactor): Check status of safety system. Drives with STO: + * EL72xx-9xxx + * EP7211-0034 + * Festo CMMT-S +2. Over current protection of motor power (48V) tripped. 3. No motor power connected (48V or24V). 4. ecmc PLC disabling axis, check PLC sources. -5. Motion axis in error state. Some errors prevent the axis from being enabled. Check axis error state -6. Drive hardware enable input not set high (valid for EP7211-0034, EL70xx if special cfgs). -7. Axis object configured with external interlock (yaml->input.interlock). +5. Motion axis in error state. Some errors prevent the axis from being enabled. Check axis error state. +6. Drive hardware enable input not set high (valid for EL70xx if special cfgs). +7. Axis object configured with external interlock (yaml->input.interlock). ## force manual motion {{% notice warning %}} From ed7caae6cc0670b6dc213e7fa86d47a13139aa58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstro=CC=88m?= Date: Sun, 29 Sep 2024 20:42:15 +0200 Subject: [PATCH 7/8] Update wheight of el9xxx.md --- hugo/content/manual/knowledgebase/hardware/EL9xxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugo/content/manual/knowledgebase/hardware/EL9xxx.md b/hugo/content/manual/knowledgebase/hardware/EL9xxx.md index a5d037408..31476a1ab 100644 --- a/hugo/content/manual/knowledgebase/hardware/EL9xxx.md +++ b/hugo/content/manual/knowledgebase/hardware/EL9xxx.md @@ -1,6 +1,6 @@ +++ title = "EL9xxx" -weight = 20 +weight = 24 chapter = false +++ From 24b2105c17989682b8610176eb59d82796f3b32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstro=CC=88m?= Date: Sun, 29 Sep 2024 22:00:58 +0200 Subject: [PATCH 8/8] cleanup --- hugo/content/manual/PLC_cfg/syntax.md | 1484 ++++++++--------- hugo/content/manual/build.md | 2 +- .../manual/general_cfg/best_practice.md | 2 +- .../content/manual/general_cfg/iocsh_utils.md | 93 +- hugo/content/manual/knowledgebase/host.md | 10 +- 5 files changed, 796 insertions(+), 795 deletions(-) diff --git a/hugo/content/manual/PLC_cfg/syntax.md b/hugo/content/manual/PLC_cfg/syntax.md index 19977bc5d..6ce81b439 100644 --- a/hugo/content/manual/PLC_cfg/syntax.md +++ b/hugo/content/manual/PLC_cfg/syntax.md @@ -61,372 +61,370 @@ Custom plc functions can be written in c in plugins. ### general -```shell -# -# 1. Assignment: -# ec0.s1.VALUE:=100; -# -# 2. if-else (note the equal sign): -# if(ec0.s1.VALUE=100) { -# # code -# } -# else { -# # code -# }; -# -# 3. for loop: -# for (static.i := 0; static.i < static.elements; static.i += 1) { -# # code -# }; -# -# 4. printouts (minimize printouts or use only for debug): -# print("The value of ec0.s1.VALUE is: ",ec0.s1.VALUE); # Without line feed -# println("The value of ec0.s1.VALUE is: ",ec0.s1.VALUE); # With line feed -# -# Also see the "ec_print_bin()" and "ec_print_hex()" below. +```text + 1. Assignment: + ec0.s1.VALUE:=100; + + 2. if-else (note the equal sign): + if(ec0.s1.VALUE=100) { + # code + } + else { + # code + }; + + 3. for loop: + for (static.i := 0; static.i < static.elements; static.i += 1) { + # code + }; + + 4. printouts (minimize printouts or use only for debug): + print("The value of ec0.s1.VALUE is: ",ec0.s1.VALUE); # Without line feed + println("The value of ec0.s1.VALUE is: ",ec0.s1.VALUE); # With line feed + + Also see the "ec_print_bin()" and "ec_print_hex()" below. ``` ### variables #### generic -```shell -# 1. static. Static variable. Initiated to 0. (rw) -# Access only in the PLC where defined. -# Will keep value between execution -# loops. -# 2. global. Global variable. Initiated to 0. (rw) -# Access from all PLCs. -# Will keep value between execution -# loops. -# 3. var Local variable (exprtk syntax) (rw) -# Will NOT keep value between -# execution loops. +```text + 1. static. Static variable. Initiated to 0. (rw) + Access only in the PLC where defined. + Will keep value between execution + loops. + 2. global. Global variable. Initiated to 0. (rw) + Access from all PLCs. + Will keep value between execution + loops. + 3. var Local variable (exprtk syntax) (rw) + Will NOT keep value between + execution loops. ``` #### EtherCAT -```shell -# 1. ec.s. ethetcat data (rw) -# ecid: ethercat master index -# sid: ethercat slave bus position -# alias: entry name as defined in -# "Cfg.EcAddEntryComplete() -# 2. ec.masterstatus Status of master (1=OK) +```text + 1. ec.s. ethetcat data (rw) + ecid: ethercat master index + sid: ethercat slave bus position + alias: entry name as defined in + "Cfg.EcAddEntryComplete() + 2. ec.masterstatus Status of master (1=OK) ``` #### motion -```shell -# 1. ax.id axis id (ro) -# 2. ax.reset reset axis error (rw) -# 3. ax.counter execution counter (ro) -# 4. ax.error error (ro) -# 5. ax.allowplccmd Allow writes to axis from PLC (rw) -# 6. ax.enc.actpos actual position (rw) -# 7. ax.enc.extactpos actual position from plc sync. -# expression (ro) -# 8. ax.enc.actvel actual velocity (ro) -# 9. ax.enc.rawpos actual raw position (ro) -# 10. ax.enc.source internal source or expressions (rw) -# source = 0: internal encoder -# source > 0: actual pos from expr -# 11. ax.enc.homed encoder homed (rw) -# 12. ax.enc.homepos homing position (rw) -# 13. ax.traj.setpos curent trajectory setpoint (rw) -# 14. ax.traj.targetpos target position (rw) -# 15. ax.traj.extsetpos current trajecrory setpoint from -# plc sync. expression (rw) -# 16. ax.traj.targetvel target velocity setpoint (rw) -# 17. ax.traj.targetacc target acceleration setpoint (rw) -# 18. ax.traj.targetdec target deceleration setpoint (rw) -# 19. ax.traj.setvel current velocity setpoint (ro) -# 20. ax.traj.setvelffraw feed forward raw velocity (ro) -# 21. ax.traj.command command (rw) -# command=1: move velocity -# command=2: move rel. pos -# command=3: move abs. pos -# command=10: homing -# 22. ax.traj.cmddata cmddat. Homing procedure -# only valid if ax.traj.command=10 -# cmddata=1 : ref low limit -# cmddata=2 : ref high limit -# cmddata=3 : ref home sensor -# (via low limit) -# cmddata=4 : ref home sensor -# (via high limit) -# cmddata=5 : ref center of home sensor -# (via low limit) -# cmddata=6 : ref center of home sensor -# (via high limit) -# cmddata=15 : direct homing -# cmddata=21 : ref partly abs. encoder -# (via low limit). -# ref at abs bits. -# over/under-flow.. -# cmddata=22 : ref partly abs. encoder -# (via high limit). -# ref at abs bits. -# over/under-flow.. -# 23. ax.traj.source internal source or expressions (rw) -# source = 0: internal traj -# source > 0: setpoints from expr -# 24. ax.traj.execute execute motion command (rw) -# 25. ax.traj.busy axis busy (ro) -# 26. ax.traj.dir axis setpoint direction (ro) -# ax.traj.dir>0: forward -# ax.traj.dir<0: backward -# ax.traj.dir=0: standstill -# 27. ax.cntrl.error actual controller error (ro) -# 28. ax.cntrl.poserror actual position error (ro) -# 29. ax.cntrl.output actual controller output (ro) -# 30. ax.drv.setvelraw actual raw velocity setpoint (ro) -# 31. ax.drv.enable enable drive command (rw) -# 32. ax.drv.enabled drive enabled (ro) -# 33. ax.seq.state sequence state (homing) (ro) -# 34. ax.mon.ilock motion interlock (both dir) (rw) -# ax.mon.ilock=1: motion allowed -# ax.mon.ilock=0: motion not allowed -# 35. ax.mon.ilockbwd motion interlock bwd dir (rw) -# ax.mon.ilockbwd=1: motion allowed -# ax.mon.ilockbwd=0: motion not allowed -# 36. ax.mon.ilockfwd motion interlock fwd dir (rw) -# ax.mon.ilockfwd=1: motion allowed -# ax.mon.ilockfwd=0: motion not allowed -# 37. ax.mon.attarget axis at taget (ro) -# 38. ax.mon.lowlim low limit switch (ro) -# 39. ax.mon.highlim high limit switch (ro) -# 40. ax.mon.homesensor home sensor (ro) -# 41. ax.mon.lowsoftlim low soft limit (rw) -# 42. ax.mon.highsoftlim high soft limit (rw) -# 43. ax.mon.lowsoftlimenable low soft limit enable (rw) -# 44. ax.mon.highsoftlimenable high soft limit enable (rw) -# 45. ax.blockcom Enables/disables "set" commands (rw) -# via command parser (ascii commands) -# Statuses can still be read. -# Exceptions ("set"-commands) that -# will work: -# - "StopMotion(axid)" -# - "Cfg.SetAxisBlockCom(axid,block)" -# 46. ax.ctrl.kp Set PID-controller kp (rw) -# 47. ax.ctrl.ki Set PID-controller ki (rw) -# 48. ax.ctrl.kd Set PID-controller kd (rw) -# 49. ax.ctrl.kff Set PID-controller kff (rw) +```text + 1. ax.id axis id (ro) + 2. ax.reset reset axis error (rw) + 3. ax.counter execution counter (ro) + 4. ax.error error (ro) + 5. ax.allowplccmd Allow writes to axis from PLC (rw) + 6. ax.enc.actpos actual position (rw) + 7. ax.enc.extactpos actual position from plc sync. + expression (ro) + 8. ax.enc.actvel actual velocity (ro) + 9. ax.enc.rawpos actual raw position (ro) + 10. ax.enc.source internal source or expressions (rw) + source = 0: internal encoder + source > 0: actual pos from expr + 11. ax.enc.homed encoder homed (rw) + 12. ax.enc.homepos homing position (rw) + 13. ax.traj.setpos curent trajectory setpoint (rw) + 14. ax.traj.targetpos target position (rw) + 15. ax.traj.extsetpos current trajecrory setpoint from + plc sync. expression (rw) + 16. ax.traj.targetvel target velocity setpoint (rw) + 17. ax.traj.targetacc target acceleration setpoint (rw) + 18. ax.traj.targetdec target deceleration setpoint (rw) + 19. ax.traj.setvel current velocity setpoint (ro) + 20. ax.traj.setvelffraw feed forward raw velocity (ro) + 21. ax.traj.command command (rw) + command=1: move velocity + command=2: move rel. pos + command=3: move abs. pos + command=10: homing + 22. ax.traj.cmddata cmddat. Homing procedure + only valid if ax.traj.command=10 + cmddata=1 : ref low limit + cmddata=2 : ref high limit + cmddata=3 : ref home sensor + (via low limit) + cmddata=4 : ref home sensor + (via high limit) + cmddata=5 : ref center of home sensor + (via low limit) + cmddata=6 : ref center of home sensor + (via high limit) + cmddata=15 : direct homing + cmddata=21 : ref partly abs. encoder + (via low limit). + ref at abs bits. + over/under-flow.. + cmddata=22 : ref partly abs. encoder + (via high limit). + ref at abs bits. + over/under-flow.. + 23. ax.traj.source internal source or expressions (rw) + source = 0: internal traj + source > 0: setpoints from expr + 24. ax.traj.execute execute motion command (rw) + 25. ax.traj.busy axis busy (ro) + 26. ax.traj.dir axis setpoint direction (ro) + ax.traj.dir>0: forward + ax.traj.dir<0: backward + ax.traj.dir=0: standstill + 27. ax.cntrl.error actual controller error (ro) + 28. ax.cntrl.poserror actual position error (ro) + 29. ax.cntrl.output actual controller output (ro) + 30. ax.drv.setvelraw actual raw velocity setpoint (ro) + 31. ax.drv.enable enable drive command (rw) + 32. ax.drv.enabled drive enabled (ro) + 33. ax.seq.state sequence state (homing) (ro) + 34. ax.mon.ilock motion interlock (both dir) (rw) + ax.mon.ilock=1: motion allowed + ax.mon.ilock=0: motion not allowed + 35. ax.mon.ilockbwd motion interlock bwd dir (rw) + ax.mon.ilockbwd=1: motion allowed + ax.mon.ilockbwd=0: motion not allowed + 36. ax.mon.ilockfwd motion interlock fwd dir (rw) + ax.mon.ilockfwd=1: motion allowed + ax.mon.ilockfwd=0: motion not allowed + 37. ax.mon.attarget axis at taget (ro) + 38. ax.mon.lowlim low limit switch (ro) + 39. ax.mon.highlim high limit switch (ro) + 40. ax.mon.homesensor home sensor (ro) + 41. ax.mon.lowsoftlim low soft limit (rw) + 42. ax.mon.highsoftlim high soft limit (rw) + 43. ax.mon.lowsoftlimenable low soft limit enable (rw) + 44. ax.mon.highsoftlimenable high soft limit enable (rw) + 45. ax.blockcom Enables/disables "set" commands (rw) + via command parser (ascii commands) + Statuses can still be read. + Exceptions ("set"-commands) that + will work: + - "StopMotion(axid)" + - "Cfg.SetAxisBlockCom(axid,block)" + 46. ax.ctrl.kp Set PID-controller kp (rw) + 47. ax.ctrl.ki Set PID-controller ki (rw) + 48. ax.ctrl.kd Set PID-controller kd (rw) + 49. ax.ctrl.kff Set PID-controller kff (rw) ``` #### PLC -```shell -# 1. plc.enable plc enable (rw) -# (end exe with "plc.enable:=0#" -# Could be use full for startup -# sequences) -# 2. plc.error plc error (rw) -# Will be forwarded to user as -# controller error. -# 3. plc.scantime plc sample time in seconds (ro) -# 4. plc.firstscan true during first plc scan only (ro) -# use full for initiations of variables -# 5. ax.plc.enable Same as plc.enable but for -# axis sync plc. -# 6. ax.plc.error Same as plc.error but for -# axis sync plc. -# 7. ax.plc.scantime Same as plc.scantime but for -# axis sync plc. -# 8. ax.plc.firstscan Same as plc.firstscan but for -# axis sync plc. +```text + 1. plc.enable plc enable (rw) + (end exe with "plc.enable:=0#" + Could be use full for startup + sequences) + 2. plc.error plc error (rw) + Will be forwarded to user as + controller error. + 3. plc.scantime plc sample time in seconds (ro) + 4. plc.firstscan true during first plc scan only (ro) + use full for initiations of variables + 5. ax.plc.enable Same as plc.enable but for + axis sync plc. + 6. ax.plc.error Same as plc.error but for + axis sync plc. + 7. ax.plc.scantime Same as plc.scantime but for + axis sync plc. + 8. ax.plc.firstscan Same as plc.firstscan but for + axis sync plc. ``` ### data storage -```shell -# 1. ds.size Set/get size of data storage (rw) -# Set will clear the data storage -# 2. ds.append Add new data at end (rw) -# Current position index will be -# increased -# 3. ds.data Set/get data ar current position (rw) -# 4. ds.index Set/get current position index (rw) -# 5. ds.error Data storage class error (ro) -# 6. ds.clear Data buffer clear (set to zero) (ro) -# 7. ds.full True if data storage is full (ro) +```text + 1. ds.size Set/get size of data storage (rw) + Set will clear the data storage + 2. ds.append Add new data at end (rw) + Current position index will be + increased + 3. ds.data Set/get data ar current position (rw) + 4. ds.index Set/get current position index (rw) + 5. ds.error Data storage class error (ro) + 6. ds.clear Data buffer clear (set to zero) (ro) + 7. ds.full True if data storage is full (ro) ``` ### functions #### EtherCAT -```shell -# -# 1. retvalue = ec_set_bit( -# , : Value to change -# : Bit index -# ); -# Sets bit at bitindex position of value. Returns the new value. -# -# 2. retvalue = ec_wrt_bit( -# , : Value to change -# , : Value of bit to write -# : Bit index -# ); -# Write wrtValue to a bit at bitindex position of value. Returns the new value. -# -# 3. retvalue = ec_wrt_bits( -# , : Value to change -# , : Value of bit to write -# : Start bit index (lsb is bit 0) -# : Stop bit index -# ); -# Write wrtValue to a range of bits (statBit..stopBit) of value. Returns the new value. -# -# 4. retvalue = ec_clr_bit( -# , : Value to change -# : Bit index -# ); -# Clears bit at bitindex position of value. Returns the new value. -# -# 5. retvalue = ec_flp_bit( -# , : Value to change -# : Bit index -# ); -# Flips bit at bitindex position of value. Returns the new value. -# -# 6. retvalue = ec_chk_bit( -# , : Value to change -# : Bit index -# ); -# Checks bit at bitindex position of value. Returns the value of bit. -# -# 7. retvalue = ec_chk_bits( -# , : Value to change -# : Start bit index (lsb is bit 0) -# : Stop bit index -# ); -# Checks range of bits (startBit..stopBit) of value. Returns the value of bits. -# -# 8. retvalue = ec_print_hex( -# , : Value to print -# : Start bit index -# : Stop bit index -# ); -# Prints to of in hex format -# Returns error code or 0 if success. -# -# 9. retvalue = ec_print_bin( -# , : Value to print -# : Start bit index -# : Stop bit index -# ); -# Prints to of in bin format -# Returns error code or 0 if success. -# -# 10. retvalue = ec_mm_cp( -# , : Source memmap index -# : Dest memmap index -# ); -# Copies data from source memmap to dest memmap. The memmap ids are defined by the -# order they are created (starting at 0). The smallest memmap size will define the -# amount of data copied. Returns 0 for success or an error code. -# -# Note: The mmId can be retrieved by the bellow ecmc command (and feed into plc via macro): -# ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" -# epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) -# -# -# 11. retvalue = ec_get_mm_type( -# , : Source memmap index -# ); -# Returns data type of memmap: -# 0 = Not defined (Use "Cfg.EcAddMemMapDT()" instead of "Cfg.EcAddMemMap()") -# 1 = (Not valid for memmap) -# 2 = (Not valid for memmap) -# 3 = (Not valid for memmap) -# 4 = (Not valid for memmap) -# 5 = U8 -# 6 = S8 -# 7 = U16 -# 8 = S16 -# 9 = U32 -# 10 = S32 -# 11 = U64 -# 12 = S64 -# 13 = F32 -# 14 = F64 -# -# Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): -# ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" -# epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) -# -# -# 12. retvalue = ec_get_mm_data( -# , : Source memmap index -# : Index of data element -# ); -# Reads data element at index from memmap with srcId and returns value. -# -# Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): -# ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" -# epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) -# -# 13. retvalue = ec_set_mm_data( -# , : Source memmap index -# : Index of data element -# : Data to write -# ); -# Writes data element at index from memmap with srcId. Returns 0 for success or an error code. -# -# Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): -# ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" -# epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) -# -# 14. retvalue = ec_get_mm_size( -# , : Source memmap index -# ); -# Returns number of elements (of type "ec_get_mm_type()")in memmap with srcId. -# If return value is less than zero it should be considered to be an error code. -# -# Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): -# ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" -# epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) -# -# 14. retvalue = ec_mm_ds_append( -# , : Source memmap index -# ); : Destination data storage index -# Returns Error code or zero if success -# -# Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): -# ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" -# epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) -# -# 15. retvalue = ec_mm_append_to_ds_scale_offset( -# , : Source memmap index -# : Destination data storage index -# : Scale -# ); : Offset -# -# Returns Error code or zero if success -# -# Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): -# ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" -# epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) -# -# 16. retvalue = ec_mm_push_asyn( -# ) : Source memmap index. -# push memap data to epics (can be used if T_SMP_MS=-1 for the param) -# Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): -# ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" -# epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) -# -# 17. retvalue = ec_get_time(); -# Returns current time in nano seconds (from 1 Jan 2000, same as EtherCAT DC:s). -# If return value is less than zero it should be considered to be an error code. -# -# 18. retvalue = ec_get_time_l32(); -# Returns lower 32 bits of current time in nano seconds (from 1 Jan 2000, same as EtherCAT DC:s). -# If return value is less than zero it should be considered to be an error code. -# -# 19. retvalue = ec_get_time_u32(); -# Returns upper 32 bits of current time in nano seconds (from 1 Jan 2000, same as EtherCAT DC:s). -# If return value is less than zero it should be considered to be an error code. -# -# 20. retvalue=ec_get_err(): -# Returns error code from last lib call. -# -# 21. retvalue=ec_err_rst(): -# Resets error code for ec_lib. +```text + 1. retvalue = ec_set_bit( + , : Value to change + : Bit index + ); + Sets bit at bitindex position of value. Returns the new value. + + 2. retvalue = ec_wrt_bit( + , : Value to change + , : Value of bit to write + : Bit index + ); + Write wrtValue to a bit at bitindex position of value. Returns the new value. + + 3. retvalue = ec_wrt_bits( + , : Value to change + , : Value of bit to write + : Start bit index (lsb is bit 0) + : Stop bit index + ); + Write wrtValue to a range of bits (statBit..stopBit) of value. Returns the new value. + + 4. retvalue = ec_clr_bit( + , : Value to change + : Bit index + ); + Clears bit at bitindex position of value. Returns the new value. + + 5. retvalue = ec_flp_bit( + , : Value to change + : Bit index + ); + Flips bit at bitindex position of value. Returns the new value. + + 6. retvalue = ec_chk_bit( + , : Value to change + : Bit index + ); + Checks bit at bitindex position of value. Returns the value of bit. + + 7. retvalue = ec_chk_bits( + , : Value to change + : Start bit index (lsb is bit 0) + : Stop bit index + ); + Checks range of bits (startBit..stopBit) of value. Returns the value of bits. + + 8. retvalue = ec_print_hex( + , : Value to print + : Start bit index + : Stop bit index + ); + Prints to of in hex format + Returns error code or 0 if success. + + 9. retvalue = ec_print_bin( + , : Value to print + : Start bit index + : Stop bit index + ); + Prints to of in bin format + Returns error code or 0 if success. + + 10. retvalue = ec_mm_cp( + , : Source memmap index + : Dest memmap index + ); + Copies data from source memmap to dest memmap. The memmap ids are defined by the + order they are created (starting at 0). The smallest memmap size will define the + amount of data copied. Returns 0 for success or an error code. + + Note: The mmId can be retrieved by the bellow ecmc command (and feed into plc via macro): + ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" + epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) + + + 11. retvalue = ec_get_mm_type( + , : Source memmap index + ); + Returns data type of memmap: + 0 = Not defined (Use "Cfg.EcAddMemMapDT()" instead of "Cfg.EcAddMemMap()") + 1 = (Not valid for memmap) + 2 = (Not valid for memmap) + 3 = (Not valid for memmap) + 4 = (Not valid for memmap) + 5 = U8 + 6 = S8 + 7 = U16 + 8 = S16 + 9 = U32 + 10 = S32 + 11 = U64 + 12 = S64 + 13 = F32 + 14 = F64 + + Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): + ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" + epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) + + + 12. retvalue = ec_get_mm_data( + , : Source memmap index + : Index of data element + ); + Reads data element at index from memmap with srcId and returns value. + + Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): + ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" + epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) + + 13. retvalue = ec_set_mm_data( + , : Source memmap index + : Index of data element + : Data to write + ); + Writes data element at index from memmap with srcId. Returns 0 for success or an error code. + + Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): + ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" + epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) + + 14. retvalue = ec_get_mm_size( + , : Source memmap index + ); + Returns number of elements (of type "ec_get_mm_type()")in memmap with srcId. + If return value is less than zero it should be considered to be an error code. + + Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): + ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" + epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) + + 14. retvalue = ec_mm_ds_append( + , : Source memmap index + ); : Destination data storage index + Returns Error code or zero if success + + Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): + ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" + epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) + + 15. retvalue = ec_mm_append_to_ds_scale_offset( + , : Source memmap index + : Destination data storage index + : Scale + ); : Offset + + Returns Error code or zero if success + + Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): + ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" + epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) + + 16. retvalue = ec_mm_push_asyn( + ) : Source memmap index. + push memap data to epics (can be used if T_SMP_MS=-1 for the param) + Note: The mmId can be retrived by the bellow ecmc command (and feed into plc via macro): + ecmcConfig "EcGetMemMapId(ec0.s11.mm.analogInputArray01)" + epicsEnvSet(MM_CH_1_IN,${ECMC_CONFIG_RETURN_VAL}) + + 17. retvalue = ec_get_time(); + Returns current time in nano seconds (from 1 Jan 2000, same as EtherCAT DC:s). + If return value is less than zero it should be considered to be an error code. + + 18. retvalue = ec_get_time_l32(); + Returns lower 32 bits of current time in nano seconds (from 1 Jan 2000, same as EtherCAT DC:s). + If return value is less than zero it should be considered to be an error code. + + 19. retvalue = ec_get_time_u32(); + Returns upper 32 bits of current time in nano seconds (from 1 Jan 2000, same as EtherCAT DC:s). + If return value is less than zero it should be considered to be an error code. + + 20. retvalue=ec_get_err(): + Returns error code from last lib call. + + 21. retvalue=ec_err_rst(): + Resets error code for ec_lib. ``` #### Master to Master communication (within same host) @@ -434,412 +432,412 @@ Custom plc functions can be written in c in plugins. Support for communication between different ecmc ioc:s running on the same host. A shared memory buffer of 120 doubles can be accessed for read and write operations by alll ecmc ioc running on the same master. -```shell -# 1. retvalue = m2m_write( -# , : Mem buffer index (index must be 0..119) -# ): : value to write -# returns 0 if success or error code. -# Write a value to an index of a common memory buffer accessible by all masters running on same host -# -# 2. retvalue = m2m_read(); : Mem buffer index (index must be 0..119) -# -# returns the value stored at index in the shared mem buffer. -# -# 3. retvalue = m2m_stat(); -# -# returns 1 if connection to shared memory is OK, else 0 or a negative value with an errro code. -# -# 4. m2m_err_rst(); -# -# reset any m2m error codes. -# -# 5. retvalue = m2m_err_rst(); -# -# returns current m2m error code. -# -# 6. retvalue = m2m_ioc_ec_ok(); -# -# returns status etehrcat status of another ecmc ioc (1==op, 0==not op, -1==error). -# -# 7. retvalue = m2m_ioc_run(); -# -# checks of a certian master is running (negative master id is ioc:s without ec master). +```text + 1. retvalue = m2m_write( + , : Mem buffer index (index must be 0..119) + ): : value to write + returns 0 if success or error code. + Write a value to an index of a common memory buffer accessible by all masters running on same host + + 2. retvalue = m2m_read(); : Mem buffer index (index must be 0..119) + + returns the value stored at index in the shared mem buffer. + + 3. retvalue = m2m_stat(); + + returns 1 if connection to shared memory is OK, else 0 or a negative value with an errro code. + + 4. m2m_err_rst(); + + reset any m2m error codes. + + 5. retvalue = m2m_err_rst(); + + returns current m2m error code. + + 6. retvalue = m2m_ioc_ec_ok(); + + returns status etehrcat status of another ecmc ioc (1==op, 0==not op, -1==error). + + 7. retvalue = m2m_ioc_run(); + + checks of a certian master is running (negative master id is ioc:s without ec master). ``` #### Motion -```shell -# 1. retvalue = mc_move_abs( -# , : Axis index -# , : Trigger -# , : Target position -# , : Target velocity -# , : Acceleration -# : Deceleration -# ): -# Absolute motion of axis. -# Motion is triggerd with a positive edge on input. -# returns 0 if success or error code. -# -# 2. retvalue = mc_move_rel( -# , : Axis index -# , : Trigger -# , : Target position -# , : Target velocity -# , : Acceleration -# : Deceleration -# ); -# Relative motion of axis . -# Motion is triggerd with a positive edge on input. -# returns 0 if success or error code. -# -# 3. retvalue = mc_move_ext_pos( -# , : Axis index -# , : Trigger -# , : Target velocity -# , : Acceleration -# : Deceleration -# ); -# Move to current external plc position. Functions intended use is to -# move to the start position for syncronized axes. This command is exactly -# the same as issueing "mc_move_pos()" with the target postion ax.traj.extsetpos. -# Motion is triggerd with a positive edge on input. -# returns 0 if success or error code. -# -# -# 4. retvalue = mc_move_vel( -# , : Axis index -# , : Trigger -# , : Target velocity -# , : Acceleration -# : Deceleration -# ); -# Constant velocity motion of axis . -# Motion is triggerd with a positive edge on input. -# returns 0 if success or error code. -# -# 5. retvalue = mc_home( -# , : Axis index -# , : Trigger -# , : Motion sequence -# , : Target Velocity twords cam -# : Target velocity off cam -# ); -# Perform a homing sequence of axis . -# Motion is triggerd with a positive edge on input. -# returns 0 if success or error code. -# -# 6. retvalue = mc_home_pos( -# , : Axis index -# , : Trigger -# , : Motion sequence -# , : Target Velocity twords cam -# : Target velocity off cam -# : Homing position -# ); -# Perform a homing sequence of axis -# Motion is triggerd with a positive edge on input. -# returns 0 if success or error code. -# -# 7. retvalue = mc_halt( -# , : Axis index -# , : Trigger -# ); -# Stop motion of axis . -# Command is triggerd with a positive edge on input. -# returns 0 if success or error code. -# -# 8. retvalue = mc_power( -# , : Axis index -# , : Enable power -# ); -# Enable power of axis . -# Motion is triggerd with a positive edge on input. -# returns 0 if success or error code. -# -# 9. retvalue = mc_get_busy( -# , : Axis index# -# ); -# Check if axis is busy. -# returns busy state of axis (1 if busy and 0 if not busy). -# -# 10. retvalue = mc_get_homed( -# , : Axis index# -# ); -# Check if axis is homed. -# returns state of homed flag of axis (1 if homed and 0 if not homed). -# -# 11. retvalue = mc_get_err(); -# Returns error code for last lib call. -# -# 12. retvalue = mc_reset(); -# Resets error of motion axis. -# -# 13. retvalue = mc_get_axis_err(); -# Returns motion axis error code. -# -# 14. retvalue = mc_set_enable_motion_funcs( -# , : Axis index -# , : Enable positioning -# , : Enable const velo -# , : Enable const homing -# ); -# -# Enables/disables motion functionalities. Returns error code. -# -# 15. retvalue = mc_get_act_pos( -# , : Axis index -# : Encoder index -# ); -# -# Returns encoder position for any of the configured encoders of an axis. -# -# 16. retvalue = mc_set_prim_enc( -# , : Axis index -# : Encoder index -# ); -# -# Sets primary and homing encoder index of the axis (the encoder used for control). -# The primary encoder can only be changed when the axis is not busy. -# -# Returns motion axis error code. -# -# 17. retvalue = mc_get_prim_enc( -# , : Axis index -# ); -# -# Returns primary encoder index of the axis (the encoder used for control). -# -# 18. mc_set_axis_error( -# , : Axis index -# : Error code to set -# ); -# -# Sets an arbitrary error code to an axis object. -# -# 19. mc_set_slaved_axis_in_error( -# , : Axis index -# ); -# -# Set axis error that indicates that a slaved axis is in error state (ERROR_AXIS_SLAVED_AXIS_IN_ERROR 0x1432B). +```text + 1. retvalue = mc_move_abs( + , : Axis index + , : Trigger + , : Target position + , : Target velocity + , : Acceleration + : Deceleration + ): + Absolute motion of axis. + Motion is triggerd with a positive edge on input. + returns 0 if success or error code. + + 2. retvalue = mc_move_rel( + , : Axis index + , : Trigger + , : Target position + , : Target velocity + , : Acceleration + : Deceleration + ); + Relative motion of axis . + Motion is triggerd with a positive edge on input. + returns 0 if success or error code. + + 3. retvalue = mc_move_ext_pos( + , : Axis index + , : Trigger + , : Target velocity + , : Acceleration + : Deceleration + ); + Move to current external plc position. Functions intended use is to + move to the start position for syncronized axes. This command is exactly + the same as issueing "mc_move_pos()" with the target postion ax.traj.extsetpos. + Motion is triggerd with a positive edge on input. + returns 0 if success or error code. + + + 4. retvalue = mc_move_vel( + , : Axis index + , : Trigger + , : Target velocity + , : Acceleration + : Deceleration + ); + Constant velocity motion of axis . + Motion is triggerd with a positive edge on input. + returns 0 if success or error code. + + 5. retvalue = mc_home( + , : Axis index + , : Trigger + , : Motion sequence + , : Target Velocity twords cam + : Target velocity off cam + ); + Perform a homing sequence of axis . + Motion is triggerd with a positive edge on input. + returns 0 if success or error code. + + 6. retvalue = mc_home_pos( + , : Axis index + , : Trigger + , : Motion sequence + , : Target Velocity twords cam + : Target velocity off cam + : Homing position + ); + Perform a homing sequence of axis + Motion is triggerd with a positive edge on input. + returns 0 if success or error code. + + 7. retvalue = mc_halt( + , : Axis index + , : Trigger + ); + Stop motion of axis . + Command is triggerd with a positive edge on input. + returns 0 if success or error code. + + 8. retvalue = mc_power( + , : Axis index + , : Enable power + ); + Enable power of axis . + Motion is triggerd with a positive edge on input. + returns 0 if success or error code. + + 9. retvalue = mc_get_busy( + , : Axis index# + ); + Check if axis is busy. + returns busy state of axis (1 if busy and 0 if not busy). + + 10. retvalue = mc_get_homed( + , : Axis index# + ); + Check if axis is homed. + returns state of homed flag of axis (1 if homed and 0 if not homed). + + 11. retvalue = mc_get_err(); + Returns error code for last lib call. + + 12. retvalue = mc_reset(); + Resets error of motion axis. + + 13. retvalue = mc_get_axis_err(); + Returns motion axis error code. + + 14. retvalue = mc_set_enable_motion_funcs( + , : Axis index + , : Enable positioning + , : Enable const velo + , : Enable const homing + ); + + Enables/disables motion functionalities. Returns error code. + + 15. retvalue = mc_get_act_pos( + , : Axis index + : Encoder index + ); + + Returns encoder position for any of the configured encoders of an axis. + + 16. retvalue = mc_set_prim_enc( + , : Axis index + : Encoder index + ); + + Sets primary and homing encoder index of the axis (the encoder used for control). + The primary encoder can only be changed when the axis is not busy. + + Returns motion axis error code. + + 17. retvalue = mc_get_prim_enc( + , : Axis index + ); + + Returns primary encoder index of the axis (the encoder used for control). + + 18. mc_set_axis_error( + , : Axis index + : Error code to set + ); + + Sets an arbitrary error code to an axis object. + + 19. mc_set_slaved_axis_in_error( + , : Axis index + ); + + Set axis error that indicates that a slaved axis is in error state (ERROR_AXIS_SLAVED_AXIS_IN_ERROR 0x1432B). ``` #### Motion Group -```shell -# 1. mc_grp_get_enable( -# , : Group index -# ); -# -# Returns true if all axes in the group have the enable bit set, else false. -# Note: The axes do not need to be enabled if this function returns true, see mc_grp_get_enabled(). -# -# 2. mc_grp_get_any_enable( -# , : Group index -# ); -# -# Returns true if atleast one axis in the group has the enable bit set, else false. -# -# 3. mc_grp_get_enabled( -# , : Group index -# ); -# -# Returns true if all axes in the group are in enabled state, else false. -# -# 4. mc_grp_get_any_enabled( -# , : Group index -# ); -# -# Returns true if atleast one axis in the group is in enabled state, else false. -# -# 5. mc_grp_get_busy( -# , : Group index -# ); -# -# Returns true if all axes in the group are in busy state, else false. -# -# 6. mc_grp_get_any_busy( -# , : Group index -# ); -# -# Returns true if atleast one axis in the group is in busy state, else false. -# -# 7. mc_grp_get_any_error_id( -# , : Group index -# ); -# -# Returns error id if atleast one axis in the group is in error state, else zero. -# -# 8. mc_grp_set_enable( -# , : Group index -# : Enable state -# ); -# -# Sets enable for all axes in group. -# Returns 0 or error id. -# -# 9. mc_grp_set_traj_src( -# , : Group index -# : Trajectory source (0 = internal, 1 = external/PLC ) -# ); -# -# Sets trajectory source for all axes in group. -# Returns 0 or error id. -# -# 10. mc_grp_set_enc_src( -# , : Group index -# : Encoder source (0 = internal, 1 = external/PLC ) -# ); -# -# Sets encoder source for all axes in group. -# Returns 0 or error id. -# -# 11. mc_grp_reset_error( -# , : Group index -# ); -# -# Resets error of all axes in group. -# -# 12. mc_grp_set_error( -# , : Group index -# : Error Id -# ); -# -# Set error id of all axes in group. -# -# 13. mc_grp_set_slaved_axis_in_error( -# , : Group index -# ); -# -# Set error id of all axes in group to ERROR_AXIS_SLAVED_AXIS_IN_ERROR (0x1432B) -# -# 14. mc_grp_halt( -# , : Group index -# ); -# -# Halt all axes in group (only works if traj source = internal/0) -# -# 15. mc_grp_axis_in_grp( -# , : Group index -# , : Axis index -# ); -# -# Returns true if axis is in group, else false. -# -# 16. mc_grp_size( -# , : Group index -# ); -# -# Returns the number of axes in group. -# -# -# 17. mc_grp_get_traj_src_ext( -# , : Group index -# ); -# -# Returns true if all axes in the group have trajectory source set to external. -# -# 18. mc_grp_get_any_traj_src_ext( -# , : Group index -# ); -# Returns true if atleast one axis in the group have trajectory source set to external. -# -# 19. mc_grp_set_allow_src_change_when_enabled( -# , : Group index -# , : Allow change of source -# ); -# Allow source change for trajectory and encoder when axis is enabled. -# -# 20. mc_grp_sync_act_set( -# , : Group index -# , : Sync yes or no -# ); -# 1. Sync ecmc current setpoint with actual value (if not enabled and internal mode) -# 2. Sync MR at next poll (maximum once). -# +```text + 1. mc_grp_get_enable( + , : Group index + ); + + Returns true if all axes in the group have the enable bit set, else false. + Note: The axes do not need to be enabled if this function returns true, see mc_grp_get_enabled(). + + 2. mc_grp_get_any_enable( + , : Group index + ); + + Returns true if atleast one axis in the group has the enable bit set, else false. + + 3. mc_grp_get_enabled( + , : Group index + ); + + Returns true if all axes in the group are in enabled state, else false. + + 4. mc_grp_get_any_enabled( + , : Group index + ); + + Returns true if atleast one axis in the group is in enabled state, else false. + + 5. mc_grp_get_busy( + , : Group index + ); + + Returns true if all axes in the group are in busy state, else false. + + 6. mc_grp_get_any_busy( + , : Group index + ); + + Returns true if atleast one axis in the group is in busy state, else false. + + 7. mc_grp_get_any_error_id( + , : Group index + ); + + Returns error id if atleast one axis in the group is in error state, else zero. + + 8. mc_grp_set_enable( + , : Group index + : Enable state + ); + + Sets enable for all axes in group. + Returns 0 or error id. + + 9. mc_grp_set_traj_src( + , : Group index + : Trajectory source (0 = internal, 1 = external/PLC ) + ); + + Sets trajectory source for all axes in group. + Returns 0 or error id. + + 10. mc_grp_set_enc_src( + , : Group index + : Encoder source (0 = internal, 1 = external/PLC ) + ); + + Sets encoder source for all axes in group. + Returns 0 or error id. + + 11. mc_grp_reset_error( + , : Group index + ); + + Resets error of all axes in group. + + 12. mc_grp_set_error( + , : Group index + : Error Id + ); + + Set error id of all axes in group. + + 13. mc_grp_set_slaved_axis_in_error( + , : Group index + ); + + Set error id of all axes in group to ERROR_AXIS_SLAVED_AXIS_IN_ERROR (0x1432B) + + 14. mc_grp_halt( + , : Group index + ); + + Halt all axes in group (only works if traj source = internal/0) + + 15. mc_grp_axis_in_grp( + , : Group index + , : Axis index + ); + + Returns true if axis is in group, else false. + + 16. mc_grp_size( + , : Group index + ); + + Returns the number of axes in group. + + + 17. mc_grp_get_traj_src_ext( + , : Group index + ); + + Returns true if all axes in the group have trajectory source set to external. + + 18. mc_grp_get_any_traj_src_ext( + , : Group index + ); + Returns true if atleast one axis in the group have trajectory source set to external. + + 19. mc_grp_set_allow_src_change_when_enabled( + , : Group index + , : Allow change of source + ); + Allow source change for trajectory and encoder when axis is enabled. + + 20. mc_grp_sync_act_set( + , : Group index + , : Sync yes or no + ); + 1. Sync ecmc current setpoint with actual value (if not enabled and internal mode) + 2. Sync MR at next poll (maximum once). + ``` #### Data Storage -```shell -# 1. retvalue = ds_append_data( -# , : Data storage index -# , : Data -# ); -# Append data to data storage. -# returns 0 if success or error code. -# -# 2. retvalue = ds_clear_data( -# , : Data storage index -# ); -# Clear data to data storage. -# returns 0 if success or error code. -# -# 3. retvalue = ds_get_data( -# , : Data storage index -# , : Buffer index -# ); -# Returns data from buffer. -# -# 4. retvalue = ds_set_data( -# , : Data storage index -# , : Buffer index -# ); -# Sets data in data storage buffer. -# returns 0 if success or error code. -# -# 5. retvalue = ds_get_buff_id( -# , : Data storage index -# ); -# Returns current buffer index. -# -# 6. retvalue = ds_set_buff_id( -# , : Data storage index -# , : Buffer index -# ); -# Sets current buffer index in data storage buffer. -# returns 0 if success or error code. -# -# 7. retvalue = ds_is_full( -# , : Data storage index -# ); -# Returns true if buffer is full. -# -# 8. retvalue = ds_get_size( -# , : Data storage index -# ); -# Returns buffer size of data storage. -# -# 9. retvalue = ds_get_err() -# Returns error code for last lib call. -# -# 10. retvalue = ds_push_asyn( -# , : Data storage index -# ); -# Triggers push of all asyn parameters in ds to EPICS (including data). -# -# 11. retvalue = ds_get_avg( -# , : Data storage index -# ); -# Returns average of the values in the data storage. -# -# 12. retvalue = ds_get_min( -# , : Data storage index -# ); -# Returns minimum of the values in the data storage. -# -# 13. retvalue = ds_get_max( -# , : Data storage index -# ); -# Returns maximum of the values in the data storage. -# -# 14. retvalue=ds_append_to_ds( -# , : Source data storage index -# , : Source data element index -# , : Number of elements to copy -# : Destination data storage index -# ); -# Appends data at the current position of the destination data storage (dsToId). The data source is defined by (dsFromId) and the selected tion (dsFromDataId) and element count (elements). -# -# 15. retvalue=ds_err_rst(): -# Resets error code for ds_lib. -# +```text + 1. retvalue = ds_append_data( + , : Data storage index + , : Data + ); + Append data to data storage. + returns 0 if success or error code. + + 2. retvalue = ds_clear_data( + , : Data storage index + ); + Clear data to data storage. + returns 0 if success or error code. + + 3. retvalue = ds_get_data( + , : Data storage index + , : Buffer index + ); + Returns data from buffer. + + 4. retvalue = ds_set_data( + , : Data storage index + , : Buffer index + ); + Sets data in data storage buffer. + returns 0 if success or error code. + + 5. retvalue = ds_get_buff_id( + , : Data storage index + ); + Returns current buffer index. + + 6. retvalue = ds_set_buff_id( + , : Data storage index + , : Buffer index + ); + Sets current buffer index in data storage buffer. + returns 0 if success or error code. + + 7. retvalue = ds_is_full( + , : Data storage index + ); + Returns true if buffer is full. + + 8. retvalue = ds_get_size( + , : Data storage index + ); + Returns buffer size of data storage. + + 9. retvalue = ds_get_err() + Returns error code for last lib call. + + 10. retvalue = ds_push_asyn( + , : Data storage index + ); + Triggers push of all asyn parameters in ds to EPICS (including data). + + 11. retvalue = ds_get_avg( + , : Data storage index + ); + Returns average of the values in the data storage. + + 12. retvalue = ds_get_min( + , : Data storage index + ); + Returns minimum of the values in the data storage. + + 13. retvalue = ds_get_max( + , : Data storage index + ); + Returns maximum of the values in the data storage. + + 14. retvalue=ds_append_to_ds( + , : Source data storage index + , : Source data element index + , : Number of elements to copy + : Destination data storage index + ); + Appends data at the current position of the destination data storage (dsToId). The data source is defined by (dsFromId) and the selected tion (dsFromDataId) and element count (elements). + + 15. retvalue=ds_err_rst(): + Resets error code for ds_lib. + ``` diff --git a/hugo/content/manual/build.md b/hugo/content/manual/build.md index 473d58c28..fca00e7f0 100644 --- a/hugo/content/manual/build.md +++ b/hugo/content/manual/build.md @@ -9,7 +9,7 @@ These instructions only work at PSI! {{% /notice %}} ## Build at PSI, using driver.makefile -by default this module is only build for RHEL7 and Epics >=R7.0.5 +by default this module is only build for Debian 10 and Epics >=R7.0.6 ### build on login cluster ```bash diff --git a/hugo/content/manual/general_cfg/best_practice.md b/hugo/content/manual/general_cfg/best_practice.md index af7c9afe4..f8c15d627 100644 --- a/hugo/content/manual/general_cfg/best_practice.md +++ b/hugo/content/manual/general_cfg/best_practice.md @@ -21,7 +21,7 @@ As a comparison, TwinCAT default EtherCAT rates are: See [host/ecmc_server](../../knowledgebase/host/) for more information. ## ecmc server setup -* If possible, make sure you use the native igb ethercat driver. +* If possible, make sure the native igb ethercat driver is used. For more information see: * https://git.psi.ch/motion/ecmc_server_cfg diff --git a/hugo/content/manual/general_cfg/iocsh_utils.md b/hugo/content/manual/general_cfg/iocsh_utils.md index 8476b0d55..4e3f0a617 100644 --- a/hugo/content/manual/general_cfg/iocsh_utils.md +++ b/hugo/content/manual/general_cfg/iocsh_utils.md @@ -6,11 +6,11 @@ chapter = false ## ECMC Iocsh Utilities -### Iocsh function "ecmcEpicsEnvSetCalc()" - "ecmcEpicsEnvSetCalc()" is used to evaluate expressions and set result to EPCIS environment variables. Usefull for calculate: +### ecmcEpicsEnvSetCalc + "ecmcEpicsEnvSetCalc()" is used to evaluate expressions and set result to EPCIS environment variables. Useful for calculate: * slave offsets - * sdo/pdo adresses (also in hex) - * scalings in motion + * sdo/pdo addresses (also in hex) + * motion scaling * record fields * ... @@ -31,11 +31,11 @@ ecmcEpicsEnvSetCalc -h Restrictions: - Some flags and/or width/precision combinations might not be supported. - Hex numbers in the expression is not allowed (but hex as output by formating is OK). - - Non floatingpoint values will be rounded to nearest int. + - Non floating point values will be rounded to nearest int. ``` #### Examples: -``` +```text #### Calculate addresses in HEX with specified width # ecmcEpicsEnvSetCalc("test2", "$(test1)+1+2+3+4+5*10.1", "%03x") ecmcEpicsEnvSetCalc("test2", "061+1+2+3+4+5*10.1", "%03x") @@ -83,7 +83,7 @@ ecmcEpicsEnvSetCalc("result", "if('ecmcEL3002.cmd'='test.script') {RESULT:=1;}el epicsEnvShow("result") result=0 ``` -### Iocsh function "ecmcEpicsEnvSetCalcTernary()" +### ecmcEpicsEnvSetCalcTernary "ecmcEpicsEnvSetCalcTernary()" is used o evaluate expressions and set EPCIS environment variables to different strings. depending on if the expression evaluates to "true" or "false". Can be useful for: * Choose different files to load like plc-files, axis configurations, db-files or.. @@ -107,7 +107,7 @@ ecmcEpicsEnvSetCalcTernary -h ``` #### Examples: -``` +```text ### Simple true false epicsEnvSet("VALUE",10) # ecmcEpicsEnvSetCalcTernary("test_var", "${VALUE}+2+5/10","True","False") @@ -134,32 +134,6 @@ epicsEnvShow("result") result=no_use_this_file.cfg ``` -### Use return value of ecmcConfig(OrDie): - -The return value from ecmcConfig(OrDie) is stored in the EPICS environment variable -"ECMC_CONFIG_RETURN_VAL". This value can be used to make som dynamic configuration. -All ASCII configuration commands for ecmcConfig(OrDie) can be used in the same way. - -#### Example: Read firmware version of an EL7037 stepper drive -Note: SDO reads need to be before "SetAppMode(1)" -``` -ecmcConfig "EcReadSdo(${ECMC_SLAVE_NUM},0x100a,0x0,2)" -epicsEnvShow(ECMC_CONFIG_RETURN_VAL) -ECMC_CONFIG_RETURN_VAL=14640 - -``` -The variable "ECMC_CONFIG_RETURN_VAL" then can be used to set record fields, name or alias for instance.. - -### Example: Read "ID" PDO from EK1101 (shown in detail in aliasRecordFromPdoData.script) -Note: PDO reads need to be after "SetAppMode(1)" since cyclic value -``` -ecmcConfig "ReadEcEntryIDString(${ECMC_SLAVE_NUM},"ID")" -## This is the value of the EK1101 ID switch -epicsEnvShow(ECMC_CONFIG_RETURN_VAL) -ECMC_CONFIG_RETURN_VAL=1024 -``` -The variable "ECMC_CONFIG_RETURN_VAL" then can be used to set record fields, name or alias for instance.. - ### ecmcIf(\,\,\) ecmcIf() set two macros depending on the value of the evaluated expression. If it evaluates to true: 1. IF_TRUE="" Allows execution of a line of code @@ -169,20 +143,19 @@ If expression evaluates to false: 1. IF_TRUE="#-" Block execution of a line of code 2. IF_FALSE= "" Allows execution of a line of code -Note: These macros is the default names for the macros (but can be changed by assignment of the 2 last params in call to ecmcIf()): +Note: These macros are the default names for the macros (but can be changed by assignment of the 2 last params in call to ecmcIf()): 1. IF_TRUE for true 2. IF_FALSE for false -### ecmcIf -``` -ecmcEndIf(\,\) +### ecmcEndIf +```text +ecmcEndIf() ``` - The ecmcEndIf() command unsets the last used macros (for true and false), if different names are passed as arguments then then these macros are unset (for nested if statements). -#### Example of of syntax +#### Example of syntax Example 1: -``` +```text ecmcIf("") ${IF_TRUE} # Code to execute if expression eval true #- else @@ -190,7 +163,7 @@ ${IF_FALSE} # Code to execute if expression eval false ecmcEndIf() ``` Example 2: -``` +```text ecmcIf("$(VAL1)=$(VAL2)") ${IF_TRUE}epicsEnvSet(IS_EQUAL,"1") #- else @@ -204,7 +177,7 @@ Useful for: * Large systems with many similar sub systems * Configuring hardware with many PDOs (oversampling) -``` +```text "ecmcForLoop(, , , , , )" to loop execution of file with a changing loop variable. : Filename to execute in for loop. : Macros to feed to execution of file. @@ -216,7 +189,7 @@ Useful for: ``` Example ("ECMC_LOOP_IDX" as loop variable): -``` +```text ecmcForLoop(./loopStep.cmd,"",ECMC_LOOP_IDX,1,5,1) ecmcEpicsEnvSetCalc("TESTING",1*10) epicsEnvShow("TESTING") @@ -235,7 +208,7 @@ epicsEnvShow("TESTING") TESTING=50 ``` where "loopStep.cmd" file looks like this (note the use of "ECMC_LOOP_IDX"): -``` +```text #- Commands tp execute in each loop of example ecmcForLoop.script ecmcEpicsEnvSetCalc("TESTING",${ECMC_LOOP_IDX}*10) epicsEnvShow("TESTING") @@ -243,7 +216,7 @@ epicsEnvShow("TESTING") ### ecmcFileExist Useful for checking that configuration files really exist and then can be loaded. -``` +```text ecmcFileExist(, , , )" to check if a file exists. : Filename to check. : Exit EPICS if file not exist. Optional, defaults to 0. @@ -252,7 +225,7 @@ ecmcFileExist(, , , )" to check if a file result will be stored in the EPICS environment variable "ECMC_FILE_EXIST_RETURN_VAL" ``` Example: -``` +```text ecmcFileExist("file_exist.cfg") epicsEnvShow(ECMC_FILE_EXIST_RETURN_VAL) ECMC_FILE_EXIST_RETURN_VAL=1 @@ -268,6 +241,32 @@ ecmcFileExist("ecmcEK1100.substitutions",0,0,"/home/") epicsEnvShow(ECMC_FILE_EXIST_RETURN_VAL) ECMC_FILE_EXIST_RETURN_VAL=0 ``` +### Use return value of ecmcConfig(OrDie): + +The return value from ecmcConfig(OrDie) is stored in the EPICS environment variable +"ECMC_CONFIG_RETURN_VAL". This value can be used to make som dynamic configuration. +All ASCII configuration commands for ecmcConfig(OrDie) can be used in the same way. + +#### Example: Read firmware version of an EL7037 stepper drive +Note: SDO reads need to be before "SetAppMode(1)" +```text +ecmcConfig "EcReadSdo(${ECMC_SLAVE_NUM},0x100a,0x0,2)" +epicsEnvShow(ECMC_CONFIG_RETURN_VAL) +ECMC_CONFIG_RETURN_VAL=14640 + +``` +The variable "ECMC_CONFIG_RETURN_VAL" then can be used to set record fields, name or alias for instance.. + +### Example: Read "ID" PDO from EK1101 (shown in detail in aliasRecordFromPdoData.script) +Note: PDO reads need to be after "SetAppMode(1)" since cyclic value +```text +ecmcConfig "ReadEcEntryIDString(${ECMC_SLAVE_NUM},"ID")" +## This is the value of the EK1101 ID switch +epicsEnvShow(ECMC_CONFIG_RETURN_VAL) +ECMC_CONFIG_RETURN_VAL=1024 +``` +The variable "ECMC_CONFIG_RETURN_VAL" then can be used to set record fields, name or alias for instance.. + ### Todo Add docs for: * ecmcConfigOrDie diff --git a/hugo/content/manual/knowledgebase/host.md b/hugo/content/manual/knowledgebase/host.md index 86cbc012e..74b57bb4d 100644 --- a/hugo/content/manual/knowledgebase/host.md +++ b/hugo/content/manual/knowledgebase/host.md @@ -10,7 +10,7 @@ chapter = false ### latency issues / lost frames -High latency, more than 10% of the ethercat cycle time, can in worse case result, in lost ethercat frames, which of course is not an ideal situation. High latency of the ecmc_rt thread can be related to: +High latency, more than 30% of the ethercat cycle time, can result in lost ethercat frames, which means data are lost. High latency of the ecmc_rt thread can be related to: 1. The generic device driver is used 2. High load on system 3. ... @@ -61,12 +61,16 @@ epicsThreadSetAffinity ecmc_rt 5 ``` If more than one ecmc ioc is running on the server, then make sure the ecmc_rt threads run on different cores. -Also other threads might take a lot of resources, for instance the epics thread "cbLow": +Further tuning might include moving other cpu intensive threads to dedicated cores, for instance the epics thread ```cbLow```: ``` afterInit "epicsThreadSetAffinity cbLow 6" ``` {{% notice info %}} -cbLow is created at iocInit, therefore the "epicsThreadSetAffinity" must be executed with the "afterInit" command. +```cbLow``` is created at iocInit, therefore the "epicsThreadSetAffinity" must be executed with the "afterInit" command. +{{% /notice %}} + +{{% notice note %}} +The affinity can also be set with the tools accessible in the EPICS module MCoreUtils. {{% /notice %}} ### EtherCAT rate (EC_RATE)