Overview
This document provides a basic description of a motion control system using an NI CompactRIO and details how the Waterloo Labs engineers built their system.
Method
In order to remotely control Wendy, the featured car in Waterloo Labs’ “Drive a Car with an iPhone” video, the team used a motion control system mounted in the car. This document discusses the basics behind a motion control system and how it was accomplished by the Waterloo Labs team.
At the most basic level, a motion control system consists of three components: a controller, motor drive, and motor. The controller is the interface between the user/software and the drive. It interprets commands as we know them (e.g. move forward 100 steps) to signals recognized by the motor drive. The drive takes a signal from the controller and outputs a higher powered signal that is capable of driving the motor. The last component of course is the motor. It uses the signal from the drive to power an electromagnet that causes movement of the shaft in a linear or rotational manner.
The Waterloo Labs team implemented their motion control system with an NI 9403 Digital I/O Module placed in an NI cRIO-9074 controller, three Jaguar motor drives, and three brushed DC servo motors.
The NI cRIO-9074 controller receives commands over a wireless network from the iPhone. It then generates a pulse-width modulated (PWM) signal using the onboard FPGA and outputs the signal on the NI 9403. The FPGA is used because the PWM signal needs to have relatively short pulses that would be difficult to generate using software timing. Since traditional hardware timing is not available on the NI 9403, FPGA is the best option for generating this signal. The cRIO chassis and integrated controller used in the car can be seen in Figure 1.

Figure 1: NI cRIO-9074 controller with an NI 9403 Digital I/O Module
From the controller, the PWM signal passes through the Digital Sidecar on its way to the three Jaguar motor drives. The Digital Sidecar is a basic board that breaks out signals from the 37 pin connector of the NI 9403 to standard RC servo connectors. The Jaguar motor drives then uses the PWM signals to vary the current they output to the servo motors causing changes in speed and direction.
The three motors are connected to the steering wheel, accelerator, and brake pedals in such a way as to provide responsive control of the vehicle. This setup is shown in Figure 2. All three are brushed DC servo motors that previously served as the power window motors from the car. While other types of motors exist (e.g. stepper and brushless servo), the power window motors met the needs of the application and were already available to the team.

Figure 2: Brushed DC servo motor controlling accelerator
Related Links
Products and Services: NI cRIO-9074
Products and Services: NI 9403
Developer Zone: Fundamentals of Motion Control
Developer Zone: Servomotor Overview
Developer Zone: Creating Custom Motion Control and Drive Electronics with an FPGA-Based COTS System
Developer Zone: Motor Fundamentals
KnowledgeBase 1OMGLO7L: Differences Between Brushed and Brushless Servo Motors
KnowledgeBase 3268KQ0M: What is Pulse Width Modulation (PWM) Signal and What is it Used For?
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
