Main Content

Calibrate Parameters with Vector CANape

This example shows how to view signals and tune parameters by using Vector CANape®. You must have already completed the steps in Prepare ASAP2 Data Description File.

You also must be familiar with the Vector CANape user interface. For information about the user interface, see the vendor documentation (www.vector.com).

Prepare Project

  1. Build and download the real-time application slrt_ex_osc_cal.

  2. Start the real-time application by selecting REAL-TIME > RUN ON TARGET > Start Application.

  3. Disconnect the connection from MATLAB:

    tg = slrealtime
    disconnect(tg)
    You can now connect to third-party calibration tools.

  4. Open Vector CANape.

  5. Create a Vector CANape project with project name slrt_ex_osc_cal.

    Accept the default folder.

Prepare Device

  1. From the extracted slrt_ex_osc_cal.a2l, create an XCP device named slrt_ex_osc_cal_slrt.

    Do not configure dataset management.

  2. Select your local computer Ethernet adapter as the Ethernet channel.

  3. Accept the remaining defaults.

  4. Upload data from the device.

Configure Signals and Parameters

  1. Open device slrt_ex_osc_cal_slrt, and then open slrt_ex_osc_cal.a2l.

  2. Add signals DampedOsc, SignalGenerator, L_1D, and L_2D in separate display windows.

  3. To make the waveform easier to evaluate, set the time and y-axis scaling.

    For example, try the following settings for DampedOsc:

    • y-axis min home value — –25

    • y-axis max home value — 25

    • Min home time-axis value — 0 s

    • Max home time-axis value — 0.1 s

    • Time duration — 0.1 s

  4. Open the measurement list.

  5. To set the required sample time for a signal, open the measurement properties for the signal. Select the required sample time from the measurement mode list.

    The default sample time is the base sample time.

  6. Add a graphic control on parameter Kg.

Measure Signals and Calibrate Parameters

  1. Start the Vector CANape measurement.

  2. To shorten the ring time on DampedOsc, L_1D, and L_2D, set parameter Kg to 800.

  3. As required, toggle between calibration RAM active and inactive.

When using the Run on Target button on the Simulink Editor Real-Time tab to run the simulation, there is a time lag of a couple of seconds between the start of the real-time application on the target computer and the connect model operation on the development computer. If you are examining signals at or very close to application start, consider using the step-by-step approach to connect model and then using an SSH connection (for example, using PuTTY) start the real-time application. For more information, see Execute Real-Time Application in Simulink External Mode by Using Step-by-Step Commands and Execute Target Computer RTOS Commands at Target Computer Command Line.

Related Topics

External Websites