Stepper motor driven xy table

Assignment Help MATLAB Programming
Reference no: EM1383663

Lab Objectives:

  • Use Matlab and Labjack to acquire digital inputs from limit switches
  • Use Matlab and Labjack to control a stepper motor
  • Use Matlab to analyze acquired data
  • Use a simple control system to vary an output based upon input data
  • Set-up and Basic Control of the XY Tables

Lab Equipment Required

  • Laptop with Matlab/Labjack software installed
  • Labjack DAQ with USB cable
  • DB25 cable for interfacing with the XY table
  • XY table
  • Power supply
  • Two power lead wires
  • Ruler

Equipment Set Up

The XY tables are pre-wired to interface with the Labjack DAQ units using the DB25 cable.  However, attention must be paid to the channels used for each of the inputs and outputs while writing the program.  Special care must be given to distinguish between digital input and digital output signal types.  It is possible to damage the equipment if these are reversed (i.e. writing an output to a closed switch input).

The axes and limit switch locations are shown in the Figure below.

Notice that A refers to "Away" from the end with the motor, and B refers to "By" the motor.

The table below contains the wiring assignments for the Labjack IO connections. These cannot be changed since they are hard-wired from the circuit to the motors and from the XY tables to the Labjack connector.

363_Programming for the XY Tables.png

The important channels for this lab are:

X-axis: direction commands (channel D1) - outputs, EDigitalOut()

step commands (channel D0) - outputs, EDigitalOut()

limit switch signal (channels D8 and D9) - inputs, EDigitalIn()

Y-axis: direction commands (channel D5) - outputs, EDigitalOut()

step commands (channel D4) - outputs, EDigitalOut()

limit switch signal (channels D10 and D11) - inputs, EDigitalIn()

Direction of MOTOR rotation --- controlled by setting state of channel D1 HIGH or LOW.  If D1 is LOW, the default, the bearing block moves in the plus x direction (towards end A).  The X-axis motor will rotate one step (0.9 degrees) each time a pulse (a HIGH signal followed by a LOW) is sent to channel D0. 

Example:         EDigitalOut (-1, 0, 1, 1, 0) % ch D1 sets direction to plus x direction (state = 0).

                        EDigitalOut (-1, 0, 0, 1, 1) % ch D0 step high pulse (state = 1).

                        EDigitalOut (-1, 0, 0, 1, 0) % ch D0 step low pulse (state = 0).

Several other connections may be of interest in future labs and as the last two weeks will be spent designing an individually developed system.  D2 and D6, when turned on (HIGH) will cause the respective stepper motors to run in a ½ step mode.  These motors turn 0.9 degrees per step, therefore the ½ step mode will produce only 0.45 degrees per step.  This doubles the X and Y resolution as each pulse only travels ½ of the default distance.  Notice that the steps per second (commanded from the computer) do not change and thus it also takes twice as long to move the same distance. Note that each motor may be remotely disabled by setting the outputs D12 and/or D13 to HIGH.

Programming for the XY Tables

1. Set-up and test the XY Table

Connect the hardware as described in the previous section.  Next, open the Labjack LJLogger application and use it to verify that everything is connected and working properly.  In particular, and with the main power supply off, move (by hand) the bearing slides to the various endpoints. When each respective limit switch is contacted, the LJLogger screen should light up the respective input button.

 Verify the function of all four of the limit switches (channels D8, D9, D10, D11).  Finally, set channels D0, D1, D4, and D5 directions to Write and turn on the main power supply; now when the various outputs are toggled between HIGH and LOW the corresponding motor should single step in direction selected.  When finished, turn the main power supply back to OFF, as leaving this on while not in use generates significant heat in the four power resistors located under the main driver circuit board.

2. Move 100 Steps Along the X-axis

Write a simple MATLAB program to move the X axis 100 steps towards end A, followed by moving it back towards end B with another 100 steps.  Think about different ways that this can be accomplished using loops.  Before running this program, move the bearing slide on the X-axis far enough away from end A so that the limit-switch is not contacted.  Write a flowchart for this part in your three ring binder.

3. Measure X-axis Travel Distance, and Find and Move to the Center of the X-axis

Now combine the limit switch feedback with the ability to move the X-axis motor. Write a MATLAB program to perform the following steps:

