Skip to content

Commit

Permalink
Fix spelling in manual
Browse files Browse the repository at this point in the history
  • Loading branch information
anderssandstrom committed Sep 28, 2024
1 parent 8b3c4ef commit 9758242
Show file tree
Hide file tree
Showing 23 changed files with 143 additions and 143 deletions.
4 changes: 2 additions & 2 deletions hugo/content/manual/PLC_cfg/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}}
Expand Down Expand Up @@ -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 %}}
Expand Down
12 changes: 6 additions & 6 deletions hugo/content/manual/PLC_cfg/best_practice.md
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -27,7 +27,7 @@ In addition to the custom macros, a few macros, that are often needed, are prede
4. M : ec<M\_ID>

#### 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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions hugo/content/manual/PLC_cfg/function_libs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <name>(<param1>,...,<param5>) {
<code body>;
Expand All @@ -38,9 +38,9 @@ function <name>() {

* 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
Expand Down Expand Up @@ -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 %}}
16 changes: 8 additions & 8 deletions hugo/content/manual/PLC_cfg/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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('` !
Expand Down Expand Up @@ -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
# }
Expand Down Expand Up @@ -215,14 +215,14 @@ Custom plc functions can be written in c in plugins.
```shell
# 1. plc<id>.enable plc enable (rw)
# (end exe with "plc<id>.enable:=0#"
# Could be usefull for startup
# Could be use full for startup
# sequences)
# 2. plc<id>.error plc error (rw)
# Will be forwarded to user as
# controller error.
# 3. plc<id>.scantime plc sample time in seconds (ro)
# 4. plc<id>.firstscan true during first plc scan only (ro)
# usefull for initiations of variables
# use full for initiations of variables
# 5. ax<id>.plc.enable Same as plc<id>.enable but for
# axis <id> sync plc.
# 6. ax<id>.plc.error Same as plc<id>.error but for
Expand Down Expand Up @@ -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})
#
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/manual/general_cfg/best_practice.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
8 changes: 4 additions & 4 deletions hugo/content/manual/general_cfg/data_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions hugo/content/manual/general_cfg/iocsh_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
* ...
Expand Down
4 changes: 2 additions & 2 deletions hugo/content/manual/general_cfg/startup/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
```

Expand Down
2 changes: 1 addition & 1 deletion hugo/content/manual/knowledgebase/ethercatCLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <nameOfNetworkDevice> 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.
Expand Down
18 changes: 9 additions & 9 deletions hugo/content/manual/knowledgebase/hardware/EL5042.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
```
Expand All @@ -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"
```

Expand All @@ -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"
```

Expand Down
Loading

0 comments on commit 9758242

Please sign in to comment.