Step-by-step: Multi-axis speed and position control

Other Parts Discussed in Post: DRV8301

Guest post by Adam Reynolds, Application Engineer, LineStream technologies


Have you wondered how to design real-time velocity and position control applications? In this blog post, we’re going to show you, step by step, how to achieve optimal dual-axis speed and position control on a bench-top router (Figure 1) using the TI C2000™ Piccolo™ F2806x InstaSPIN-MOTION™ LaunchPad development kit.


Figure 1. 15"x15" bench-top router

In less than 20 hours, the router was drawing squares, triangles and circles.


Project Timeline


2 hours

Received CNC router table


4 hours

Connected servo motors to X & Y stages

Used InstaSPIN-MOTION software to:

  • identify inertia
  • tune speed and position loops,
  • optimize acceleration and jerk


6 hours

Create a square Motion Profile


6 hours

  • Create a triangular Motion Profile
  • Create a circular Motion Profile

Figure 2. Timetable for bench-top router to create motion profiles

Step 1 – Connect servo motors to the X and Y stages

If you’re working on a multi-axis application, you’ll need to design your own board. We took a preliminary step using two TI InstaSPIN-MOTION LaunchPad development kits. The LaunchPad includes hardware to interface to two BoosterPacks which can each control a motor, but the software framework to do so is still being finalized and will be released in a future version of MotorWare™ software.


Material List:


We used the InstaSPIN-MOTION Position Plan Component to create and execute the state transitions for the X and Y axes. When using two LaunchPad development kits, the Position Plans communicates over GPIO, which introduces a small amount of delay. When you design your own board, you’ll still run two Plan components, but they will communicate through variables rather than over GPIO, which will produce a more precise start.   In addition, you will be able to control both axes from a single TI C2000 Piccolo TMS320F28069M microcontroller, which is quite a cost savings.


Step 2 – Identify the system inertia of each axis

Inertia includes anything that is rigidly coupled to the motor shaft. It includes anything that moves directly with the motor. For the CNC Router, the X axis has different and independent inertia than Y axis.

We used the InstaSPIN-MOTION Velocity Identify component to identify the inertia. We set each stage so that it had the entire range of positive motion because the inertia identification always rotates the motor in positive direction. We then used the InstaSPIN-MOTION MotorWare Lab 12a software, which identified both the inertia and the friction. The inertia value is an input to the InstaSPIN-MOTION position controller, which uses it to provide the appropriate torque to get the application moving.

Here’s a quick video of the Inertia identification process for the X axis. It moves fast, so watch closely!


Step 3 – Tune the controller

Speed and position are tuned at the same time, using a single gain called bandwidth. Each axis is tuned independently. The tuning process is simple and straightforward. Using MotorWare Lab 13a software, we adjusted the bandwidth, injected a disturbance and evaluated the position hold. This process was repeated until the axis demonstrated good holding position at 0 speed when the system was disturbed. We set the initial bandwidth to 10 rad/s, and then manually injected a disturbance. The arm moved easily at this setting. As we increased the bandwidth, it became more difficult to move the axis. At 40 rad/s, the router table’s X axis was holding the position really well.

Here’s a video of the tuning process.


Step 4 – Optimize acceleration and jerk

We then set out to optimize acceleration and jerk (jerk is the rate of change of acceleration). The trapezoidal curve was used to optimize acceleration because this curve ignores jerk. Each axis was commanded to move back and forth while the acceleration was slowly increased. Optimal acceleration occurs just prior to the point when the motor fails to reach the commanded value.

 Once we found the optimal acceleration, we then optimized the jerk, using the st-curve, which features continuous jerk. The jerk was adjusted so that the router exhibited smooth starts and stops with a very high degree of reliability.


Step 5 – Create a square motion profile

It’s pretty easy to make the router draw a square – only one axis moves at a time. A Position Plan was created for each axis. In our configuration, the X axis was the master. The X axis plan signaled the Y axis to start moving. The Y axis plan signaled X when its move was complete.

X Axis Position Plan:

  1. Signal GO to Y
  2. Transition States
  3. Wait for DONE from Y
  4. Signal GO to Y


