
Distributed Manipulation using Disctrete Actuator Arrays 
J.E. Luntz University of Michigan W. Messner and H. Choset Carnegie Mellon University 
Multimedia extension #3: Closedloop simulator and results 

The closedloop simulator is
built around the openloop simulator with three major modifications: 

• The current object
position and orientation are fed back and used to compute desire force
and moment 
• The wheel velocity
field is no longer static: it changes in response to the object feedback

• The constants
of motion are computed at every time step since the wheel speeds change
continually 

This page contains: 

• A desctiption of the simulink model 
• Instructions on how to download and run the model 
• Sample output data You can run these in Matlab without Simulink. 
Model Description 
The highlevel closedloop model is shown in Figure 1. Simulink represents models as block diagrams where directed arrows represent the flow of timevarying scalar (thin lines) or vector (thick lines) signals. Each block represents a function which operates on the signal. 
Starting from left to right, the current position and orientation (Xc and theta) are compared to the desired position and orientation (Xeq and thetaeq) to create the position and angle error signals, each of which is multiplied by a proportional gain. The position error feeds into the "transfield" block which computes the wheel speeds for the uniform field (Equation 53 in the text). The angle error, along with the current object position feeds into the "rotfield" block which computes a rotational field based either on the computed rotation field (Equation 59 in the text) or the kinematic rotational field (Equation 65 in the text). The rotational field needs the current object position since the field is always centered on the object. The translational and rotaational fields are then added together and fed, along with the mask vector (the current set of supports), to the "Calculate Constants" block. The resulting constants of motion are then fed into the "Integration of Object Dynamics" block which outputs the current position and orientation. 

The details of the "Integration Of Object Dynamics" block are identical to the same block in the openloop simulator. The details of the "Calculate Constants" block are shown in Figure 2. The mask vector and the field vector (formed from stacking the xvelocities on top of the yvelocities) feed into the function "recalcconstsCL" (which executes from the file "recalcconsts.m"). 
Figure 2:
Details of the "Recalculate Constants" block. 
Running the Model 
The following files are required to run the model: 
• simclosedloop.mdl 
• setupsimclosedloop.m 
• isinbox.m 
• recalcconstsCL.m 
• calctransfield.m 
Also, at least one of the following is required to compute a rotational velocity field (the first is the default, but you should download them both). 
• calcrotfieldfield.m 
• calckinematicrotfield.m 
Finally, the following files are useful for viewing the simulation results and the results of saved sample simulations. 
• animateCL.m 
• makeplotCL.m 
Download the files into a local directory either by rightclicking on each of the links above or by downloading and uncompressing one of the following file which contains all the open and closedloop simulation files and sample runs. 
• simfiles.zip 
• simfiles.tar.gz 
To run the model, start matlab and change to the directory in which you saved the files. To open the model, type, at the Matlab prompt: 
simclosedloop 
This will open the main model window (Figure 1). To run the model, you first must run the startup script "setupsimclosedloop.m" which defines the positions of the cells, the size, weight, and initial conditions of the object, the coefficient of friction, the feedback gains, the length of simulation, etc. Note that you can edit this file to change these parameters (see the comments in the file for instructions). To run the script, type, at the Matlab prompt: 
setupsimclosedloop 
Once this script is run, you can start the simulation by selecting "Start" of the "Simulation" menu in the main simulation window or by typing Controlt in the main simulation window. After a few seconds, Simulink will beep when the simulation finishes. 
You can change which of the two rotational fields are used in the simulation. To do so, doubleclick on the "rotfield" block in the main simulation window and enter either calcrotfield(u) (for the computed rotational field or calckinematicrotfield(u) (for the kinematic rotational field). 
Simulink saves signals from the simulation as Matlab variables for plotting and animation after the simulation runs. The position of the center of mass of the object is stored in the twocolumn variable Xc, the orientation of the object is stored in the onecolumn variable theta, the mask vector is stored in the ncolumn variable masks (where n is the number of cells), and the wheelvelocity field over time is stored in the 2ncolumn variable fields (with xvelocities in the first n columns and yvelocities in the second ncolumns). In addition, the times at which these variables are stored are stored in the onecolumn variable t. 
The script "animateCL.m" uses these stored variables to display a pseudorealtime (assuming you computer is fast enough) animation of the recorded motion of the object (one frome of which is shown in Figure 3. To view this animation, type, at the Matlab plot: 
animate 
Figure 3: Final result of the "animateCL.m" script. 
The script "makeplotCL.m" uses the stored variables to make static plots of the progression of the object. Both "overhead" (Figure 4) and position and orientation vs. time plots (Figure 5)are made. To view these plots, type, at the Matlab plot: 
makeplotCL 
Figure 4: Overhead plot from
the "makeplotCL.m" script. 

Sample Simulation Runs 
The results of a simulation can be saved by saving the relevant variables from the Matlab variable environment. To do this, type, at the Matlab prompt: 
save foo Lx Ly X Xc masks fields t theta 
The variables will be stored in the file name "foo.mat". 
To load a set of saved variables from the file "foo.mat", type, at the Matlab prompt: 
load foo 
The variable saved in "foo.mat" will be loaded into the Matlab workspace. At this point, you can run the "animateCL.m" and "makeplotCL.m" scripts as described above. The following two stored runs are provided with this appendix: 
• closedloopcomputed.mat: This is the computed rotational field example from the paper. The translational gains are each 1, and the rotational gain is .1. 
• closedloopkinematic.mat: This is the kinematic rotational field example from the paper. The translational gains are each 1, and the rotational gain is 4. 
Return to Contents 