Experiment #26: Stepper Motor Control



Similar documents
ServoPAL (#28824): Servo Pulser and Timer

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

Using the Motor Controller

Special Lecture. Basic Stamp 2 Programming. (Presented on popular demand)

Servo Info and Centering

Pulse Width Modulation Applications

etape Continuous Fluid Level Sensor Operating Instructions and Application Notes

Chapter 4: Pulse Width Modulation

Web Site: Forums: forums.parallax.com Sales: Technical:

Digital To Analog Converter with Sine Wave Output

Table 1 Comparison of DC, Uni-Polar and Bi-polar Stepper Motors

SD21-21 Channel Servo Driver Module Power Servo's

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

Scan a Keypad with the BS2 For Pushbutton User Input

Web Site: Forums: forums.parallax.com Sales: Technical:

STEPPER MOTOR SPEED AND POSITION CONTROL

PIC Application Notes

Getting Graphic: Defining Custom LCD Characters

Rectifier circuits & DC power supplies

Basic of servomotor control

cs281: Introduction to Computer Systems Lab08 Interrupt Handling and Stepper Motor Controller

1115 4G SERIES GOVERNOR ma ANALOGUE DIGITAL SPEED SETTING

Microcontrollers for Ham Radio Part 1 - BASIC Stamp

DMX-K-DRV. Integrated Step Motor Driver + (Basic Controller) Manual

SumoBot Mini-Sumo Robotics Assembly Documentation and Programming

B Robo Claw 2 Channel 5A Motor Controller Data Sheet

Flow Charts and Servomotors (background to Lab #2) Things to learn about: flow charts for design. MECH Lecture #2 flow charts & servos rev2

Zeros, Ones, and the Morse Code

GT Sensors Precision Gear Tooth and Encoder Sensors

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

Measuring Resistance Using Digital I/O

TETRIX Add-On Extensions. Encoder Programming Guide (ROBOTC )

MICROCONTROLLER INTERFACING CIRCUITS

GLOLAB Two Wire Stepper Motor Positioner

MC433 Stepper Motor Controller

HOBBY SERVO FUNDAMENTALS BY: DARREN SAWICZ

RCDC1 Radio Controlled Device Controller- 1 Channel

Digital vs. Analogue Control Systems

Chapter 11 SERVO VALVES. Fluid Power Circuits and Controls, John S.Cundiff, 2001

Arduino Lesson 16. Stepper Motors

Parallax Serial LCD 2 rows x 16 characters Non-backlit (#27976) 2 rows x 16 characters Backlit (#27977) 4 rows x 20 characters Backlit (#27979)

DC Motor control Reversing

Small Optical Encoder Modules 480lpi Digital Output. Features. Applications VCC 3 CHANNEL A 2 CHANNEL B 4 GND 1

Kevin James. MTHSC 102 Section 1.5 Exponential Functions and Models

Talon and Talon SR User Manual

WORKING WITH STEPPER MOTORS

Datasheet of the Easy Servo Drive ES-D VDC, 8.2A Peak, Close-loop, No Tuning. Version

The self-starting solar-powered Stirling engine

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

AP-1 Application Note on Remote Control of UltraVolt HVPS

AN470 APPLICATION NOTE

AE R6 December Digital Capacity Control for Copeland Scroll Refrigeration Compressors AE R6

Inductance. Motors. Generators

L297 STEPPER MOTOR CONTROLLERS

Basic Analog and Digital Student Guide

Basic DC Motor Circuits. Living with the Lab Gerald Recktenwald Portland State University

Fastastic Frequencies

Basic DC Motor Circuits

Interfacing Analog to Digital Data Converters

CONNECTOR AMPLIFIER FOR PROPORTIONAL VALVES (4-20 ma Input Version)

ServoOne. Specification. Option 2 - Technology. x 11. x 8 X 8. x 10. x 9. x 7. x 6 TTL Encoder / TTL Encoder simulation

Decimal Number (base 10) Binary Number (base 2)

Chapter 8. Digital and Analog Interfacing Methods

9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements

Load Cell Amplifier Module. Instruction Manual LCA

Mobile Robotics I: Lab 2 Dead Reckoning: Autonomous Locomotion Using Odometry

DIRECT CURRENT GENERATORS

Description. Output Stage. 5k (10k) - + 5k (10k)

EXPERIMENT 2 TRAFFIC LIGHT CONTROL SYSTEM FOR AN INTERSECTION USING S7-300 PLC

CHAPTER 11: Flip Flops

Selecting and Implementing H-Bridges in DC Motor Control. Daniel Phan A

MDC Series

CIM Computer Integrated Manufacturing

Power Quality. Voltage Sag Ride-through Mitigation in Sequence by Increasing Cost

The D.C Power Supply

System Modeling and Control for Mechanical Engineers

Motion Program 1000 Contains the G-code Subroutines OPEN PROG 1000 CLEAR ; G00: Rapid mode (N0 is implied)

Application Engineering

PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT

The Simple DC Motor: A Teacher s Guide

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

Table of Contents Getting Started... 3 The Motors... 4 The Control Board... 5 Setting up the Computer with Mach Starting up the Equipment...

Basic Pulse Width Modulation

Servo Motors (SensorDAQ only) Evaluation copy. Vernier Digital Control Unit (DCU) LabQuest or LabPro power supply

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

TRILOGI 5.3 PLC Ladder Diagram Programmer and Simulator. A tutorial prepared for IE 575 by Dr. T.C. Chang. Use On-Line Help

TUBE-TECH HLT 2A Stereo High- and Low shelving, T- filter & Low- and High cut

3FBD DC Motor Drive User Manual

Digital I/O: OUTPUT: Basic, Count, Count+, Smart+

How To Control A Motor Control On An Hvac Platform

Odyssey of the Mind Technology Fair. Simple Electronics

Other products available from Apollo

The quadrature signals and the index pulse are accessed through five inch square pins located on 0.1 inch centers.

Field and Service Robotics. Odometry sensors

DIGITAL LOGIC CURRENT FLOW

Transcription:

Experiment #26: Stepper Motor Control This experiment demonstrates the control of a small 12-volt unipolar stepper motor. Stepper motors are used as precision positioning devices in robotics and industrial control applications. New PBASIC elements/commands to know: ABS Building The Circuit StampWorks Manual Version 1.2 Page 157

============================================================================== File... Ex26 - Stepper.BS2 Purpose... Stepper Motor Control Author... Parallax E-mail... stamptech@parallaxinc.com Started... Updated... 01 MAY 2002 {$STAMP BS2} ============================================================================== Program Description This program demonstrates unipolar stepper motor control. The pot allows the program to control speed and direction of the motor. Revision History I/O Definitions PotCW CON 0 clockwise pot input PotCCW CON 1 counter-clockwise pot input Coils VAR OutB output to stepper coils Constants Scale CON $0100 scale for BS2 (1.0) Scale CON $0080 scale for BS2sx, BS2p (0.5) Variables Page 158 StampWorks Manual Version 1.2

speed VAR Word delay between steps x VAR Byte loop counter saddr VAR Byte EE address of step data rcrt VAR Word rc reading - right rclf VAR Word rc reading - left diff VAR Word difference between readings EEPROM Data ABAB ----- Step1 DATA %1100 A on B on A\ off B\ off Step2 DATA %0110 A off B on A\ on B\ off Step3 DATA %0011 A off B off A\ on B\ on Step4 DATA %1001 A on B off A\ off B\ on Initialization Initialize: DirB = %1111 speed = 5 make stepper pins outputs set starting speed Program Code Main: FOR x = 1 TO 100 GOSUB Step_Fwd NEXT PAUSE 200 FOR x = 1 TO 100 GOSUB Step_Rev NEXT PAUSE 200 Step_Demo: HIGH PotCW 1 rev forward 1 rev back discharge caps StampWorks Manual Version 1.2 Page 159

HIGH PotCCW PAUSE 1 RCTIME PotCW, 1, rcrt RCTIME PotCCW, 1, rclf rcrt = (rcrt */ Scale) MAX 600 rclf = (rclf */ Scale) MAX 600 diff = ABS(rcRt - rclf) IF (diff < 25) THEN Step_Demo IF (rclf > rcrt) THEN Step_CCW Step_CW: speed = 60 - (rcrt / 10) GOSUB Step_Fwd GOTO Step_Demo read clockwise read counter-clockwise set speed limits get difference between readings allow dead band calculate speed do a step Step_CCW: speed = 60 - (rclf / 10) GOSUB Step_Rev GOTO Step_Demo Subroutines Step_Fwd: saddr = saddr + 1 // 4 READ (Step1 + saddr), Coils PAUSE speed RETURN point to next step output step data pause between steps Step_Rev: saddr = saddr + 3 // 4 READ (Step1 + saddr), Coils PAUSE speed RETURN point to previous step Page 160 StampWorks Manual Version 1.2

Behind The Scenes Stepper motors differ from standard DC motors in that they do not spin freely when power is applied. For a stepper motor to rotate, the power source must be continuously pulsed in specific patterns. The step sequence (pattern) determines the direction of the stepper s rotation. The time between sequence steps determines the rotational speed. Each step causes the stepper motor to rotate a fixed angular increment. The stepper motor supplied with the StampWorks kit rotates 3.6 degrees per step. This means that one full rotation (360 degrees) of the stepper requires 100 steps. The step sequences for the motor are stored in DATA statements. The StepFwd subroutine will read the next sequence from the table to be applied to the coils. The StepRev subroutine is identical except that it will read the previous step. Note the trick with the modulus (//) operator used in StepRev. By adding the maximum value of the sequence to the current value and then applying the modulus operator, the sequence goes in reverse. Here s the math: 0 + 3 // 4 = 3 3 + 3 // 4 = 2 2 + 3 // 4 = 1 1 + 3 // 4 = 0 This experiment reads both sides of the 10K potentiometer to determine its relative position. The differential value between the two readings is kept positive by using the ABS function. The position is used to determine the rotational direction and the strength of the position is used to determine the rotational speed. Remember, the shorter the delay between steps, the faster the stepper will rotate. A dead-band check is used to cause the motor to stop rotating when the RCTIME readings are nearly equal. Challenge Rewrite the program to run the motor in 200 half steps. Here s the step sequence: Step1 = %1000 Step2 = %1100 Step3 = %0100 Step4 = %0110 Step5 = %0010 Step6 = %0011 Step7 = %0001 Step8 = %1001 StampWorks Manual Version 1.2 Page 161