Lab objectivesuse matlab and labjack to acquire

Assignment Help Applications of MATLAB
Reference no: EM13371388

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: EM13371388

Questions Cloud

1 search the web mainly ieee and acm publication databases : 1. search the web mainly ieee and acm publication databases to find a recent article on a biomedical application using
If the inverse demand curve is p 120 - q and the marginal : if the inverse demand curve is p 120 - q and the marginal cost is constant at 10 how does charging the monopoly
Questions of strategic management q1- conduct a general : questions of strategic management q1- conduct a general swot analysis for the sabic company showing your
Two insulated charge cu spheres a and b of identical size : two insulated charge cu spheres a and b of identical size have charge qa and -3qa when they are brought in contact with
Lab objectivesuse matlab and labjack to acquire : lab objectivesuse matlab and labjack to acquire digital inputs from limit switchesuse matlab and labjack to
Task design and implement 2 projects for the falling : task design and implement 2 projects for the falling letters game using c and windows presentation foundation wpf
Andrea corbridge is considering forming a portfolio : andrea corbridge is considering forming a portfolio consisting of kalama corp. and adelphia technologies.nbsp the two
1 find the currents i1 and i2 for the following circuit : 1. find the currents i1 and i2 for the following circuit given the values shown in the table below. the operating
Keyboards microphones and mice have generally been used as : keyboards microphones and mice have generally been used as the standard input devices for most computer systems. the

Reviews

Write a Review

Applications of MATLAB Questions & Answers

  Design and synthesis of continuous time

design and synthesis of continuous time controllers.2.learning outcomes covered 1 use matlab and simulink to model and

  Please write project report and provide cross-synthesis an

please write project report and provide cross-synthesis. an interesting effect in electronic music synthesis is to

  You will write functionsbull bnull basisatolbull brange

you will write functionsbull bnull basisatolbull brange basisatolthe function null basis takes a matrix a as input and

  Doctors record heart sound signals from patients in

doctors record heart sound signals from patients in hospitals in an environment in which many background noises occur.

  Problem consider a trapezoidal piece of polymer film as

problem consider a trapezoidal piece of polymer film as shown below. the parallel sides of the trapezoid are insulated

  Write a computer program to prepare a linear support vector

write a computer program to prepare a linear support vector machine svm. your program could be able to incorporate and

  1 given the following actual cpu burst for a tasknbsp 6 4 6

1. given the following actual cpu burst for a tasknbsp 6 4 6 4 13 13 13 and an initial best guess at the burst as 10

  1 this problem is intended to demonstrate some problems

1. this problem is intended to demonstrate some problems that can arise from the finite precision of numerical

  1 we know that there is a symmetry in the rod so the point

1. we know that there is a symmetry in the rod so the point at 0.2 must be equal to the point at 0.8 but the output was

  Matlab ndash discrete time simulationquestion 1 discrete

matlab ndash discrete time simulationquestion 1 discrete time system is given in attachment write a matlab m file to

  Qestion evaluate e-5 using two approachese-x 1 ndash x

question evaluate e-5 using two approachese-x 1 ndash x x22 ndashx33-----ande-x 1exnbsp 11xx22 x33

  1 find the currents i1 and i2 for the following circuit

1. find the currents i1 and i2 for the following circuit given the values shown in the table below. the operating

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