diff --git a/Orocos-Configuration.md b/Orocos-Configuration.md index 07abdf2..096e451 100644 --- a/Orocos-Configuration.md +++ b/Orocos-Configuration.md @@ -1,8 +1,9 @@ Orocos needs to be configured to your hardware, this involves: 1. Loading the correct kernel modules for hardware drivers -2. Identifying the device number that Comedi is assigning to each card -3. Set the correct device number in the Orocos start.ops file +2. Identifying (or verifying) the device numbers that Comedi is assigning to each card +3. Set the correct device numbers in the Orocos start.ops file +4. Load and use the correct hardware drivers in the Orocos start.ops file ## Kernel Driver Modules @@ -111,7 +112,7 @@ This corresponds to a PolLux configuration with: If you have multiple cards using the same driver, then it can be a bit complicated to figure out which is which. As a rule, Comedi will tend to assign a smaller device number to the card with the higher PCI address. -## Editing start.ops +## Setting Device Numbers In start.ops The device numbers must be assigned correctly in the `start.ops` file used to configure Orocos. The first section of the `start.ops` file for PolLux looks like: @@ -156,7 +157,7 @@ AO1.deviceNr=2 DO1.deviceNr=2 DI1.deviceNr=2 ``` -These assignments must be declared before the corresponding devices are configured with a command like `Sensor1.configure()`. +These assignments must be declared after the corresponding device names are defined with `loadComponent` and after they are configured with a command like `Sensor1.configure()`. **WARNING** : There are currently some inconsistencies in the device number variable names and whether the "configure" and "start" functions use parentheses. The plan is to standardise on "deviceNr" and "configure()" @@ -167,3 +168,25 @@ These assignments must be declared before the corresponding devices are configur | AnalogOutputComedi | device_nr | configure(); start() | | DigitalOutputComedi | device_nr | configure(); start() | | DigitalInputComedi | deviceNr | configure; start | + +## Configuring start.ops + +The `start.ops` file tells Orocos how to define devices and how signals are interconnected. Note that the feedback loops are "PID0" for the X-axis, "PID1" for the Y-axis and "PID2" for the Z-axis. + +It is probably best to start with the file configured for PolLux ([PixelatorRealtime/startup/PolLux/start.ops](https://gitlab.psi.ch/microspectro/pixelator/-/blob/master/PixelatorRealtime/startup/PolLux/start.ops)) and adapting to your instrument. There are three things that might make PolLux different from your system: +1. The device numbers. +2. The interferometer module(s). +3. The number of interferometer axes being used. + +### Device Numbers +Currently, the device numbers at PolLux match the hard-coded defaults and so no device numbers are set. The section above discusses how to set the appropriate device numbers in `start.ops`. + +### Interferometer Module(s) and Axes +An interferometer module is first imported (`import()`) and then loaded and assigned a name (`loadComponent()`). PolLux uses an Agilent interferometer for the X- and Y-axes, and an Attocube interferometer for the Z-axis. You should only import the module(s) that you need for the interferometer type(s) used in your instrument. If you only have one interferometer type, then you should delete one of the `import()` commands and one of the 'loadComponent()` commands so that the remaining commands refer to the interferometer module that you want to use. Further, ensure that the `loadComponent()` command uses the name (first argument) "Sensor1". Next, you will need to modify or delete a bunch of commands, depending on whether you have a Z-axis interferometer. + +### Two Interferometer Axes (of same type) +If you have only X- and Y-axis interferometers, you can delete all commands (the full line) that include either "Sensor2" or "PID2" (or both). + +### Three Interferometer Axes (of same type) +If you have X-, Y- and Z-axis interferometers, you should first look at every `connect()` command and change any instance of "Sensor2.*Output_0" (where * is either "position" or "status") in that command to "Sensor1.*Output_2". After doing this throughout the file, you should delete any command (the full line) that still contains "Sensor2". +