linearstage
class. linearcontroller
. One more linearstages
can be attached to each linearcontroller
.linearstage
class declares the methods and properties used to control an abstract linear motion device. The linearstage
class can not be instantiated. Methods are defined in concrete classes (which can be instantiated) that inherit linearstage
. Whilst it is not necessary for MATLAB classes to be designed this way, the linearstage class serves as a useful starting point for users wishing to write new concrete classes to control custom hardware. To aid this, linearstage
contains extensive comments describing the assumed behavior of each abstract method it declares.linearstage
is mainly in charge of defining the physical properties of the motion. e.g.linearcontroller
must perform these actions on some physical device. It performs these actions on one or more linearstage
stage objects with which it is associated. The linearcontroller
contains an attachedStage
property. To this we attach one stage object. Say a single physical controller handles both the X an Y stages. We would attach it twice: BT.xAxis
and BT.yAxis
. Each will have a different stage. The author of the linearcontroller
for this stage type is responsible for having the controller read which stage it's attached to and send the correct command out.BakingTray
MATLAB creates an instance of the object BT
. This is what the line hBT = BT(BTargs{:});
does in the the BakingTray.m
file. In the constructor of BT
you will see obj.componentSettings=BakingTray.settings.readComponentSettings;
where we extract the settings for the hardware. This are read from the componentSettings.m
file in the SETTINGS
directory (For more information on this file see here. A little further down in the constructor you will see that the method attachMotionAxes
is used to build control classes based on the provided settings. This is done via the buidlMotionComponent
function in code\components\motion
.build_C891_stages
sub-function in buildMotionComponent
.