|
|
|
Running Small Motors with PIC Microcontrollers
|
| |
|
Quantity in Basket:
None
Code: SMBOOK
Price: $49.95
Shipping Weight: 0.95 pounds
IN STOCK RoHS Compliant: YES
|
| |
|
“Running small motors with PIC microcontrollers” is intended as a tutorial for beginning Engineering College students and Hobbyists interested in running motors with PIC microcontrollers. Using PICBASIC PRO™ Compiler examples written for the LAB-X1 and PIC16F877A and 18F4331 MCUs, the book explains the fundamental concepts applicable to the running of motors with controllers that use these microcontrollers as their logic engines. The book focuses on mastering the techniques needed to run R/C servos, DC motors, stepper motors and DC motors with encoders in all the many ways they can be controlled. Control from potentiometers, R/C signals, and PWM signals is covered in detail with the over 2000 lines of PBP code provided in the tutorial.
The focus of this tutorial is on the basic concepts that have to be mastered. Once the investigator understands the basic concept, they can be used to create a host of applications the scope of which is limited only by the imagination of the investigator. All the explanations are in simple English and are made without resorting to any complicated formulas and theoretical considerations. The over 2000 lines of code that are provided in the book and also on the accompanying CD are all written in the easy to comprehend
PICBASIC PRO language.
The tutorial is divided into two parts. The first part introduces the reader to the PIC16F877A in some detail and the PIC 18F4331 in an introductory format. A LAB-X1 Experimenter Board along with the PICBASIC PRO Compiler can be used with the book discussions to gain familiarity with these logic engines as used in the LAB-X1. Though it is not strictly necessary that the reader have a LAB-X1, having the board does make it much easier for a novice to learn how to run motors more rapidly. The second part of the books concentrates on the running of the motors, providing detailed commented programs and detailed circuit diagrams to show how the user can design and program the controller that he or she creates..
For the advanced user, this tutorial is a great companion to the PICBASIC PRO Compiler and LAB-X1 Experimenter Board. If you're looking for a complete package, purchase this book and the Developer's Bundle, which includes PBP, LAB-X1, melabs Programmer, the 18F4331 and the 16F877A.
For those not having a fast internet connection, the included CD ROM provides copies of all the data sheets and related information needed. These include listing of all the sample programs in the manual, a free demo compiler and more. Short book reviews are included for those interest in further learning.
KEY FEATURES:
- Laid out in an easy to understand, progressive learning sequence.
- Extensive discussion of the motor control capabilities of the PIC16F877A and the PIC 18F4331.
- All programming examples are in written in the powerful, easy to use and easy to understand PICBASIC PRO Compiler language.
- R/C servos, stepper motors, DC motors and DC motors with servos are covered in detail.
- All learning will transfer to almost the entire line of PIC microcontrollers with minimal effort.
|
264 pages, includes CDROM
|
An excerpt from the section on the PID control loop used to run motors:
"Adding an optical encoder to a motor allows us to determine how fast
the motor is spinning, its direction and how far it has spun. With this scheme
we can control how far the motor moves, how fast it gets to its target location
and what velocity profile it follows on its way to its destination. This is what
we need for sophisticated robotic and Computer Numerically Controlled (CNC)
applications. This is what we need to run a fast, pen based plotter.
The usual scheme used to control the DC motor is called a PID loop. P, I and
D represent the three components of the feedback loop. A constant K is needed to
take care of friction components. In layman’s terms they are defined as
follows:
P represents the proportional part of the loop.
I represents the integrating function in the loop
D represents the derivative part of the feedback equation.
And K (when used) represents a constant needed to represent the overall system
friction.
If you are running a motor under a variable load the speed that the motor
attains will be approximately proportional to the load that is on the motor. If
the load on the motor is increased (and if we want to maintain the same speed)
we have to add more power to the system to keep the motor speed constant. This
is done by adding a little power at a time (again and again) till we get to the
desired speed. This is the integrating component of the equation. If we are
interested in maintain the speed of the motor within very tight limits, it
becomes necessary to make a calculation about how fast the speed of the motor is
changing and adding an appropriate power component to the motor to keep it
within its limits. If the motor speed is falling off sharply, we have to add the
power right away instead of integrating it in a little bit at a time as we were
doing with the integrating component. This sudden need for power adjustment is
the derivative component of the equation. Because the motor does not start
moving till it has overcome the friction in the system there is a constant
representing the minimum power needed to get moving. This is the constant K."
|
Table of contents
Section 00 Preface
List of programs
List of diagrams
List of tables
Section 01 Introduction to the MELabs LAB X-1 Board
Section 02 The Hardware and Software Set Up
Section 03 Understanding the PIC 16F877A Chip
Section 04 Software, Compilers and Editors
Section 05 Controlling the Input and Output
Section 06 Timers and Counters
Section 07 Sockets U3 to U8, Clocks and Memory
Section 08 Sockets U9 and U10, Serial Communications
Section 09 Liquid Crystal Displays
++++++++
Section 10 The PIC 18F14431, an introduction
Section 11 Running motors, a preliminary discussion
Section 12 Motor Amplifiers
Section 13 Running hobby, R/C servo motors
Section 14 Running small DC motors
Section 15 Running DC motors with quadrature encoders
Section 16 Running bipolar stepper motors
Section 17 Running small AC motors, Solenoids and Relays
Section 18 Debugging
Section 19 Appendices
App 1 Setting up compiler for one key press operation
App 2 Abbreviations
App 3 PIC Basic Pro sample program listings
App 4 PIC Basic Pro Programs in this book
App 5 Contents of CD ROM for Motors
*The index is on the CD ROM. Transfer it and save it to
disk and keep it open it in a separate window. This will
allow you to search it electronically when you need it and
to add new items to it as you see fit.
App 6 Source of materials
Section 20 Epilogue
List of Programs
Section 01 Introduction to the MELabs LAB X-1 Board
Section 02 The Hardware and Software Set Up
Section 03 Understanding the PIC 16F877A MCU
Section 04 The Software, Compilers and Editors
Program 01 Blinking all 8 LEDs on Port D one at a time.
Section 05 Controlling the Input and the Output
Program 01 Controlling (blinking) an LED (rightmost LED on bargraph)
Program 02 Blinking 8 LEDs one after the other on bargraph.
Program 03 Turns on an LED and dims the one next to it
Program 04 Displaying and blinking “HELLO WORLD” in the LCD display
Program 05 Writing to the LCD display in FULL Binary, Hexadecimal and Decimal
Program 06 Displaying the potentiometer wiper position on the LCD and the LED bargraph
Program 07 Generates a short tone on the piezo speaker.
Program 08 LED dimming using the PWM command.
Program 09 Generates a tone on the piezo speaker.
Program 10 Generates telephone key tones on the piezo speaker. (555-1212)
Program 11 Servo Position Control for an R/C servo from PORTB buttons.
Program 12 Use servo on J7 Servo position control with added functions
Program 13 Program reads SW1 and turns LED on PORTD.0 on while it is down.
Program 14 Read Keyboard Reading the keyboard rows and columns
Program 15 Reading the Keyboard Reading the keyboard rows and columns and show key number
Program 16 Potentiometer readings Displaying the value of potentiometer in all formats
Program 17 Reading and displaying all three potentiometers values in decimal format
Program 18 Servo/Potentiometers Three Potentiometers controlling one servo
Section 06 Timers and Counter
Program 01 Foreground Program blinks two LEDs alternately.
Program 02 Using TIMER0 Programs blinks two LEDs (D1 and D0) alternately and blinks
a third LED (D2) for one second ON and one second OFF as controlled by the
interrupt signal.
Program 03 Timer0 usage per meLabs program Hours, Seconds and Minutes digital Clock.
Program 04 Timer 1 usage. Rudimentary timer operation depends on value of POT-1.
Program 05 Using TIMER0 Programs blinks two LEDs alternately and blinks a third LED
approx. half second ON and half second OFF.
Program 06 Using TIMER0. Programs counts the pulses from a motor driven encoder.
Program 07 Timer1 as counter. Timer 1 counts signals from a motor encoder
Section 07 Clocks and Memory
Program 01 Program to read from and write to I2C SEEPROMs
Program 02 Program to read from and write to SPI SEEPROMs
Program 03 Program to read from and write to Microwire SEEPROMs
Program 04 Program to read from 12 bit LTC1298 A2D Chip by ME Labs.
Program 05 DS1820 Program to read temperature by MELabs
Program 06 DS1620 Program to read temperature by MELabs
Section 08 Serial Communications
Program 01 RS232 Communications Program to communicate with a computer
Program 02 RS232 Communications Program to send information to the computer.
Program 03 RS232 Communications Program to receive information from the computer.
Section 09 Using Liquid Crystal Displays. An information Resource
Program 01 For a PIC 16F84A Program to simulate back pack (by meLabs)
+++++++++
Section 10 The PIC 18F4331 Microcontroller
Section 11 Running motors, a preliminary discussion
Section 12 Motor Amplifiers
Section 13 Running hobby, R/C servo motors
Program 01 This is a “stand alone” program for finding the exact servo setting to
determine position for a servo.
Program 02 One second blinker on D.0
Program 03 Simple servo position determinations.
Program 04 Servo control with interrupts
Program 05 Program to finding Servo limits (with interrupt driven update timing)
Section 14 Running small DC motors
Program 01 Basic motor speed control program
Program 02 Comprehensive motor control. No encoder
Section 15 Running DC motors with quadrature encoders
Program 01 Rudimentary holding the position program
Program 02 Program to control motor speed from potentiometer
Program 03 Motor moves back and forth, speed from Potentiometer
Program 04 Modify distance moved and speed with the pots
Program 05 Ramp up and run at speed, ramp down, motor gain
Program 06 Ramp up, speed, ramp down. Interrupt
Program 07 Program to manipulate and display the interrupt rate
Program 08 Generalized program to run distance at speed
Program 09 Counting interrupts to tune program
Program 10 Servo exerciser program
Program 11 Turn motor into R/C servo. Follow radio signal.
Program 12 Program to vary speed form R/C signal
Section 16 Running bipolar stepper motors
Program 01 Basic LCD DEFINEs
Program 02 Stepper forward and reverse 100 steps
Program 03 Stepper forward as fast as possible
Program 04 Stepper speed controlled from potentiometer
Program 05 Basic interrupt routine for Timer 0
Program 06 Pot controlling speed via pre-scalers for Timer 0
Program 07 Running motor from Timer 0 and Pot 0
Program 08 Running back and forth with Pot 0 speed control
Program 09 Positioning motor from potentiometer position
Section 17 Running small AC motors, Solenoids and Relays
Section 18 Debugging
Program 01
Section 19 Appendices
Section 20 Epilogue
List of Figures
Section 01 Introduction to the LAB-X1 Experimental Board
Figure 01 The 40 pin 16F877A PIC Microprocessor
Section 02 Hardware and software set up.
Section 03 Understanding the PIC 16F877A Microchip MCU
Figure 01 Picture of LAB X1
Section 04 Software, compilers, editors.
Section 05 Controlling the input and the output.
Figure 01 The LED bargraph circuitry to PORTD pin 0.
Figure 02 The LED bargraph circuitry to all of PORTD
Figure 03 The LCD display wiring
Figure 04 The basic circuitry for the 3 potentiometers.
Figure 05 The basic circuitry for generating tones on the piezo speaker
Figure 06 Circuitry for controlling an RC servo from the three potentiometers.
Figure 07 Wiring for the keyboard rows and columns
Figure 08 Partial keyboard
Section 06 Timers and counters
Figure 01 The simplified, basic structure of a typical interrupt routine.
Section 07 Clocks and Memory.
Figure 01 One Wire Memory Sockets
Figure 02 I2C SEEPROM Wiring and circuitry requirements
Figure 03 SPI SEEPROM Wiring and circuitry requirements
Figure 04 Micro Wire SEEPROM Wiring and circuitry requirements
Figure 05 Clock implemented using IC NJU6355
Figure 06 Clock implemented using IC DS1202.
Figure 07 Clock implemented using IC DS1302.
Section 08 Serial Communications.
Figure 01 RS232 Communications wiring.
Figure 02 RS485 Communications wiring.
Section 09 Using Liquid Crystal Displays
Figure 01 Two line by 16 Character LCD Module
Figure 02 Wiring diagram. LCD backpack using a PIC 16F84
++++++++
Section 10 The PIC 18F14431, an introduction
Section 11 Running motors, a preliminary discussion
Section 12 Motor Amplifiers
Figure 01 Small amplifiers suitable for small motors
Figure 02 Photo of Xavien 2 axis amp
Figure 03 Connection schematic for Xavien 2 axis amp
Figure 04 Using the Xavien 2 axis amplifier
Figure 05 Photograph of 1 axis Xavien amplifier
Figure 06 Schematic of 1 axis Xavien amplifier
Figure 07 Using the single axis Xavien amplifier
Figure 08 Photograph of two axis Solarbotics amplifier
Figure 09 Schematic of two axis Solarbotics amplifier
Figure 10 Using the two axis Solarbotics amplifier
Section 13 Running hobby, R/C servo motors
Figure 01 Model aircraft servo
Figure 02 Circuitry for two servos running from a 16F877A
Section 14 Running small DC motors
Figure 01 Small electric motors suitable for experiments
Figure 02 Wiring diagram for motor controller
Section 15 Running DC motors with quadrature encoders
Figure 01 Small DC electric motors with encoders
Figure 02 Encoder signals. Quadrature illustration
Figure 03 Servo exerciser
Section 16 Running bipolar stepper motors
Figure 01 Typical small stepper motors
Figure 02 Wiring schematic for bipolar motors
Figure 03 Connection points for Xavien Amplifier
Figure 04 Wiring diagram for Xavien and Stepper
Figure 05 Wiring for the Solarbotics Amplifier
Figure 06 Wiring schematic for Stepper motors and Solarbotics
Section 17 Running small AC motors, Solenoids and Relays
Figure 01 Small fractional HP AC motor
Figure 02 Solid state relay
Figure 03 How to wire a diode across a coil or solenoid
Section 18 Debugging
Section 19 Appendices
Figure 01 Wiring diagram of controller board
Section 20 Epilogue
|
|
Related Item(s)
|
Code
|
Name
|
Image
|
Price
|
Availability
|
|
|
SUPERBUN
|
Super Bundle - The complete melabs development system with tutorial
|
|
$699.95
|
IN STOCK RoHS Compliant: YES
|
|