Santa Cruz Low-Cost UAV GNC System (SLUGS) is an open source (hardware and software) UAV autopilot developed at UCSC
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
DataSamples Roepo Organization: organized root directory Feb 11, 2010
FlightData Removed replayFlight.m not needed any more based on the new init file… Jun 9, 2010
GroundStation Added new files for latest hardware revision. Included ORCAD files, P… Aug 31, 2009
HILSim Finished restructuring the configuration files. Flight and Sim models… Apr 23, 2010
InnerOuterLoop Finished restructuring the configuration files. Flight and Sim models… Apr 23, 2010
apConfiguration Finished restructuring the configuration files. Flight and Sim models… Apr 23, 2010
calibration Changes done for dissertation printing Feb 11, 2010
clib Added new files for latest hardware revision. Included ORCAD files, P… Aug 31, 2009
hardware Added the rotation table SolidWorks files. This design was done by Br… Jun 9, 2010
.gitattributes Added a .gitattributes file to force treating Simulink model files as… Mar 2, 2010
.gitignore finished reorganizing the InnerOuter loop directory Apr 22, 2010
LICENSE Added MIT license file to the root of the directory Aug 31, 2009
README.markdown Added repository organization section to the README Mar 4, 2010
SLUGS_Library.mdl Added NAN protection all over the control MCU. Need to chase down the… Aug 10, 2009
controlMCUSlugsMKII.hex Added fully flight tested HEX files. Failure tolerance working. Inner… Aug 11, 2009
controlMCUSlugsMKII.mdl Matched the Simulation and Flight files to be identical. Corrected mi… Apr 23, 2010
mcuInit.m Finished restructuring the configuration files. Flight and Sim models… Apr 23, 2010
sensorMCUSlugsMKII.hex Roepo Organization: organized root directory Feb 11, 2010
sensorMCUSlugsMKII.mdl Roepo Organization: organized root directory Feb 11, 2010


  1. Introduction ===============

The Santa Cruz Low-cost UAV GNC System is a high-end UAV Autopilot that has been developed by the Autonomous Systems Lab at the University of California Santa Cruz. It has been thoroughly tested in flight.

SLUGS Official Website

The SLUGS Autopilot offers the following features:

  • Designed from the ground-up to be easily reprogrammable using Mathworks' Simulink and The Real Time Workshop Embedded Coder.

  • Powered by two dsPICs DSCs; one for sensor fusion and attitude estimation from a rich sensor suite. The other for control and communications tasks, providing enough processing power for complex algorithms.

  • Small enough to fit in a tactical UAV but able to drive up to ten different servos. It also includes a multiplexer to choose between pilot and automatic control

  • Easily go from Simulink simulation to Embedded code. Test your algorithms in Simulink then download them to the Autopilot without any effort.

  • Fast execution time. The main processing cycles are executed at 100Hz. Telemetry reports of attitude and position at 100 Hz and the rest of the messages scheduled at 10 Hz.

  • Fully integrated with Google Earth to allow the Ground Station operator to create flight way points and display the UAV's flight trajectory in 3D.

  • Full featured Ground Station software with graphical displays for all of the UAV telemetry. More than 15 different telemetry sentences to report the full status of the UAV.

  • Complete Hardware-In-the-Loop simulator allows you to test new algorithms directly in the auto pilot without leaving your desk. No more waiting for flying to test new ideas.

  • Very low power allows to run on a typical RC battery for extended time. You can select to power the receiver and MUX from the same battery, or use an additional battery via configuration jumpers.

  • Open. Hardware schematics, layout, and software source code available via a GIT repository with an MIT Open Source License.

  1. Code and Hardware ====================

This section will guide you to get the complete repository to your hard drive. If you don't know what GIT is, you can of course read about it in the Wikipedia. This is a small screencast that was prepared for UCSC's Autonomous Systems Lab.


Using msysgit is the best way to get Git running on Windows. Git is officially supported under Cygwin, but I consider using it this way more of a hack and I also don't want to install all of Cygwin just for this (takes forever mostly). msysgit can be installed by downloading it from here. Make sure you select the plain Git installation, not the portable or msysgit versions. This is currently at version

There are no surprises during the installation save one set of options. In order for msysgit to work properly with Tortoise Git you must select the option to add Git to the system PATH environment variable (this was the middle option in version 1.6.3).

Once you have msysgit running than all you have to do is open a git bash window (right click on the selected folder on the Windows explorer and select git bash here) and then type:

git clone git://

Tar or Zip File

If you only want a copy of the files and are not interested on getting all the benefits of GIT you can go to the github project page and download a zip or tar file of the selected branch by clicking on the download button located in the top right corner.

  1. Requirements ===============

Software Requirements

These are the software requirements to get up and running. Note that if you do not plan on modifying any of the sections you do not need the requirements since we provide binaries for all of the sections. I.E. if you do not want to modify the Ground Station, then you do not need the components listed under that section. Ground Station

  • Borland C++ Builder 6.0 (old version but very reliable. Yes, hard to find)

  • RX Lib for C++ Builder Components (Free)

  • Overbyte ICS UDP Components (Free)

  • Abakus VCL for graphical components (Commercial)

  • Tiny XML for interacting with KML files from Google Earth

  • Simulink Models

  • Matlab 2007A or newer with Simulink, the Real Time Workshop, and the Embedded Coder

  • dsPIC Blockset

  • Schematics and Layout

  • Version 1 of the board is in Eagle 4.0

  • Version 2 of the board in Orcad

  • Microchip dsPIC Software and Hardware

  • C30 Compiler Student Edition (free)

  • PicKit 2 Programmer and Debugger (or any other dsPIC programmer)

Repository Organization

The main Simulink models for each of the DSCs lie in the repository's root directory, they are aptly named ControlMCUSlugsMKII and SensorMCUSlugsMKII. Additionally the repository also includes HEX files of each model.

The root directory also contains an init script (mcuInit.m) and a Simulink Library with the most commonly used blocks (SLUGS_Library.mdl).

There are eight subdirectories, each with its own README file:

  • Calibration: It contains all the m-files to produce the magnetometer and accelerometer calibration numbers based on collected data sets. It also contains the temperature compensation scripts.
  • clib: Contains all the C-files used by Simulink
  • DataSamples: Self explanatory
  • FlightData: It contains a script to analyze the collected data from a telemtry file. It also contains a Simulink model to replay the telemetry file.
  • GroundStation: It contains all the source code of the ground station software.
  • hardware: It contains all the source, PDFs and Gerbers of the hardware.
  • HILSim: It contains the Simulink file used for the HIL Simulator.
  • InnerOuterLoop: It contains the main Simulink file to run software simulation, whic includes a full 6DOF model of the Rascal UAV, the inner and outer loop. It also contains some scripts to analyze the data after every simulation.

It is important to note that the repository includes a .gitattributes file which is used to make Git treat the Simulink model files as binaries (even though they are really text files). This facilitates handling of the MDL files but the tradeoff is that it makes contributions harder.

Sending a Board to Manufacture

Building a Connection Harness

(Comment: Remember to point out that the PIC12 should be preprogrammed. Jonathan Lowert)

Flight Harness

Ground Harness

Understanding the Architecture

How to Contribute

  1. Installing Hardware to the UAV

  2. Software Simulation

  3. Hardware in the Loop Simulation

  4. References