Closed-Loop Motion Control for Mobile Robotics

Closed-Loop Motion Control for Mobile Robotics

Circuit Cellar, the Magazine for Computer Applications. Reprinted by permission. For subscription information, call (860) 875-2199, or www.circuitcellar.com. Entire contents copyright ©2004 Circuit Cellar Inc. All rights reserved. FEATURE ARTICLE by Rich LeGrand Closed-Loop Motion Control for Mobile Robotics Rich recently came up with two closed-loop drive train designs for mobile robots. All it took were some inexpensive permanent magnet motors and a simple feedback scheme. In this article, he covers everything from PID control and tuning to trajectory generation and opera- tional space control for two robot bases. He also explains the software. The mechanical components that result, robots that use them are typically to the motor, the robot takes much make up robots aren’t getting much slow. Large gear reductions make some longer to stop. With less gear reduc- cheaper. That’s the bad news. The good problems easier, as you’ll see, but no one tion, the robot will coast! news, of course, is that electronics and wants a slow robot if they can help it. If Sometimes stopping quickly is impor- processors continue their steady march you’ve used these motors, you might tant (e.g., stairs ahead), or your robot toward higher performance and lower have wanted to trade in some torque may do something hazardous to its cost. As an engineer, you have to figure for some speed. health. This brings up an important out how to use the extra resources and The 9-V Lego motors shown in Photo 1 point: motors with high gear reduc- capabilities most effectively. In some are readily available. They are part of tions stop quickly when power is cases, extra processing allows you to the Mindstorms kit, so you can build removed. But this is a silly reason to use use lower-cost mechanical compo- the rest of your robot base out of these motors. It’s like telling a begin- nents, which can effectively reduce Legos, which is a good thing for the ning driver to drive only in first gear to the system’s overall cost. mechanically challenged like me. avoid getting into an accident. What the With this idea in mind, I’ll tackle the Fortunately, the Lego motor has driver really needs is better driving robot drive train armed with a modest much less gear reduction (14:1) and is skills. Similarly, what you need is a amount of computing power. When I’m well suited for attaching a wheel direct- better motor controller. done, you’ll have two different closed- ly to the output shaft. If you’ve done loop drive train designs that would this, you know that you get a quick CLOSING THE LOOP make R2-D2’s head spin with envy. I’ll robot, but it’s difficult to control. A motor controller that doesn’t receive show you how to accomplish this Particularly, when you shut off power any feedback information from the using inexpensive permanent motor is an open-loop controller. magnet motors and a clever feed- The main advantage of open-loop back scheme that requires no controllers is simplicity. All that’s mechanical overhead. Let’s begin required is a way to control the by addressing the topic of motors. voltage or current going to the motor. The Lego Mindstorms RCX MOTOR OPTIONS controller, for example, uses an Clearly, selecting a motor is one open-loop motor controller that of the most important decisions to allows you to select from several make when designing the drive voltages (by varying the pulse- train. If you’ve played with motors width modulator duty cycle) and gears, you’ve certainly devel- depending on how much speed and oped the following intuition: more torque you want to deliver to your gear reduction results in less speed robot’s wheels. and more torque, and less gear A disadvantage of open-loop con- reduction results in more speed and trol is inaccuracy. Others include less torque. Modified RC servomo- the inability to deal with uncon- tors, which are often used in robot trollable variables such as bumps drive trains, have large gear reduc- in a floor, inclines, and low batter- Photo 1—Lego is an excellent medium for implementing robots such as tions (typically 300:1) resulting in the four-wheeled HUMR. The Gameboy Advance acts as the controller and ies, which can create an undesir- high torques and low speeds. As a provides 32-bit RISC processing performance, a color LCD, and sound. able situation by slowing or stop- 34 Issue 169 August 2004 CIRCUIT CELLAR® www.circuitcellar.com Method Description Advantages Disadvantages Sources Optical-mechanical A rotating slotted disk is placed No drift. Digital output integrates Typically expensive. Requires extra Hewlett Packard, encoders between a light source and detector easily with digital controllers. Long cables. computer mouse to infer position. lifetime. Mechanical Switches are triggered by the motor’s No drift. Typically expensive. Requires extra Vishay, various encoders motion to infer position. cables. Imposes drag. Output needs industrial vendors debouncing. Lower speed. Shorter lifetime. Hall effect sensors When used with a magnet, they can No drift. Uses existing gear in gear Typically expensive. Requires extra Allegro, various sense metallic (ferrous) gear teeth to train. ables, extra magnet, and ferrous gear. industrial vendors infer position. Back EMF The back EMF voltage of a motor is No extra mechanical components or Drift. Requires A/D converter and Acroname, measured to infer velocity. cables. Typically inexpensive. extra computation to obtain position. Charmed Labs Table 1—There are a few popular feedback methods for sensing motor motion. Back EMF sensing is often overlooked, but its advantages can be attractive to many robotics applications. ping the motor. What’s required is a age with an A/D converter, for example, taken literally. A control loop typically way to sense the motion of the motor you can infer the motor’s velocity. When entails a software loop that repeatedly and compensate by increasing or the voltage is integrated (summed) over executes a control algorithm. Each rep- reducing the power. Closed-loop con- time, the position can be inferred as well. etition of the control algorithm is trollers can do both. The main disadvantage of back EMF called a control cycle. The control algo- Closed-loop controllers are found in sensing is that the inferred position rithm can be described simply with the all sorts of places: thermostats, cruise drifts over time with respect to the following expressions, which are eval- control systems, and elevators just to actual position because of noise in the uated once per control cycle: name a few. Almost without excep- back EMF voltage. In practice, howev- error = V − V tion, commercial robots use closed- er, the error introduced by position DESIRED MEASURED V = f() error loop motor control. Even the Roomba, drift is small when compared to the CONTROL a $199 vacuuming robot, uses a error introduced by wheel slippage Basically, there is a function, f, which closed-loop motor controller. alone. This performance can be determines the value to send to your Closed-loop control requires a method obtained with a 9-V Lego motor and controller (VCONTROL) as a function of the for sensing the motor’s motion. Table 1 robot controller from Charmed Labs, error. VMEASURED is the measured (sensed) lists some popular methods. The method which uses back EMF sensing. value, and VDESIRED is the desired (com- that will work best for you depends as manded) value. The difference between much on project constraints as your pref- PID CONTROL the values is the control error. Note erences. The majority of closed-loop Closed-loop motor control entails both that one of the simplest control meth- motor controllers use optical-mechanical sensing and controlling the motor’s ods is the bang-bang controller, which encoders for position feedback, but the motion. I have described different you can find in your thermostat. extra cabling and mechanical complexity sensing techniques. The general con- V = Heat if error > 1° are usually worth avoiding. I chose back sensus is that an H-Bridge with pulse- CONTROL Cool if error < −°1 EMF as a feedback method. The mechan- width-modulation (PWM) is the best Off otherwise ical simplicity (no mechanics) and lack method for controlling the motor. (For of cables make it an attractive option. more information, refer to L. Mays’s My thermostat doesn’t automatical- Back EMF exploits the fact that perma- article, “Muscle for High-Torque ly select between heating and cooling; nent magnet motors are also generators. Robotics,” Circuit Cellar, issue 153, it would be nice if it did. Many robots When a motor spins, a voltage is gener- 2003.) Here, a PWM signal switches an use bang-bang controllers for their ated across its terminals. The voltage, H-Bridge to control the voltage going motors. However, PID control is a referred to as the back EMF voltage, is into the motor and its speed. Note that much more effective technique: directly proportional to the motor’s veloci- I will refer to this type of controller () () ty. Thus, when sensing the back EMF volt- throughout the rest article as a PWM VkCONTROL = VPROPORTIONAL k + () () controller. Its VINTEGRALk + V DERIVATIVEE k input will be V()kk = K × error() Endpoint referred to as the PROPORTIONAL P k PWM value. Velocity Tragectory PositionDESIRED Error PID VPWM + Motor V()k = K × ∑ error ()j generator controller When combin- INTEGRAL I – j = 0 Acceleration ing sensing and PositionMEASURED () × ()− control in a VDERIVATIVEk = K D error k Figure 1—A PID controller is typically used to control the velocity and position of a closed-loop con- error() k − 1 motor.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us