RSS YouTube LinkedIn Twitter Facebook


Basic Motor Control (Stepper, DC)

by richardf80, phalt1003

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


You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! hair loss protocol vitamins
This blog is really great. The information here will surely be of some help to me. Thanks!.
hello!! Very interesting discussion glad that I came across such informative post. Keep up the good work friend. Glad to be part of your net community.

It’s really a nice and helpful piece of info. I’m glad that you just shared this helpful info with us. Please keep us informed like this. Thanks for sharing. verzekeringen bedrijf

I found this is an informative and interesting post so i think so it is very useful and knowledgeable. I would like to thank you for the efforts you have made in writing this article. tips on talking dirty in the bedroom
This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.
Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know.

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