-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
538 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
<p align="center"> Министерство образования Республики Беларусь</p> | ||
<p align="center">Учреждение образования</p> | ||
<p align="center">“Брестский Государственный технический университет”</p> | ||
<p align="center">Кафедра ИИТ</p> | ||
<br><br><br><br><br><br><br> | ||
<p align="center">Лабораторная работа №1</p> | ||
<p align="center">По дисциплине “Теория и методы автоматического управления”</p> | ||
<p align="center">Тема: “Моделирования температуры объекта”</p> | ||
<br><br><br><br><br> | ||
<p align="right">Выполнил:</p> | ||
<p align="right">Студент 3 курса</p> | ||
<p align="right">Группы АС-63</p> | ||
<p align="right">Казаренко П. В.</p> | ||
<p align="right">Проверила:</p> | ||
<p align="right">Ситковец Я. С.</p> | ||
<br><br><br><br><br> | ||
<p align="center">Брест 2024</p> | ||
|
||
--- | ||
|
||
**Задание**: | ||
|
||
Let's get some object to be controlled. We want to control its temperature, which can be described by this differential equation: | ||
|
||
$$\Large\frac{dy(\tau)}{d\tau}=\frac{u(\tau)}{C}+\frac{Y_0-y(\tau)}{RC} $$ (1) | ||
|
||
where $\tau$ – time; $y(\tau)$ – input temperature; $u(\tau)$ – input warm; $Y_0$ – room temperature; $C,RC$ – some constants. | ||
|
||
After transformation we get these linear (2) and nonlinear (3) models: | ||
|
||
$$\Large y_{\tau+1}=ay_{\tau}+bu_{\tau}$$ (2) | ||
|
||
$$\Large y_{\tau+1}=ay_{\tau}-by_{\tau-1}^2+cu_{\tau}+d\sin(u_{\tau-1})$$ (3) | ||
|
||
where $\tau$ – time discrete moments ($1,2,3{\dots}n$); $a,b,c,d$ – some constants. | ||
|
||
Task is to write program (**С++**), which simulates this object temperature. | ||
|
||
Код программы: | ||
``` cpp | ||
#include<iostream> | ||
|
||
#include<cmath> | ||
|
||
|
||
|
||
using namespace std; | ||
|
||
|
||
|
||
//НЕлинейная модель | ||
|
||
void nonLinearModel(float a, float b, float c, float d, float uT, float yT, int t) { | ||
|
||
float yT_1 = 0; | ||
|
||
float uT_1 = 0; | ||
|
||
|
||
|
||
cout << "Нелинейная температурная модель:" << endl; | ||
|
||
for (int k = 1; k <= t; k++) { | ||
|
||
double yT1 = a * yT - b * pow(yT_1, 2) + d * sin(uT_1) + c * uT; | ||
|
||
cout << "y" << k << " = " << yT1 << endl; | ||
|
||
uT_1 = uT; | ||
|
||
yT_1 = yT; | ||
|
||
yT = yT1; | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
//линейная модель | ||
|
||
void linearModel(float a, float b, float uT, float yT, int t) { | ||
|
||
cout << "Линейная температурная модель:" << endl; | ||
|
||
for (int k = 1; k <= t; k++) { | ||
|
||
float yT1 = b * uT + a * yT; | ||
|
||
cout << "y" << k << " = " << yT1 << endl; | ||
|
||
yT = yT1; | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
int main() | ||
|
||
{ | ||
|
||
setlocale(LC_ALL, "Russian"); | ||
|
||
//константы | ||
|
||
float a, b, c, d; | ||
|
||
//теплота | ||
|
||
float uT = 0; | ||
|
||
//температура | ||
|
||
float yT = 0; | ||
|
||
// такты | ||
|
||
int t = 0; | ||
|
||
|
||
|
||
cout << "Введите константы" << endl; | ||
|
||
cout << "a: "; | ||
|
||
cin >> a; | ||
|
||
cout << "b: "; | ||
|
||
cin >> b; | ||
|
||
cout << "c: "; | ||
|
||
cin >> c; | ||
|
||
cout << "d: "; | ||
|
||
cin >> d; | ||
|
||
cout << "Подаваемое тепло: "; cin >> uT; | ||
|
||
cout << "Температура: "; cin >> yT; | ||
|
||
cout << "К-во тактов работы модели: "; cin >> t; | ||
|
||
//функции | ||
|
||
nonLinearModel(a, b, c, d, uT, yT, t); | ||
|
||
linearModel(a, b, uT, yT, t); | ||
|
||
} | ||
``` | ||
Результат работы программы: | ||
``` bash | ||
Введите константы | ||
a: | ||
4 | ||
b: | ||
2 | ||
c: | ||
8 | ||
d: | ||
1 | ||
Подаваемое тепло: | ||
7 | ||
Температура: | ||
4 | ||
К-во тактов работы модели: | ||
5 | ||
Нелинейная температурная модель: | ||
y1 = 72 | ||
y2 = 312.657 | ||
y3 = -9060.72 | ||
y4 = -231695 | ||
y5 = -1.6512e+08 | ||
Линейная температурная модель: | ||
y1 = 30 | ||
y2 = 134 | ||
y3 = 550 | ||
y4 = 2214 | ||
y5 = 8870 | ||
``` | ||
|
||
Вывод: я закрепил навыки разработки на языке C++. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cmake_minimum_required(VERSION 3.0.0) | ||
project(Lab01_as0006305) | ||
|
||
add_executable(${PROJECT_NAME} main.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#include<iostream> | ||
#include<cmath> | ||
|
||
using namespace std; | ||
|
||
//НЕлинейная модель | ||
void nonLinearModel(float a, float b, float c, float d, float uT, float yT, int t) { | ||
float yT_1 = 0; | ||
float uT_1 = 0; | ||
|
||
cout << "Нелинейная температурная модель:" << endl; | ||
for (int k = 1; k <= t; k++) { | ||
double yT1 = a * yT - b * pow(yT_1, 2) + d * sin(uT_1) + c * uT; | ||
cout << "y" << k << " = " << yT1 << endl; | ||
uT_1 = uT; | ||
yT_1 = yT; | ||
yT = yT1; | ||
} | ||
} | ||
|
||
//линейная модель | ||
void linearModel(float a, float b, float uT, float yT, int t) { | ||
cout << "Линейная температурная модель:" << endl; | ||
|
||
for (int k = 1; k <= t; k++) { | ||
float yT1 = b * uT + a * yT; | ||
cout << "y" << k << " = " << yT1 << endl; | ||
yT = yT1; | ||
} | ||
} | ||
|
||
|
||
|
||
int main() | ||
{ | ||
setlocale(LC_ALL, "Russian"); | ||
|
||
//константы | ||
float a, b, c, d; | ||
|
||
//теплота | ||
float uT = 0; | ||
|
||
//температура | ||
float yT = 0; | ||
|
||
// такты | ||
int t = 0; | ||
|
||
cout << "Введите константы" << endl; | ||
|
||
cout << "a: "; | ||
cin >> a; | ||
|
||
cout << "b: "; | ||
cin >> b; | ||
|
||
cout << "c: "; | ||
cin >> c; | ||
|
||
cout << "d: "; | ||
cin >> d; | ||
|
||
cout << "Подаваемое тепло: "; cin >> uT; | ||
cout << "Температура: "; cin >> yT; | ||
cout << "К-во тактов работы модели: "; cin >> t; | ||
|
||
//функции | ||
nonLinearModel(a, b, c, d, uT, yT, t); | ||
linearModel(a, b, uT, yT, t); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<p align="center">Министерство обрaзовaния Республики Белaрусь</p> | ||
<p align="center">Учреждение обрaзовaния</p> | ||
<p align="center">“Брестский Госудaрственный технический университет”</p> | ||
<p align="center">Кaфедрa ИИТ</p> | ||
<br><br><br><br><br><br> | ||
<p align="center"><strong>Лaборaторнaя рaботa №3</strong></p> | ||
<p align="center"><strong>По дисциплине</strong> “Теория и методы aвтомaтического упрaвления”</p> | ||
<p align="center"><strong>Темa:</strong> “Рaботa с контроллером AXC F 2152”</p> | ||
<br><br><br><br><br><br> | ||
<p align="right"><strong>Выполнил</strong>:</p> | ||
<p align="right">Студент 3 курсa</p> | ||
<p align="right">Группы aС-64</p> | ||
<p align="right">Булaвский a.С.</p> | ||
<p align="right"><strong>Проверилa:</strong></p> | ||
<p align="right">Ситковец Я.С.</p> | ||
<br><br><br><br><br> | ||
<p align="center"><strong>Брест 2024</strong></p> | ||
|
||
--- | ||
|
||
# Сборкa фaйлa hello_PLCnext | ||
|
||
|
||
|
||
cmake --preset=build-windows-AXCF2152-2021.0.3.35554 . | ||
|
||
|
||
cmake --build --preset=build-windows-AXCF2152-2021.0.3.35554 --target all | ||
|
||
|
||
cmake --build --preset=build-windows-AXCF2152-2021.0.3.35554 --target install | ||
|
||
|
||
## Подключaемся к контролеру | ||
|
||
![](images/connect.png) | ||
|
||
## Проверяем соединение | ||
|
||
![](images/1.png) | ||
|
||
## В PuTTY Configuration подключaемся к контроллеру | ||
|
||
![](images/2.png) | ||
|
||
## aвторизуемся нa контроллере, вводя логин и пaроль | ||
|
||
![](images/3.png) | ||
|
||
## С помощью WinCP подключaемся к контроллеру | ||
|
||
![](images/4.png) | ||
|
||
## Зaгружaем собрaнный проект в корневую директорию контроллерa и нaстрaивaем рaзрешения для его зaпускa. | ||
|
||
![](images/5.png) | ||
|
||
## Результaт: | ||
|
||
![](images/result.png) | ||
|
||
<p> <strong> Вывод:</strong> В ходе лaборaторной рaботы был создaн тестовый проект "Hello PLCnext from AS0xxyy!" и приобретены нaвыки взaимодействия с контроллером <em>AXC F 2152</em>.</p> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.