The mechatronic lab at Universidad Nacional de Colombia has a Stewart Gough platform, a six Degrees Of Freedom parallel manipulator powered by lineal actuators. This repo contains the legacy system used to control this robot.
-
MATLAB: Install an old version of MATLAB that supports XPCTarget toolbox is required. MATLAB R2011a is recommended 1.
-
xPC Target: Install XPCTarget toolbox version 5.0.
-
C++ compiler: Install C++ compiler compatible with XPC. Getting it by installing visual studio is recommended.
xpcgetCC('supported')
Testing with various Microsoft compilers, we found that some versions of Microsoft Visual C++ are not recognized by MATLAB and are difficult to find. Therefore, the Open Watcom compiler is recommended.
Note: Download the version specified by MATLAB (in R2011a, Open Watcom version 1.8).
Once the required programs are installed. Get a copy of this repo and set up the custom libraries located in the ext folder.
- Copy the folder thirdpartydrivers folder into the XPC toolbox folder located at matlabroot. Then write the command
rehash toolbox
to update the files MATLAB toolbox is referencing.driverSource = 'libs\thirdpartydrivers'; driverDestination = strcat(matlabroot,'\toolbox\rtw\targets\xpc\target\build\xpcblocks\thirdpartydrivers') copyfile(driverSource, driverDestination) rehash toolbox
Run MATLAB as administrator if matlabroot is a protected folder (error "No matching files were found.").
- Add to MATLAB's search path the Simulink's custom Stewart Gough library
savepath('libs\Stewart_Gough_library') savepath('libs\Stewart_Gough_library\Trajectories') savepath('libs\Stewart_Gough_library\Functions')
Run xpcsetCC('setup')
to choose from list of valid compilers and xpcgetCC('installed')
to check the available compilers.
The file quickReferenceCommand is a MATLAB script that contains useful commands for setting up the environment.
mode: controls de mode of operation of the model
- 0: disable PWM
- 1: Pose control
- 2: Actuator distance control
- 3: manually set PWM signal control
block reference
-
MM-16-AT Analog Input : addiamondmm16atcustom
-
SG-ADC Sensors: wrapper of MM-16-AT Analog Input. reordering ports and filtering and scaling.
-
Motors-F4 STM - PWM
- Baseboard Serial
- fiforead from xpc target library
- sertxenablebase from xpc target library
Signal PWM
name s2 - s7
If Action Subsystem6/Referece/From File1/s2
Signal input distance/current direct without wrapper
name p1 - p12
SG-ADC Sensors/MM-16-AT Analog Input/p1
Start by performing proportional control. the linear actuator have a range of 30 cm and the PWM goes from -100 to 100. As a starting point a controller with kP=3 and input signal in centimeters. When there is maximum error 30 cm the PWM signal goes to 90. There is the possibility to increase kP as see fit by testing.
100=Ki*(30n) and n=t/Ts therefore Ki=(100Ts)/(30*t) where Ts=0.01 and a stimated t=3 that results in Ki=0.01
mex addiamondmm16atcustom.c
mex dadiamondmm16at_custom.c
mex dodiamond16at_custom.c
In order to better understand the operation of the platform and have the parts modeled in an open source CAD program, the model was made in OnShape, a Software-as-a-Service (SaaS) product development platform that combines CAD, built-in data management, real-time collaboration tools, and business analytics9.
This model was built based on the design plans of Francisco Villate and the models found in the catalogs of commercial parts.
The previos diagram the relation between the subsystems and their interaction in the control loop.
Component type | Generic | Custom made |
---|---|---|
Electronic |
|
|
Mechanical |
|
|
Software |
|
|
- Daniel Andres Ramirez Rodriguez
- Edgar Bolivar
- Francisco Javier Villate Gaona
- Luis Miguel Mendez - Academic supervisor
- Jorge Sofrony - Academic supervisor
- Juan David Muñoz
- Juan Diego Galeano
- Ubaldo Gracia Zaragoza
- Juan David Ramirez
- Jorge Andrés Acero - Laboratory Technician
- DIMAUN (Grupo de Trabajo en Nuevas Tecnologías Diseño, Manufactura y Automatización)
- Alexandra - Laboratory Technician
- Jorge Andrés Acero - Laboratory Technician
- Alvaro William Roa Gutierrez- Laboratory Technician