Operation manual: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
No edit summary
No edit summary
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
Back to: [[PITON steerable needle]]
''All models and source code can be found in '' '''/home/PITON/'''.
== Start Ubuntu ==
== Start Ubuntu ==


Line 5: Line 10:
# Choose the default Linux Kernel
# Choose the default Linux Kernel
# Log in as ''PITONuser'' with password ''PIT2011''
# Log in as ''PITONuser'' with password ''PIT2011''


== Start MATLAB ==
== Start MATLAB ==
Line 12: Line 18:




== Choose a Simulink model ==
== Simulink models ==
 
 
=== Targets ===
 
Two different targets are used in the following models.
 
 
'''Generic Realtime Target''' (grt)
* Target is not Realtime, although its name suggests otherwise
* Cannot be used to control the ethercat stack
* All blocks within a scheme run at the same rate
* Can be used with external mode
 
 
'''Multi Threaded Target''' (mtt)
* Target is Realtime
* Can be used to control the ethercat stack
* Parts of the scheme can run at 1/''n'' times the basic rate, ''n'' must be an integer
* Cannot be used with external mode
 
 
=== Models ===
 
'''fireCamCalibration/fireCamCalibrationModel.mdl''' - can be used to position the camera with respect to the needle and to determine appropriate settings.
* Run it with external mode to view the camera images.
* The red container marks the Region Of Interest (ROI).
* Position the camera and shape the ROI such that the all markers stay within the ROI during the experiments.
 
 
'''src/PITONlib.mdl''' - contains library blocks. This model is not meant to be run as is, it is just a container for the blocks. More information about the different blocks is embedded in their masks. Double click on the blocks to view the info.
* Vision
** Image acquisition from the camera
** Shape detection from the obtained images
* Motion
** Linear motor
** Conversion from force to voltage
* Tools
** Save signals to a .dat file
** Butterworth filter
 
 
'''template/PITONtmpl.mdl''' - a working template to use as a starting point for custom experiments. Copy it to another location before building and running it.
* uses the MTT target
* vision running at 25Hz
* motion running at 1000Hz
 
 
== Running an experiment ==
 
 
=== General directions ===
 
# Build the Simulink model using ctrl+b (only necessary when changes are made or when directed to do so by MATLAB). Ensure that the working directory of MATLAB is the directory containing the model.
# Ensure the ''motor enable'' power switch is switched on, it must be turned to the right
# Open a terminal
# ''In terminal:'' Enable super user privileges by typing <tt>sudo su</tt> and using password ''PIT2011''
# ''In terminal:'' Navigate to the directory containing the Simulink model
# ''In terminal:'' Run <tt>./modelname</tt>
 
'''Hold your hand at the ''motor enable'' power switch to use it as an emergency switch if needed.'''
 
 
=== Grt specific ===
* When running <tt>./modelname</tt> in a terminal, add <tt>-w</tt> to start simulation from Simulink.
* When running <tt>./modelname</tt> in a terminal, add <tt>-tf inf</tt> to discard the simulation end time and run the simulation forever.
* When using external mode, ensure MATLAB's working directory is the directory containing the Simulink model
 
 
== Setup the motor drive ==


'''PITONlib.mdl''' - contains library blocks
Motor safety settings and other motor drive settings can be set by the program EasySetup. Ensure that the motor drive is connected to the PC by a serial cable.
## vision
* The program can be started by pointing to ''Applications -> Wine -> Programs -> EasySetUp -> EasySetUp''.
## motor
* The status bar at the bottom depicts whether the motor is ''online'' or ''offline''.
* Press the ''Upload from Drive/Motor'' button to load the current motor drive settings.
* To apply the settings to the motor, press the ''Download to Drive/Motor'' button.

Latest revision as of 09:22, 28 October 2011

Back to: PITON steerable needle

All models and source code can be found in /home/PITON/.


Start Ubuntu

  1. Switch on the setup with the power button on the power socket
  2. Start the computer
  3. Choose the default Linux Kernel
  4. Log in as PITONuser with password PIT2011


Start MATLAB

  1. Open a terminal.
  2. Type sudo matlab with password PIT2011


Simulink models

Targets

Two different targets are used in the following models.


Generic Realtime Target (grt)

  • Target is not Realtime, although its name suggests otherwise
  • Cannot be used to control the ethercat stack
  • All blocks within a scheme run at the same rate
  • Can be used with external mode


Multi Threaded Target (mtt)

  • Target is Realtime
  • Can be used to control the ethercat stack
  • Parts of the scheme can run at 1/n times the basic rate, n must be an integer
  • Cannot be used with external mode


Models

fireCamCalibration/fireCamCalibrationModel.mdl - can be used to position the camera with respect to the needle and to determine appropriate settings.

  • Run it with external mode to view the camera images.
  • The red container marks the Region Of Interest (ROI).
  • Position the camera and shape the ROI such that the all markers stay within the ROI during the experiments.


src/PITONlib.mdl - contains library blocks. This model is not meant to be run as is, it is just a container for the blocks. More information about the different blocks is embedded in their masks. Double click on the blocks to view the info.

  • Vision
    • Image acquisition from the camera
    • Shape detection from the obtained images
  • Motion
    • Linear motor
    • Conversion from force to voltage
  • Tools
    • Save signals to a .dat file
    • Butterworth filter


template/PITONtmpl.mdl - a working template to use as a starting point for custom experiments. Copy it to another location before building and running it.

  • uses the MTT target
  • vision running at 25Hz
  • motion running at 1000Hz


Running an experiment

General directions

  1. Build the Simulink model using ctrl+b (only necessary when changes are made or when directed to do so by MATLAB). Ensure that the working directory of MATLAB is the directory containing the model.
  2. Ensure the motor enable power switch is switched on, it must be turned to the right
  3. Open a terminal
  4. In terminal: Enable super user privileges by typing sudo su and using password PIT2011
  5. In terminal: Navigate to the directory containing the Simulink model
  6. In terminal: Run ./modelname

Hold your hand at the motor enable power switch to use it as an emergency switch if needed.


Grt specific

  • When running ./modelname in a terminal, add -w to start simulation from Simulink.
  • When running ./modelname in a terminal, add -tf inf to discard the simulation end time and run the simulation forever.
  • When using external mode, ensure MATLAB's working directory is the directory containing the Simulink model


Setup the motor drive

Motor safety settings and other motor drive settings can be set by the program EasySetup. Ensure that the motor drive is connected to the PC by a serial cable.

  • The program can be started by pointing to Applications -> Wine -> Programs -> EasySetUp -> EasySetUp.
  • The status bar at the bottom depicts whether the motor is online or offline.
  • Press the Upload from Drive/Motor button to load the current motor drive settings.
  • To apply the settings to the motor, press the Download to Drive/Motor button.