a. Move the X-axis carrier towards switch A until the limit switch is actuated.  Pause the program.  Make a pencil mark on the stationary axle being traversed.  Continue.

b. Create a STEPS variable and move the X-axis carrier towards switch B until the next limit switch is actuated. Use a WHILE loop to continually increment steps until finished so that when switch B is contacted the number of steps that it took to travel from limit switch A to limit switch B on the X-axis will have been stored. Display the number of steps on the screen.  Pause the program.  Make a pencil mark on the stationary axle being traversed.  Continue.

c. Finally, move the X-axis carrier to its center position (STEPS/2), and end the program. Use a FOR loop instead of a WHILE loop.

d. Measure the distance between your two pencil marks with the ruler.  Fill out the worksheet for the x-axis calculations.

4. Measure Y-axis Travel Distance, and Find and Move to the Center of the Y-axis

Repeat part 3, steps a, b, c, and d for the Y-axis. Consider how easy it is to take the existing code from part 3, copy it in a new program, change several IO variables, and repeat the procedure for the Y-axis.

Reference no: EM1383663

Questions Cloud

Probability of pulling out vehicle at oncoming traffic : Assuming a standard driver reaction time of 2.5 seconds, what is the probability that the vehicle pulling out will get in an accident with oncoming traffic?
Flowchart for steps-processes and milestones-dbms design : Let the design development process. Make the flowchart of major steps, processes, and milestones essential to perform a thorough DBMS design.
What is the reorder point : If a service level of 97% is desired during the reorder interval, what is the reorder point (select the closest number)?
Types of behaviors increase trust in interpersonal relations : What types of behaviors increase trust in interpersonal relationships? What kinds of behaviors decrease trust? Use examples to illustrate your response.
Stepper motor driven xy table : Stepper Motor Driven XY Table - Use Matlab and Labjack to acquire digital inputs from limit switches and use Matlab to analyze acquired data
Concepts of assimilation and pluralism : What makes the U.S. an assimilationist society? Who benefits and who suffers from it? Summarize the concepts of assimilation and pluralism. Is assimilation achieved in our society?
This results in a dpmo of approximately : An analysis of the last 2,000 customer return transactions uncovered 30 errors. This results in a DPMO of approximately
Describe the ion and concentration forces or processes : Many processes are involved in creating the Resting membrane potential.”   Describe   the ion   and concentration FORCES or PROCESSES   that are involved in determining the resting membrane   potential.
Emergency operations center-exercise takes place in a class : What type of exercise takes place in a classroom setting arranged to look like an emergency operations center or in an actual emergency operations center, and involves simulation using written, telephone, and radio messaging.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  An efficient human identification using gait analysis

An Efficient Human Identification Using Gait Analysis, Apply specific approach for Pattern Recognition,Implement this approach in MATLAB,Compare and discuss the results with others.

  Design and fir filter in matlab

What does the pole-zero diagram tells you about the filter

  Write a function in matlab

write a function in MATLAB

  Control design using matlab

Control Design using Matlab,  Please try and explain the characteristic of all the plots and graphs.   Import all the required data in word of simply write in the script itself.

  Create a matrix of 5x6

Prepare a matrix of 5x6. with identical columns and rows ranging from 200 to 1000 in equal increments

  Calculate an approximation to the energy consumed

Calculate an approximation to the energy consumed over the period and calculate an approximation to the energy consumed over the period t = a to t = b.

  Write a functions

The function range basis takes a matrix A as input, and outputs a basis (again written as columns) for the range space of A.

  Design simple interface hardware

Evaluate the capability in selecting and configuring a microcontroller unit designing simple interface hardware and writing subroutines to operate those interfaces

  Design and explain a computer-based simulation model

Design and explain a computer-based simulation model which you will use to estimate the probability that among 25, 50, 75, 100, 500, or 1000 randomly chosen people, at least 2 people share the same birthday.

  Z-transform in matlab

Z-Transform in MATLAB, Sketch the z-plane pole-zero plot and determine the stability status for the following digital system. Determine the h(n) in MatLab.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Compute the eigenvalues and eigenvectors of the matrix

Compute the eigenvalues and eigenvectors of the matrix

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd