Gravity Bowl

Burning Man 2004

Proud supporter of:

INTRO   MOTION   CONTROL  DESIGN    TEAM    BLOG

Helping Children With Autism

 

 

Wheel-Unit Control System Design

 

Introduction

 

The three wheel units of the GravityBowl vehicle consist of a drive motor and a steering motor. Both of these motors are controlled by a central processor via serial link that specifies the steering angle and drive speed at each instant of time. In order to respond to commands and produce the correct angle and speed, the wheel unit controller must use feedback from sensors to determine the error between desired and actual conditions. This document describes the theory behind this behavior.

 

Control System Overview

 

The following diagram shows the structure of the speed control system for setting the rotation speed of the drive wheels. It consists of a double loop. The inner loop controls the motor current and the outer loop controls the speed.

 

 

Figure 1: Speed control system

 

The inner loop involves a current controller that monitors the motor current and compares it with the desired motor current command from the speed controller. Its output sets the duty cycle of the motor switching signal. The second job of the current controller is to limit the motor current to a safe operating region. The outer loop compares the desired wheel rotation speed with the actual speed and works out how to command the current loop based on the difference.

 

Feedback is essential in building a successful motor control system. In an open loop system with no feedback it is possible to command a desired speed from the motor but if anything changes, e.g., increasing or decreasing friction, change of vehicle mass, or changes in power supply voltage, then the actual speed might change over a large range. The same applies to the steering configuration where a commanded angle may result in unknown steering results depending on frictional resistance. It is necessary to compare desired and actual heading to correct the steering and keep it true in the presence of random disturbances.

 

Figure 2: Position control system

 

The steering control system is similar to the speed system. Figure 2 shows that steering control requires an additional position loop which compares the actual position of the wheels against the input position command. This extra requirement for position control brings its own set of complexities. There are numerous ways to construct a control system for position control and it is possible to roll the speed and position loops together into a single loop, but here I choose the double loop as it has a number of advantages in terms of ease of tuning and allows the speed to be directly limited to safe operating conditions. This is important because the steering motor is a 24VDC motor and we are operating it from a 48V supply.

 

Motor Model

 

In order to determine the system dynamics it is necessary to derive the formula for the motor (“plant”). From this it is possible to design the motor current controller and then later the speed and/or position controllers.

 

The input to this part is the pulse width modulated (PWM) signal from the microprocessor that is used to switch the field effect transistors (MOSFETs) that control the motor. These transistors are arranged in a bridge configuration and rapidly turn on and off with the PWM signal so that the motor current can be controlled. The motor current is measured using a linear hall-effect sensor and is digitized using an analog to digital converter.

 

 

Figure 3: Motor model

 

Figure 3 shows the motor model. The two MOSFETs shown are turned on and off in alternation so that the motor is alternately connected to the power supply and the ground. There are actually four transistors per motor but only two are used at a time for one direction of motion. The motor internal inductance L ensures that the motor current remains smooth even though the voltage is rapidly switching. The motor has a speed  and produces a torque . The rotation produces a generated internal motor voltage , where  and  is different for each motor. The motor current i going through the inductor produces the motor torque such that  and . For the motors we are using, the motor constants have the following values:

 

Motor

Torque Constant Kt

Velocity Constant Kv

NPC-X950 (E-Tek)

0.13 Nm/A

7.69 rad/Vs

 

1.2 lb.in/A

73 rpm/V

NPC-T64 (gearmotor)

0.811 Nm/A

1.233 rad/Vs

 

7.8 lb.in/A

11.8 rpm/V

 

To a first approximation, providing that the MOSFET switching frequency is high compared to the time constant of the motor inductance, the motor current equation is given by:

 

                                                  (1)

 

where D is the duty cycle for the top transistor and  is the supply voltage. One may then obtain the motor plant transfer function, which is:

 

                                                     (2)

 

where  is the Laplace transform derivative operator (please refer to any textbook on control theory to get an explanation of this operator.) This equation can be described by the diagram of Figure 4 where the motor speed acts as a disturbance input.

 

 

Figure 4: Laplace domain diagram of motor plant.

 

 

Motor Current Controller

 

Now that we have obtained a model for the motor, we can close the loop by feeding back the measured current. We also must add a saturation stage to limit D to the range -1 to 1, where negative values mean that the other pair of transistors are being used and the motor is driven backwards. In addition we add a standard PI (proportional plus integral) controller. This results in the signal diagram of Figure 5.

 

Figure 5: Motor current loop

 

The form of the PI controller is given by:

 

                                                     (3)

 

where  is the proportional gain and  is the integral gain ( means integration.) The proportional term sets the overall response of the system and the integral term ensures that the output current settles to match the value of the input current command by driving the error signal to zero. Tuning the controller requires setting the two gains to achieve the kind of response that we would like and to ensure that the system is stable (does not produce rapidly increasing oscillations.)

 

One thing that we must take precautions against is integral wind-up. This occurs when our D signal is saturated and the integrator keeps increasing its output in response to a static error signal. To protect against this outcome we must implement the controller in such a ways that the integrator is prevented from increasing above a fixed limit when D is in saturation.

 

When we implement this control system we will be using a sampled digital representation and this approximation to analog signals requires special consideration. The microprocessor measures the motor current using a A to D converter and compares it against the motor current command. It then implements the PI controller and saturation digitally and this is used to set the PWM duty cycle for the motor. Providing that the sampling frequency and PWM frequency (which may be equal) are high compared with the motor inductance time constant it is not necessary to carry out a full z-domain analysis and determine stability.

 

Given the current loop of Figure 5, we can carry out simulations and find out suitable values for the proportional and integral gains of our PI controller. To do this effectively we need to know the motor internal resistance and inductance and these will need to be measured.

 

A drawing of the motor controller circuit drawing can be found here.