Chirp Capture of LUGE Slide Dynamics using dSPACE

-Instructions-

Please follow the instructions exactly to avoid injury and/or damage to the equipment.

  • All connections have been made. Avoid changing them or wiggling the wires.
  • The iDrive software will be ready. DO NOT CHANGE ANY SETTINGS EXCEPT PER INSTRUCTIONS.

I. Familiarize yourself:

The Remote Control – Profile Positioning Mode window shows three target positions:

185000: corresponds to slide center

-190000: corresponds to motor and connector end (937.5/2 mm from center)

560000: corresponds to opposite end (937.5/2 mm from center)

The useful travel is 937.5 mm.

  1. Stand clear of the slide, keep clothes, jewelry and long hair away!
  2. Press Goto Position -1900000.
  3. Press Goto Position 560000
  4. Press Stop
  5. Change the velocity to 5000 rpm (stand clear!!)
  6. Press Goto Position -190000
  7. Press Stop
  8. Change the velocity back to 3000 rpm
  9. Press Goto Position 185000
  10. Press Stop
  11. In the block diagram, click on Ref Source and change to Analogue Input. The slide is ready to take velocity input commands via analog input.

II. Prepare dSPACE interface:

  1. Start Control Desk
  2. Start MatlabR12
  3. Create a directory in the E-drive under dSPACE_proj for the your project.
  4. Open Simulink. Create a blank model and save it in your directory.
  5. Find the dSPACE RTI11003 library expand the DS1103 Master PPC library.
  6. Place the following blocks in your diagram:
  7. DS1103DAC_C1 (digital-to-analog block to send signal to analog input of plant). Check that BNC cable is connected to appropriate terminal. Double-click and check “set to 0V” in the Termination tab. This says that the analog input to the plant will be set to zero at the end of the run.
  8. DS1103ENC_SETUP (general settings for encoder sensor). Check that cable is connected to Inc1 terminal and leave block settings at default.
  9. DS1103ENC_POS_C1 (reads the encoder position signal). Leave block settings at default. Cascade a gain block to the output and set the gain to 1/200. The output of this block will be the position in millimeters relative to the initial physical position of the slide. The negative axis points to the motor end.
  10. Chirp from the Sources menu in Simulink. Connect the chirp to the input of DS1103DAC_C1. NOTE: The dSPACE DAC’s multiply by 10. Therefore, the chirp (which is always +/-1) will result in an analog voltage of +/-10 applied physically to the system. Place a gain block taking the chirp as input. Set the gain to 10. Set the chirp to sweep from 1 to 40 Hz in 30 seconds.
  11. Terminate all blocks with “To Workspace” sinks. (these are dummy, the variables will not go to the Workspace.
  12. Double-click on the line connecting the gain of 10 block to the sink and enter the label “u”.
  13. Double-click on the line connecting the encoder position to its sink and enter “pos_mm” as a label.
  14. Go to Simulation Parameters and specify a fixed-step solver with a stepsize of 1e-4. Set the stop time to 30 seconds (same as the chirp duration). Change to the Real-Time Workshop tab and type SSTATE=STOP next to make_rti (leaving a space). Apply and close the dialog.

Save the Simulink model. It should look like this:

Return to Control Desk.

  1. Create a new experiment and save it in your project directory (set the working root to that directory)
  2. Create a new layout (New…) and add the following:

-Two plotters side-by-side, from the Data Acquisition tab.

-A Capture Settings box

-A Radio Button from the Virtual Instruments tab.

Save the layout in your working directory.

  1. Go to File.. and click on “Add all opened files”
  2. Return to Simulink and go to Simulation Parameters/Real-Time Workshop and build the model. Accept the defaults in the dialog that pops up.
  3. Go to Control Desk. At the end of the compilation, you will see a new directory created under yours, containing an “sdf file”. Add all opened files once more.
  4. Drag and drop simState from the variable browser under your project hierarchy onto the Radio Button in your layout.
  5. Find Model Root under your project hierarchy and drag and drop the variables “u” and “pos_mm” onto each plotter in the layout.
  6. Double-click in Capture Settings and select PPC “yourprojectname” Host Service from the Capture list. Uncheck “Auto Repeat”. Set the length of the capture to 30 seconds. Then place a check on the variables “u” and “pos_mm” under Signals.
  7. Double-click on the “u” plotter and set the x-axis to a fixed 0-30 interval (you need to completely delete the default setting). Set the y-axis to -10 to 10.
  8. Do the same for the “pos_mm” plotter and set it to -200 to 200.
  9. Double-click on the Radio Button and edit the labels to become STOP with a value of 0 and RUN with a value of 2 (not 1).

III. Run the Capture:

Save and change to Animation Mode by clicking on the icon to the left of the running guy.

  • Double-check that iDrive is set to Ref Source / Analog Input
  • Double-check that the slide is at position 185000 (the middle)
  • Press Run on the iDrive amplifier. The display will change to 23.
  • Stand clear of the slide, keep clothes, jewelry and long hair away!
  • Press run in Control Desk. Be ready to hit STOP in the iDrive amplifier in case of error.
  • When the test is complete, press STOP in the iDrive.
  • Save the capture to .mat file in your working directory

NOTES:

  • If you need to repeat the run, go to the iDrive software and use the Profile Positioning Mode to return the slide to position 185000, due to drift. (accept the change to remote mode). After the slide has positioned, press Stop in the iDrive software (in Profile Positioning Mode). Then re-select Ref Source in the block diagram to Analogue Input.
  • The drift is not an error, it is part of the dynamics in velocity mode (pole very close to the origin).