pm Lab1

Fluid and Mechanical Engineering Systems
Mechatronics
- CONTENTS - INTRODUCTION -
2
- THEORY -
3
CAN COMMUNICATION
Physical Layer/CAN Transceiver
Signals and Messages
Protocol
Bus Parameters
HYDRAULIC VALVE CONTROL
SENSORS
- DSPACE / SIMULINK INTERACTION BASIC STRUCTURE
ANALOGUE AND DIGITAL I/O
CAN
- CONTROLDESK AND SIMULINK ILLUSTRATIONS
Simulink Blocks
Simulink Library Browser
ControlDesk
MEASUREMENTS
OPEN DATA IN MATLAB
- EXERCISES COMMUNICATE WITH THE PUMP.
Exercise 1. Construct a Simulink Model
Exercise 2. Construct an Instrument Panel in ControlDesk
Exercise 3. Connect Simulink with ControlDesk
Exercise 4. Start the Communication
ROTATION AND MEASURING
Exercise 5. Control and Monitoring the Rotation
Exercise 6. Save and filtrate data
-
APPENDIX –
MATLAB’s Main Window
The Complete Instrument panel in ControlDesk
The Complete Simulink Model
APPENDIX A: PRE READING TEST QUESTIONS
3
3
3
4
5
6
7
8
8
8
9
10
10
10
11
12
13
13
14
14
14
15
16
16
17
17
17
18
18
19
20
21
-1-
Fluid and Mechanical Engineering Systems
Mechatronics
- INTRODUCTION -
S
ystem integration is becoming an increasingly common concept in industry. Analysing
the whole system is becoming more important, which involves integration of different
engineering domains. The purpose of this laboration is to show the possibilities of
studying the dynamic properties of a system using a soft- and hardware package named
dSPACE. Signals can easily be collected from the real process – in this case an advanced
narrow-aisle fork lifter (see picture below). The forks are movable both sideways and
rotationally. The signals can then be treated in the software to create control and monitoring
systems for the forks’ movement. The purpose is also to show a mechatronic system and to
study some parts of it, which are rather typical for this kind of systems.
To understand and to be able to ask intelligent questions during the laboration it is very
important to carefully read and try to understand the theory part. It is also important to read
through the exercises, to know what to do during the laboration. There are also some short
manuals to study if you never worked with Simulink or dSPACE before. The appendix
contains some illustrations of the complete model that controls the forks’ movement. There is
also a short explanation of the MATLAB main window.
The left picture below shows the workstation. The picture on the right shows the fork unit,
which can be controlled from the computer.
Figure 1. The pictures are taken in the laboratory on the fork truck. The arrows in the right picture show how
the forks can move.
To make sure you understand what to do during the laboration and have some knowledge
about the system the session starts with a mandatory pre reading test (sv. dugga) with 5
general questions from the laboration manual. All possible questions are shown in Appendix
A. A minimum of 4 correct answers are required to pass the test.
-2-
Fluid and Mechanical Engineering Systems
Mechatronics
- THEORY -
CAN COMMUNICATION
In many applications, components must be able to communicate in real-time during operation.
Each signal has to be transmitted and received with minimum delay and without data loss.
The Controller Area Network (CAN) is a serial communications protocol that supports
distributed real-time control with a high level of reliability. The range of applications for
CAN extends from high-speed networks to low-cost multiplex wiring. Connected via a CAN
bus, each member can transmit and receive the data it requires as and when needed.
The illustration below shows a simple example of a CAN system setup. This example
network complies with the ISO 11898 standard. Each bus member is directly connected to the
bus. A bus member is also called a node of the CAN bus. To terminate the CAN bus, ISO
11898 requires a 120-Ω resistor at both ends of the bus lines.
Figure 2. This CAN bus, according to ISO DIS 11898, consists of two wires (CAN-H and CAN-L) that defines
two voltage levels. CAN-H: High if the bit is dominant (3.5 V), floating (2.5 V) if the bit is recessive. CAN-L:
Low if the bit is dominant (1.0 V), floating (2.5 V) if the bit is recessive.
PHYSICAL LAYER/CAN TRANSCEIVER
The physical implementation of the transmission is called the physical layer (transceiver).
This layer defines the type of wires used for the bus (coaxial, two-wire line, or fiberoptic
cables), the voltage level, and the pulse forms used for 0-bit values and 1-bit values. The
physical layer therefore defines how the messages are actually transported.
SIGNALS AND MESSAGES
Signals
Each bus member is able to transmit and receive data. The pieces of data are called signals,
for example, temperature or pressure. Signals include information for other bus members, or
from other bus members. In CAN networks, several signals may be included in a single
message. This does not refer to the CAN protocol, but is a user convention. The signals
should be incorporated into a message's data field, which is up to 8 bytes long. A signal is
defined by its start bit in the data field and its length in bits. For example, three signals are
incorporated into the data field: pressure (3 bits), temperature (2 bits), and position (4 bits).
The pressure signal starts with bit 0 with a length of 3 bits, the temperature follows with start
-3-
Fluid and Mechanical Engineering Systems
Mechatronics
bit 4 and 2 bits length, and the position may start at bit 10 with a length of 4 bits. Note that not
all bits of the data field need to be used by the signal or arranged in a specified order.
However, the signals must not overlap.
Messages
A message (also called a frame) includes all relevant information for the CAN protocol, like
the start bit, identifier bits, control bits and so on. The identifier of a message contains the
address information. The identifier must be specified by the user. The identifier does not
address individual bus members, but refers to the delivered information. As a result any
number of bus members can receive a message. Each bus member can filter out messages of
interest. The identifier is located in the arbitration field (see figure 3).
Figure 3. Each message is divided into several fields. The most important fields are those for identification and
data. See below for explanations on the fields.
Start of Frame Marks the beginning of the frame and consists of one single dominant bit. All
stations synchronise to the leading edge of the start bit of the station that starts the
transmission first.
Arbitration Field Contains the identifier bits of the message. It is used to arbitrate and
prioritise a message. These bits are transmitted starting with the most significant bit. The
arbitration field ends with the RTR bit (Remote Transmission Request). If this bit is dominant
the message is a transmit message, otherwise the message is a remote.
Control Field 6 bits long, carrying information about the length of the following data field.
Data Field 0 to 8 bytes long, consisting of the data to be transferred.
CRC Field 16 bits long, carrying the Cyclic Redundancy Check (CRC) bits. Each bit before
the CRC field is divided by a polynomial. The remainder of this division is the CRC sequence
transmitted in the CRC field. Using the CRC sequence, each bus member can check whether
the message has been transmitted correctly. The CRC field ends with the single recessive
CRC delimiter bit.
ACK Field (Acknowledge Check) Being two bits long, this field enables the sender to
recognise that the message has been successfully received by at least one other CAN node.
End of Frame Seven recessive bits marking the end of the frame.
PROTOCOL
Each bus member must be able to transmit messages whenever necessary. When using a serial
bus like the CAN, this requires a special protocol that arbitrates the bus allocation. The CAN
bus uses the CSMA/CR protocol (Carrier Sense Multiple Access with Collision Resolution).
Physically, the CAN uses dominant and recessive bits. If two bits meet on the bus (collision),
the dominant bit is transported and the recessive bit is "switched off." Each bus member is
always the transmitter and receiver at the same time. If a member wants to transmit, it must
first determine whether the bus is free. If so, it can start the transmission.
-4-
Fluid and Mechanical Engineering Systems
Mechatronics
The problem is that each signal has a protracted run time, so it is possible for two members to
start their transmission at the same time. This leads to a collision of the messages that were
sent. The CAN protocol solves this problem easily. By placing the identifier at the beginning
of the message, the bus is arbitrated and prioritised with the identifier: Because any CAN
node permanently monitors the bus, the collision is detected when the CAN node transmits a
recessive bit, but instead detects a dominant bit on the bus. It therefore stops the transmission
and the CAN node with the most leading dominant bits will win the arbitration. The lower the
value of an identifier is the higher the priority. This guarantees that the message with the
highest priority is transmitted with a minimum time delay. Important messages should
therefore have high priorities (meaning a small identifier value).
For example, the message of member 1 has the identifier 1010 and the identifier of the
member 2 message is 1001 (se figure 4).
Figure 4. Two signals collide on the bus.
The first two positions are identical. At the third position the dominant bit (value 0, message
2) and the recessive bit (value 1, message 1) overlap. The recessive bit of message 1 turns to
0. The ID of message 1 has changed. Reading back simultaneously what it sent, member 1
recognises that it has lost the bus allocation and stops its transmission.
BUS PARAMETERS
The most important parameter for the bus performance and the bus speed is the baudrate. The
baudrate determines how many bits per second are transported via the bus. The speed of a
CAN may differ in different application systems. However, in a given system the baudrate has
to be uniform and fixed, which means that the same baudrate must be specified for each bus
member.
-5-
Fluid and Mechanical Engineering Systems
Mechatronics
HYDRAULIC VALVE CONTROL
The hydraulic system looks like in figure 5 below. As can be seen, there are four valves that
must be controlled (“on/off-ventil” 2 is not used here). “Propventil 1” controls the flow
direction and quantity for the rotational
movement and “propventil 2” together
with “Riktningsventil” controls the
same for the sideways movement.
“On/Off-ventil 1” is used to connect or
disconnect
the supply system with the
Chockventiler
actuators. In total, there are 6 ports to
control electrically. The pressure in the
Mottryckssystem is limited to 180 bar. The other
ventiler
valves are of less importance for this
laboration, they are different types of
Hydraullås
“safety valves”.
The proportional valves should be
Riktningsventil
controlled with a pulse width
PropPropventil 1
ventil 2
modulated signal (PWM-signal, see
On/Offfigure 6) and the directional and on/off
ventil 2
valve should be fed with direct current
(0 or 48 V). The PWM-signal is a
Prioriteringsventil
square wave with different pulse width
(0-50% high) and the valve gets the
average
value as a sort of “direct
On/Off-ventil 1
current” (0-24 V). The reason by using
a PWM-signal is to avoid static
Tryckbegränsningsventil
friction. When the spool gets the pulse
EM
signal it oscillates very small about its
equilibrium,
small
enough
not
Figure 5. This scheme shows the hydraulic system, which
disturbing the flow.
controls the forks’ movement.
The control signals to the hydraulic
valves are sent from the computer via
[V] U
the dSPACE interface. However,
48
dSPACE cannot produce the required
24
signal power, so the signals have to be
t
amplified. For the proportiona valve
signals this is done by special elecFigure 6. PWM-signal to the proportional valves.
tronic circuit boards, which amplify
and transform the small direct input current to the required PWM-signals. The other signals
are amplified by opto switchers. The amplifier “box” looks as in figure 7 below.
Figure 7. The figure shows the amplifier box between the
computer and the hydraulic valves. The opto switchers
(only 3 is used) are on the left and the electronic circuit
boards (all 3 are used) are on the right. The signals come
from dSPACE at the bottom left and the output signals
are lead out at the upper right.
-6-
Fluid and Mechanical Engineering Systems
Mechatronics
SENSORS
There are different sensors in the system, which require voltage supply, and emit
measurement signals. The voltage supply is provided externally and the measure signals can
then be obtained via the dSPACE interface into Simulink. This sometimes requires some
signal conditioning. The following signals are of interest in this laboration:
• Pressure sensors (4), which measure the pressures before and after the rotation pistons and
hydraulic motor that drives the sideways movement. The sensors are analogously and
their outputs vary between 0 V and 10 V and can be put directly into one of the connectors
on the dSPACE board. They shall be fed externally with ±15 V.
• Position sensors (2), which measure the rotation angle (analogue) and the sideways
position (digital). The analogue signal can be put direct into the dSPACE I/O board but
the digital pulse signal has to be converted first. It is then sent into one of the digital
encoder inputs on the dSPACE I/O board. The digital signal is constructed by two signals,
one indicating the move direction and one the position. The encoder counts the amount of
pulses relative to the end position with an accuracy of ca 2.5 mm. The digital sensor is fed
internally from the dSPACE I/O Board with 5 V and the analogue sensor is fed externally
with 10 V.
• End position sensor (1), which gives a voltage signal (ca 10 V) when the sideways
position stands in one of its two end positions. It also provides the reference value for the
sideways position sensor first time the forks reach their left end position. The measured
signal can be obtained from one of the analogue inputs on the dSPACE board. The sensor
shall be supplied externally with 10 V.
Figure 8. The dSPACE board that handles input and output signals between the computer and the real system.
-7-
Fluid and Mechanical Engineering Systems
Mechatronics
- DSPACE / SIMULINK INTERACTION -
BASIC STRUCTURE
The products from dSPACE are intended
to be used with MATLAB, and especially
Simulink, for real-time applications. A
special hard- and software platform has
been developed for this purpose.
In Simulink you can construct block
diagrams to control signals. These can then
be sent to the real system via the dSPACE
interface (see figure 9). When the block
diagram is created, it can be converted to
C-code by the Real-Time Workshop
toolbox in MATLAB. dSPACE can then
use this C-code via its real-time interface
to create certain data files (for example
*.trc files) and to compile it to the digital
signal processor (DSP). Once the code is
downloaded on the DSP, you can load the
data files from the ControlDesk software
and then use it to create virtual intstrument
panels. You can also change parameter Figure 9. Function diagram for dSPACE and
MATLAB.
values in real-time very easily. During the
simulation, data can be stored to a file and
later be analysed in MATLAB. The DSP communicates with the real system via an I/O board
(figure 8) with different connectors.
ANALOGUE AND DIGITAL I/O
The dSPACE I/O Board has several input and output connectors, which handle different
measurement and control signals. Those interesting in this laboration are the digital and
analogue connections. Different digital signals can be handled, such as serial communication
and encoders. The encoders, which are used here, receive the sideways measure signal from
the digital position sensor. The signals shall be connected and treated in a certain way, but the
details are not important for this laboration.
The analogue signals can vary between ±10 V if they are connected to the right input
channels. The connectors are of type co-axial (BNC type). Those signals handled on the truck
are all in the limited range so they can be put directly into the dSPACE I/O Board.
-8-
Fluid and Mechanical Engineering Systems
Mechatronics
CAN
In Simulink there are pre-defined blocks (located in RTI CAN Blockset), which can be used
to establish a CAN communication. Those interesting in this laboration are:
• CAN Controller Setup
Here the baudrate and sample mode are specified and the CAN protocol is established (if a
certain information file is used, named *.dbc, as it is in this laboration). See figure 10.
• Transmit (TX)
This block handles the message that shall be sent to the CAN bus. The message is
transmitted with a specific identifier. The transmit message can carry up to 8 bytes of data.
To specify the messages the *.dbc-file is loaded into the setup window of the transfer
block. Then one of all the signals that can exist on the bus can be chosen from a list. They
are also completely specified (start bit, message length, …). Only one message can be
chosen in one transfer block. See figure 11.
• Receive (RX)
This block handles the message that can be read from the CAN bus. A receive message is
set up to transfer the incoming data from the CAN controller to the master processor. To
see which signals are available on the CAN bus the *.dbc-file is loaded into the setup
window of the transfer block. Then all the signals that can exist on the bus can be chosen
from a list. They are also completely specified (start bit, message length, …). Only one
message can be chosen in one receive block.
Figure 10. Can Controller Setup.
Figure 11. Transmit (Receive) message setup.
-9-
Fluid and Mechanical Engineering Systems
Mechatronics
- CONTROLDESK AND SIMULINK -
ILLUSTRATIONS
SIMULINK BLOCKS
Figure 12. The Simulink block that send
signals to the CAN bus (transmit).
Figure 14. Analogue input block.
Figure 13. The Simulink block that read
signals from the CAN bus (receive).
Figure 15. Digital input block.
Figure 16. One example of implementing a start and stop function in Simulink. When start=1 the speed is sent to
the CAN bus and when start=0 no speed is sent to the motor.
- 10 -
Fluid and Mechanical Engineering Systems
Mechatronics
SIMULINK LIBRARY BROWSER
1
2
3
Figure 17.
4
Number
1
2
3
4
5
5
Description
Creates a new Simulink model
Ordinary Simulink blocks, for example mathematical operations and constant sources
Available blocks in the marked group
dSPACE interface blocks (analogue and digital)
dSPACE CAN interface blocks
- 11 -
Fluid and Mechanical Engineering Systems
Mechatronics
CONTROLDESK
1
2
3
4 5
6
7
Figure 18.
Number
1
2
3
4
5
6
7
8
- 12 -
Description
Available parameters in a list (can be loaded with a *.trc file)
Instrument board (Layout), where the instruments are placed
Parameters appear here. Drag it to the instrument that shall display it.
Start simulation
Stop simulation
Edit mode (construct the instrument panel in this mode)
Animation mode (simulation mode)
Pre defined instrument panel (click on an instrument and draw a box on the layout)
8
Fluid and Mechanical Engineering Systems
Mechatronics
MEASUREMENTS
To measure signals in ControlDesk and save the data into a file a special measure instrument
is prepared, named Capture Settings. From there you can specify how the measurements shall
be performed. They can for example start with a trigger signal or manually, and the measure
and sample time can be specified. You can for instance use a sample time of 0.01 s (set the
downsampling parameter to 10, which equals 10 times the sample time used by Simulink) and
a total measure time of 10 s. If you use autosave to save the data (default in exercise 7), be
sure to rename the file before doing the next measurement, otherwise the file is overwritten.
The data is saved as a data structure in MATLAB.
OPEN DATA IN MATLAB
A data structure file in MATLAB is built up of several “boxes” that contain different data.
The boxes can be built up of new boxes. To look down in the structure just write the names of
the “boxes” separated by a dot (“.”). To see the boxes names just write the name of the data in
the command window and push enter.
The names of the parameters saved in the data file can be shown by writing:
>>’Datafile’.Y.Name
The signals are showed in that order the numerical data is saved in the “data box”. The first
name is data #1 and the second #2 and so on.
To reach the second data in the data file you can write:
>>’Datafile’.Y(2).Data
You can save the numerical data into another variable name in MATLAB command window
to make it more convenient to write.
The time vector can be reached from:
>>’Datafile’.X.Data
- 13 -
Fluid and Mechanical Engineering Systems
Mechatronics
- EXERCISES -
COMMUNICATE WITH THE PUMP.
EXERCISE 1. CONSTRUCT A SIMULINK MODEL
• Create a new simulink model in Simulink Library Browser.
The pump is controlled by the electrical pump motor, which communicate with its
surroundings via a CAN interface. The task is to set up this communication in dSPACE and
be able to send data to the pump motor.
• Use the RTI CAN Blockset in Simulink to communicate with dSPACE (see figures
10-13 and 17). Use the CAN Controller Setup and set the baudrate to 125 kbit/s.
Under Data File Support the CAN protocol containing all available messages on the
bus can be loaded from a file named BT_DB.dbc (use the default interface file).
• The signals on the CAN bus can be loaded from a list in the Transmit and Receive
blocks, the interesting signals are 489 for receiving and 488 for transmitting data
from/to the pump motor. Use the time values in figure 19 in the transmit block
setup.
Figure19. Correct timings for the transmit block
The parameters, which should be sent to the pump motor from Simulink, are:
• Speed, set to 200 rpm (start value)
• Torque, set to 255 (physical value 0-5000)
• Setstatus0, set to 79 (status check)
• Setstatus1, set to 0 (status check)
(Use blocks in the simulink library to set the values that are to be sent/received to/from the
CAN. Name the blocks smart, they will be mirrored in the Control Desktop!)
When handling signals in Simulink from the CAN bus a scale factor has to be used if physical
values of the parameters (here the interesting signal is speed) should be read. The signal sent
to / read from the CAN bus can only vary in the range 0-255 but the physical values can be
larger. Therefore use the following scale factor for the speed:
• Transmit: 0.06375
• Receive: 15.686
- 14 -
Fluid and Mechanical Engineering Systems
Mechatronics
The interesting signals to read from the CAN bus is the speed (scaled) and the status
variable BitStatus0. All other parameters out from the transmit and receive blocks should be
connected to a terminator block (located in Simulink – Signals and systems).
• Now implement some possibility to start and stop the pump motor (for example
like in figure 16). The default value shall be stop and then one shall be able to
change state in ControlDesk.
• For not getting to high pump pressure the “On/Off-ventil 1” in figure 5 shall be open
when the pump runs. It shall open immediately when the pump starts but remain
open for about a second when the pump is running out when it is turned off. The
DAC set to CH#6 (DAC (Digital to Analogue Converter) is found under dSPACE
RTI in the simulink library) on the dSPACE board is used to control the “On/Offventil 1”. The signal value should be 0.5 for open and 0 for closed valve.
(TIP! Use a block in the library that limits how fast the signal can change its value)
• Save your model in a new folder, but don’t close it. You will need it in exercise 3.
EXERCISE 2. CONSTRUCT AN INSTRUMENT PANEL IN CONTROLDESK
Using the basic functions in ControlDesk is very simple. Start ControlDesk by double
clicking on the icon on the desktop. The main window looks like in figure 18. On the right
side the pre-defined instruments are located. When a new virtual instrument panel shall be
created in ControlDesk you first need a “layout”.
• To create a new one, follow the link File-New-Layout.
• To create a new instrument, first click on one of the pre-defined ones and then draw a
square on the layout. By double clicking on the instrument you can change properties
for the instrument. To remove an instrument, just mark it and push the delete button.
Try drawing different instruments that can show variables and then keep one of them
on the board.
• Change its range (properties menu) to 0-500 (the scales can also be changed to make it
easier to read).
• Use radio buttons to the start/stop function. Change the button captions and set button
1 to 0 (stop) and button 2 to 1 (start).
• After that draw a numerical display instrument (no need to change any properties).
• Draw a numeric input instrument for the pump speed that shall be sent to the pump
motor. When using numeric input it’s easy to change numeric values in ControlDesk.
• Finally use a display to see the signal to the “On/Off-ventil 1”. Other instruments can
be used for the same purpose though (if you like).
• Save your layout in your folder by following File-Save.
- 15 -
Fluid and Mechanical Engineering Systems
Mechatronics
EXERCISE 3. CONNECT SIMULINK WITH CONTROLDESK
First the Simulink model has to be C-coded with Real-Time Workshop and then loaded on the
DSP. Open your finished Simulink model and change (follow the link Simulation –
Simulation Parameters):
• The simulation stop time to inf
• The solver type to fixed-step and for example use the Runge-Kutta method
• The step size to 0,001 s (Simulink sampling time)
Also change MATLAB’s working directory to the folder you created in exercise 1 (see figure
A1).
Now follow the link Tools - Real-Time Workshop - Build Model in Simulink (Ctrl+B). When
the coding is finished, switch to the ControlDesk window.
• Load the parameter information file into ControlDesk by following File-Open
Variable File and there chose ‘Model Name’.trc (look in your folder). If prompted,
assign the board to this application.
• All signals and parameters in the Simulink model are now available in the bottom
window by double clicking on Model Root.
• To make the instrument show a parameter’s value the instrument needs to be
connected to the signal. To connect an instrument to a signal, just find the signal in the
list and then drag the parameter (in the list on the right) and drop it onto the right
instrument. If the variable begins with a “P” it means you can change its value in realtime in ControlDesk, otherwise you can only read its value. The red border around the
instrument should now vanish.
• (To look at or change the connections of an instrument, just right-click on the
instrument and chose Edit Data Connections.)
Connect the right signals to the instruments respectively. Finally connect the parameter
BitStatus0’s read value to the display.
• Save your work by creating a new experiment (File - New Experiment) in your
folder.
• File – Add All Opened Files and finally choose File – Save Experiment (Not FileSave!! In that case only the layout is saved).
EXERCISE 4. START THE COMMUNICATION
To start the simulation, follow these steps in the right order (important):
1. Start the simulation in ControlDesk by clicking on the green play icon in the top icon
menu (figure 18, #4) if it’s not already activated. Stay in edit mode.
2. Start the truck with the start key.
3. Put in the CAN connector on the board.
4. Switch to animation mode. It’s ok to drive if the BitStatus0 is equal to 5 or 13. If it is 6
everything has to be turned off and the procedure repeated from step 1.
Can you send a pump speed to the pump motor and read the same speed from the CAN bus?
- 16 -
Fluid and Mechanical Engineering Systems
Mechatronics
ROTATION AND MEASURING
EXERCISE 5. CONTROL AND MONITORING THE ROTATION
Open the simulink model Rotation.mdl in folder “your group folder” and build the model in
C-code by pressing CTRL+B. Construct an instrument panel in ControlDesk.
• Display the sensor signals that are defined in “Från systemet via dSPACE” in the
simulink model.
• Add a Slider for controlling rotation (set range from -5 to 5).
• Add Numerical input for controlling pump speed
• Add Radiobutton for turning pump on.
• Add Radiobutton for turning rotation on.
• Under Data acquisition add Capture Setting and PlotterArray for recording data.
Test to rotate the forks. Use some simulink blocks to make the start and stop smoother and to
reduce the speed just before the mechanical stops.
EXERCISE 6. SAVE AND FILTRATE DATA
Rotate the forks and save pressure and rotation angle signals. Open the m-file Plotta2.m in
your folder. Run it to plot the saved data.
- 17 -
Fluid and Mechanical Engineering Systems
Mechatronics
- APPENDIX –
MATLAB’S MAIN WINDOW
1
2
4
Figure A1.
Number
1
2
3
4
- 18 -
Short description
Displays all current variables defined in MATLAB
Opens the Simulink library
Change current directory
Displays all MATLAB files in current directory
3
Fluid and Mechanical Engineering Systems
Mechatronics
THE COMPLETE INSTRUMENT PANEL IN CONTROLDESK
1
2 3
13
14
4
5
15
6
16 17
7
8
9
10 11
12
18
19 20
21 22
Number
12
13
14
15
16
17
18
19
20
21
22
Short description
Pressure signals (rotation)
Actual pump speed
Hydraulic valves (sideways)
Pump flow
Position sensor (sideways)
Gain coefficients for pres. feedback
On/Off valve in main block
Change the pump set speed *
Slow drive indicator (=1 in slow)
Measurement tool
Position sensor (rotation)
Figure A2.
Number
1
2
3
4
5
6
7
8
9
10
11
Short description
Pressure signals (sideways)
Initiation parameter
End position sensor (=1 at the end)
Slow drive indicator (=1 when slow)
Initiation done (=1; =0 no reference)
Sideways movement lever
BitStatus0 (OK when 5 or 13)
Starts the simultaneous movement
Starts the pressure feedback
Rotational movement lever
Hydraulic valves (rotation)
* When driving simultaneously it’s the total speed that matters (nr+nt).
- 19 -
Fluid and Mechanical Engineering Systems
Mechatronics
THE COMPLETE SIMULINK MODEL
1
2
3
8
4
9
5
6
7
10
11
12
Figure A3.
Number
1
2
3
4
5
6
- 20 -
Short description
Manual lever signals (rotation)
Manual lever signals (sideways)
Automatic control signal chooser
Limits and adjust control signals
Digital input setup
CAN controller setup
Number
7
8
9
10
11
12
Short description
Send signals to dSPACE I/O Board
Measured signals from I/O Board
Handles simultaneous movements
Pressure feedback
Convert signals to right levels
Send signals to the CAN bus
Fluid and Mechanical Engineering Systems
Mechatronics
APPENDIX A: PRE READING TEST QUESTIONS
•
•
•
•
•
•
•
•
How does the pump communicate with its surroundings?
What is the hard and software interface between the computer and the real system
called?
What is a PWM-signal?
In what direction(s) can the truck move its forks?
What is ControlDesk and give a brief and general explanation of what you can do in
ControlDesk?
Which types of signals control the hydraulic valves in the forklift (2)?
Which types of sensors are available on the forklift (3)?
Explain how Simulink is connected to ControlDesk!
- 21 -