RSS YouTube LinkedIn Twitter Facebook


Basic Motor Control (Stepper, DC)

by richardf90, phalt1003

  • Status: Under development
  • Downloads: See External Download
  • Licence: Custom Licence
  • Last updated: 21/Oct/2011 at 02:09 PM

Version 0.1

Size: Unknown

View older versions

Project Overview

Examples to provide basic motor control functionality. Current features include: Stepper:
  • Microstepping (Full step to 1/256 microsteps)
  • Basic current limiting, to allow driving motors at higher than their rated voltage
  • Current monitoring in motor windings using the ADC
DC Motor:
  • Velocity ramping
  • PWM speed control using the sc_pwm component available on github
  • Quadrature encoder feedback
  • PID control loop for constant speed control
Bugs are still being fixed and features being added. Update 21/10/2011- PHALT: We've made some demonstration videos for this project as it was completed in the XMOS office, enjoy!


Verified to run on


Images and diagrams

Rate this project

Average: 5 (2 votes)
Your rating: None
Login or register to vote

Comments / Updates


Hi! Phalt:
Nice to get your message.
I am an engineer. I work for Quadrep Taiwan which agent XMOS's production in Taiwan.
We have a project for step motor appliance in CAM's motor (auto focus control). By the way, we get the motor SDK from XMOS in Taiwan.
At before, we got the training from Larry Snizek on September in Taipei. For development reason, I join the xcore's forum.
And search the sample code for DC and step motor. After I down load the sample code. I found some problems for the project files when I use XDE (Ver11.2.2).
I know that the zip files are not include these head and xc files that I had told. I had tried to update these files by the file server.
However, the compiler still has the error for "architecture does not support selecting with `__builtin_inct_byref'"
in line140 (adc_7265.xc)
case (int trig=0; trig

Sorry for a question for motor control appliance.
I had download the reference files "".
However, the source file are not include "watchdog.h", "pwm_singlebit_port.h", and "adc_7265.h"
For this compiler error issue, I add on the old version with "".
But it's still error for "case inct_byref(c_trig, ct):". I think that it's the problems for "architecture does not support selecting with `__builtin_inct_byref'".
How can I do, if I want to fix the problems?

oogely boogely