Programming Robot Controllers

47 downloads 215 Views 2MB Size Report
Programming. Robot. Controllers. Myke Predko. McGraw-Hill. New York Chicago San Francisco Lisbon. London Madrid Mexico City Milan. New Delhi San Juan ...
Programming Robot Controllers Myke Predko

McGraw-Hill New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto

CONTENTS Introduction Acknowledgments Chapter 1

Chapter 2

Chapter 3

Chapter 4

Microcontrollers in Robots

ix xix 1

Controlling a Robot Support Components Memory and Device Programming Interrupts Built-In Peripherals Interfacing the Controller to the Robot

2 5 1 1 15 18 21

Software Development

25

Source Files, Object Files, Libraries, Linkers, and Hex Files Assemblers Interpreters Compilers Simulators and Emulators Integrated Development Environments

27 30 33 36 42 45

The Microchip PICmicro® Microcontroller

49

Different PICmicro MCU Devices and Features Application Development Tools Used in This Book Basic Circuit Requirements ThePIC16F627 El Cheapo PICmicro MCU Programmer Circuit

52 53 75 81 1 16

Microcontroller Connections

127

Hardware Interface Sequencing Robot C Programming Template Prototyping with the PICmicro Microcontroller Intercomputer Communications RS-232 HyperTerminal RS-232 Terminal Emulator RS-232 Interface Example Between PC and PICmicro MCU

129 132 136 141 143 148 153

Contents Bidirectional Synchronous Interfaces Output Devices LEDs ledflash - Flashing an LED PWM Power-Level Control ledpwm - Dimming the Output of an LED Piezo Electric Buzzers and Speakers for Audible Output Beeper Application LCDs LCD - Sample Two-Wire LCD Interface Sensors Whiskers for Physical Object Detection Whisker Debounce IR Collision Detection Sensors irdetect - IR LED and Detector-Based Object Sensor IR Remote Controls Sony Remote Control Receiver Application Combining irdetect and remote Ultrasonic Distance Measurement Ultra - Example Interface Light-Level Sensors Light - Practical Sensor Examples Sound Sensors Sound - Recognizing Audio Commands H-Bridge Motor Control Wallhug - Using the Tamiya Wall-Hugging Mouse as an Application Base Odometry for Motor Control and Navigation Radio Control Servos Servo2 - 60-Minute Robot Base Using RC Servos

163 166 167 170 1 78 180 191 192 196 204 216 21 7 221 228 231 238 241 247 253 255 264 267 279 284 290

Bringing Your Robot to Life

329

Real-Time Operating Systems (RTOS) Roach Example Application Running in an RTOS State Machines Randomly Moving a Robot Application with IR Remote Control Behavioral Programming Neural Networks and Artificial Intelligence

330 336 343

292 307 313 315

346 349 355

Contents Chapter 6

Appendix A

VN Designing the Robot System

361

Defining the Requirements for the Robot Choosing the Peripherals to Be Used in the Robot Selecting the Parts and Assembly Techniques Validating the Operation of the Robot Finding and Resolving Problems Adding Features, Functions, and Peripherals

363 367 368 371 373 377

Glossary

379

Appendix B Useful Tables and Data

393

Appendix C Microcontroller Selection Table

405

Appendix D

409

PICC Lite Language and Library Reference

Appendix E Resources

429

Index

441

Suggest Documents