Y Axis Position Plan:

  1. Wait for GO from X
  2. Transition States
  3. Signal DONE to X
  4. Wait for GO from X


Figure 3. Creating a square motion profile


Step 6 – Create a triangular motion profile

Drawing a triangle was more difficult. The X and Y axes had to be coordinated to draw the sloping sides. A few calculations were required to generate the motion plan for each axis, using the equation:

 Vel = dposition_step/t


Vel = velocity

d = distance

t = time


Each axis was required to complete the move at the same time, therefore:



The travel distance (dposition_step) was known. By fixing the velocity for the X axis, this gave us a known time (tx) and from there we were able to calculate the velocity of the Y axis (Vely).


Figure 4. Creating a triangular motion profile


Step 7 – Create a circular motion profile

The circular motion profile is the most complex of the three shapes. We cheated a little bit on this one. The actual shape is a 32-sided polygon. It approximates a circle but is less computationally intensive. We used Matlab to calculate the X and Y axis positions. From there, we used the same procedure used in the triangle motion profile to ensure that each X and Y movement ended at the same time.

Figure 5. Creating a circular motion profile

Watch a video of the finished project.

The InstaSPIN-MOTION LaunchPad

The InstaSPIN-MOTION LaunchPad has a 90-MHz C2000 Piccolo F28069M MCU, an emulator and the InstaSPIN-MOTION software all in one package. You can use it to develop sensorless or sensored motor control applications. It also comes with hardware design package including gerbers, schematics and a bill of materials. It features MotorWare example software that has everything needed to get your motor running.

 Perhaps the best part is the price. The LaunchPad is only MSRP $25 USD from the TI Store and authorized distributors. It can connect with most of the BoosterPacks, including the DRV8301 Motor Drive BoosterPack featuring a 240W 3- phase inverter, which is available for $49.

 Be sure to post a description of your LaunchPad projects below. I can’t wait to hear about the cool applications that you can develop with this tool!

  • Hello, 

    I use the same kit (with instaspinuniversalgui_v105) and as it doesn't work correctly with InstaSPIN-MOTION I started looking at the TI documentation. Did I miss something in relation to the TI documentation below (the attached figure) ? Or is the remark correct and it clearly indicates not to use what was explained in this article above ? Or maybe I don't have the right version of InstaSPIN-MOTION ?


  • Hello, 

    I use the same kit (with instaspinuniversalgui_v105) and as it doesn't work correctly with InstaSPIN-MOTION I started looking at the TI documentation. Did I miss something in relation to the TI documentation below (the attached figure) ? Or is the remark correct and it clearly indicates not to use what was explained in this article above ? Or maybe I don't have the right version of InstaSPIN-MOTION ?


  • first, this article is 7 years old

    second, what your image says is that the InstaSPIN-FOC and InstaSPIN-MOTION GUI uses a fixed binary .out and specifically only works with one 69MISO controlCARD and 3 different inverter kits. That is correct.

    The MotorWare Universal GUI works with any of the projects, any of the kits.

    MotorWare supports F2806x, 05x, and 02x MCU for InstaSPIN

    C2000Ware-MotorControl-SDK supports devices since then like F28004x, F28002x, and F28003x series of MCUs.

    suggest you ask any further questions on the C2000 MCU 

  • Hello,

    Sorry to ask about an article that is now more than 7 years old, and I understand that at the time we didn't have enough background on the Soft. My question is asked in the sense of seeking the solution to my issue and to enlighten the community that may have opinions and/or experience feedback.

    I agree that MotorWare works on this kit too and for that matter on the others you mentioned. My problem is different, it's with InstaSPIN-MOTION which is mentioned in the article (and by the way it's good that it was designed as a frozen binary project) :

    Just for information, although the article dates from 2015, and since it is still available on the net it was one of my references when I wanted to use InstaSPIN-MOTION for parameter estimation with this kit.


  • The InstaSPIN-MOTION GUI you show a picture of does not work with the LAUNCHXL-F28069M

    This GUI was made before the LaunchPad was created. The GUI is fixed and only works with the other kits noted.

    There is a Universal GUI included in MotorWare that works with the LAUNCHXL-F28069M.  But it does not have all of the features/interface of the InstaSPIN-MOTION GUI.