Operation manual: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
Line 58: Line 58:
== Running an experiment ==
== Running an experiment ==


# Build the Simulink model using ctrl+b
# Build the Simulink model using ctrl+b (only necessary when changes are made or when directed to do so by MATLAB)
# Ensure the motor power is switched on, the power switch must be turned to the right
# Ensure the ''motor enable'' power switch is switched on, it must be turned to the right
# Open a terminal
# Open a terminal
# Enable super user privileges by typing <tt>sudo su</tt> and using password ''PIT2011''
# Enable super user privileges by typing <tt>sudo su</tt> and using password ''PIT2011''
# Run <tt>./modelname</tt> in the terminal
# Run <tt>./modelname</tt> in the terminal
'''Use the ''motor enable'' power switch as an emergency switch'''
=== 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.
=== mtt specific ===

Revision as of 14:43, 25 October 2011

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

camCalibrate.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.


PITONlib.mdl - contains library blocks. This model is not meant to be run as is, it is just a container for the blocks.

  • vision
  • motor
  • data storage


PITONtmpl.mdl - a template to use as a starting point for custom experiments

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


PITONexp1.mdl - an example experiment

Running an experiment

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


Use the motor enable power switch as an emergency switch


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.


mtt specific