|
home | lewin's resume | contact lewin | larwe.com |
|
A Cookbook for Open-Source Robotics and Process ControlThe following text is taken directly from the introduction to my above-titled new book, which will be released to the publisher on May 31 and will hopefully be on sale by Q4, 2004. If you have further questions about the book, please feel free to email me.1-1 History of this Book and What You'll Get From Reading ItOver the course of roughly a year, after completing my first book, I resurrected an old pet project of building a robotic submarine with certain challenging functionality requirements. In the course of developing this project, I spent many hours on the Internet and elsewhere, researching techniques for rapid development of various electromechanical control systems and platforms to run fairly complex signal-processing algorithms. Although there are, of course, thousands of useful projects and snippets of information to be obtained from the Internet and books on hobby-grade robotics, I found that nobody else seemed to have my exact priorities. In particular, there is apparently no single reference that gathers together at least introductory solutions to all the embedded design issues that affected my project: a need to use low-cost (open-source) tools and operating systems, a requirement for several features with fairly hard realtime requirements, and a desire to use cheap, off-the-shelf consumer grade components wherever possible. Available resources seem to concentrate either on very expensive off-the-shelf industrial components, or on tightly constrained systems built around a single microcontroller, with delicately optimized code to control peripherals - and a very limited range of peripheral support, at that. These latter system designs are mandatory when you're working to tight power requirements, space constraints, or a rock-bottom BOM cost, but it's an inordinate amount of effort to build and tune such systems for a one-off project or a prototype. If I may stretch an analogy, there are plenty of books out there detailing how to grow specific trees, but none that will teach you how to put together a viable forest out of a truckload of saplings. What I was searching for was a way to build various hard-realtime modules (sensors and actuators) that could easily and cheaply be interfaced to a general-purpose computer running Linux. I also wanted a simple up-and-running guide to building embedded Linux distributions. For the initial, non-fieldable prototype of my submarine, I didn't have an exact idea of how much CPU horsepower I would need in the final version - so I didn't want to get tied to a specific microcontroller architecture, nor did I want to get bogged down in trying to tweak and tune many realtime tasks on a single microcontroller. I also wanted to use a few peripherals - such as cameras - which are easiest interfaced through a general-purpose operating system. These requirements may sound a chord with your own working life. Two other instances where I have applied the techniques in this book are:
The second item above is of particular interest, because it demonstrates nicely how this book can be of practical value in process control and testing applications. During 2002, I briefly worked for a small division of a large producer of household and office plasticware. It was most instructive to examine their automated test fixtures - proprietary systems - and compare the cost and setup complexity of these fixtures with the relatively low cost and setup time of a simple Linux-based SBC controlling the same pneumatic actuators and sensors. Clearly, there is an under-exploited market for low-cost test systems of this type. The proprietary systems in use at this particular factory cost almost $20,000 for a half-dozen actuators and the associated PLCs, plus uncounted hours of setup time. The control software for these devices was specialized and not well-understood; in fact, most of this equipment was standing idle because the people who originally configured it had left the company. By way of contrast, the same tasks could easily be accomplished with a regular PC costing a mere few hundred dollars, plus perhaps $400 per actuator for the associated pneumatics. More importantly, the control software for such a system is a simple C program easily understood and adaptable by any reasonably competent computer science or electronic engineering major. Due to the nature of the research which led to this book's inception, I have included a sprinkling of naval details within the text, not all of which are directly relevant to the embedded engineer. If this material is not of interest, you can safely ignore it without compromising your understanding of the remaining text in any way. The reason this information is included alongside the "pure" embedded development discussion is principally to illustrate the real-world requirements that led to various design decisions in the E-2 project. Engineering is not theoretical science; it is an applied discipline, and it is with this in mind that I use specific examples to illustrate theoretical points. You should also note that some of the opinions expressed in this book, if not exactly controversial (except by Usenet standards - everything on Usenet is controversial!), are at least arguable; for example, the choice of AVR as my realtime control platform. For this reason, I have provided additional justification for the decisions I have made in this text. This additional explanation should demonstrate the reasons I had for choosing specific paths. Again, this "bonus material" is not critical to your understanding of the basic concepts presented here, and you can safely skip it if you wish. Finally, a note to people who own my previous book, "Embedded System Development on a Shoestring". This book is not exactly a sequel to that volume, but it is definitely related. If you follow the techniques in this book to build a prototype device, and you later want to squeeze it down into an optimized single-chip solution, my earlier work will help you understand how to use free GNU tools to get your software easily ported across to an ARM microcontroller. The principal criticisms I received for that previous book were that it needed to cover somewhat more ground, and that there were too few illustrations, making it a rather dry read. I've listened to these comments and I hope you will find this book satisfies your needs in both respects. |