-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstall-linux.txt
161 lines (102 loc) · 5.36 KB
/
install-linux.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Installing on Linux
===================
Copyright David A.W. Barton ([email protected]) 2015.
All of the associated source code and documentation is released under the MIT
license.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Overview
--------
This document describes how to build firmware for the real-time controller,
install suitable device drivers for the real-time controller and use it with
Matlab.
It is not necessary to build the firmware if you have already have suitable
firmware to use.
To build the real-time controller firmware (optional)
-----------------------------------------------------
1. Download GCC ARM compiler from
<https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/>.
* Any recent version (i.e., post 2013) should work. Probably even ones
earlier than that will work as well.
2. Install ARM compiler and add it to your path.
3. Install Git and Make via your system package manager.
* Fedora: `sudo yum install git make`.
* Ubuntu/Debian: `sudo apt-get install git build-essential`.
4. Clone the necessary repositories from [GitHub](http://github.com/db9052/).
git clone https://github.com/db9052/rtc rtc
cd rtc
git clone https://github.com/db9052/starterware starterware
5. Build TI Starterware.
cd build
make starterware
cd ..
6. Build the rig of your choice, e.g., duffing_numerical for a simple test
cd rigs/duffing_numerical
make
7. Put the resulting `.bin` file on a micro SD card as app.bin. There should
also be a file called `uEnv.txt` on the SD card which contains the following
text (only).
uenvcmd=mmcinfo;fatload mmc 0 0x80000000 app.bin; go 0x80000000
Once you have done all this once, you only need to repeat steps 6 and 7 to
compile new versions of your firmware.
Device drivers for the USB interface to the real-time controller
----------------------------------------------------------------
1. Copy `rtc/udev/90-rtc.rules` to `/etc/udev/rules.d/90-rtc.rules`.
* You may need to run `udevadm control --reload-rules` to force udev to
reload its rules.
2. Install libusb via your system package manager.
* Fedora: `sudo yum install libusb`.
* Ubuntu/Debian: `sudo apt-get install libusb`.
2. The real-time controller is now ready for use with Matlab.
To use the real-time controller in Matlab
-----------------------------------------
1. Make sure that you have a suitable compiler for using the Matlab mex
function. (Check the output of `mex -setup`.) Then compile the MEX functions
using the compile_mex function in `controlcont/rtc/matlab`.
* A suitable (free) compiler is gcc which is installable via your system
package manager.
2. Start Matlab.
3. Add `controlcont\rtc\matlab` to the Matlab path (`help addpath`).
4. Add the appropriate rig directory to the Matlab path, e.g.,
`controlcont\rtc\rigs\duffing_numerical`.
5. Create the interface to the controller with
rtc = duffing_numerical_interface()
6. All the controller parameters are available through
`rtc.par.<variable name>`.
7. Time series data can be collected through the use of streams; see the help
for `rtc.set_stream`, `rtc.run_stream`.
* By default, 5 different streams (0-4) are available for use.
* The maximum amount of data a stream can return is around 8 MB. If too much
data is requested, the stream recording will refuse to start.
Note: this assumes that a rig specific interface is used to set default
parameters. This is not necessary and the generic rtc_interface can be used
instead if desired.
To use the real-time controller in Python (2.x or 3.x)
------------------------------------------------------
1. Start Python.
2. Import the Python module and create the interface to the controller with
import rtc_interface
rtc = rtc_interface.rtc_interface()
3. All the controller parameters are available through
`rtc.par.<variable name>`.
4. Time series data can be collected through the use of streams; see the help
for `rtc.set_stream`, `rtc.run_stream`.
* By default, 5 different streams (0-4) are available for use.
* The maximum amount of data a stream can return is around 8 MB. If too much
data is requested, the stream recording will refuse to start.
Note: if desired, rig specific interfaces for Python can be created in much the
same way as for Matlab.
<!-- pandoc -s install-linux.txt -o install-linux.html -->