-
Notifications
You must be signed in to change notification settings - Fork 0
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
Stevedan Ogochukwu Omodolor
committed
Jul 4, 2020
1 parent
287362c
commit bd14a76
Showing
8 changed files
with
11,052 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,160 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"> | ||
<meta content="utf-8" http-equiv="encoding"> | ||
<title>BLDC MOTOR SIMULATION</title> | ||
|
||
<meta name="viewport" | ||
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
|
||
|
||
<script src="perspective-viewer.js"></script> | ||
<script src="perspective-viewer-datagrid.js"></script> | ||
<script src="perspective-viewer-d3fc.js"></script> | ||
|
||
<script src="perspective.js"></script> | ||
<link href="main.css" rel="stylesheet" type="text/css"> | ||
<link rel='stylesheet' href="material.css" is="custom-style"> | ||
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Orbitron"> | ||
<link rel='stylesheet' href=material-dense.dark.css> --> | ||
|
||
<script type="text/javascript" src="https://unpkg.com/default-passive-events"></script> | ||
|
||
|
||
<script src="a.js"></script> | ||
<script src="motor_update_sim.js"></script> | ||
|
||
|
||
</head> | ||
|
||
<body> | ||
<div class="headerframe"> | ||
<div class="header"> | ||
<h1>SIMULATION BLDC MOTOR</h1> | ||
<p>Real-time data streaming</p> | ||
</div> | ||
</div> | ||
|
||
<div class="frame"> | ||
<div class="scope"> | ||
<perspective-viewer | ||
aggregates='{"comp_time":"avg","va":"avg", "vb":"avg", "vc":"avg", "rpm":"avg", "position":"avg", "iq":"avg", "id":"avg","frequency":"avg","avg_frequency":"avg"}' | ||
row-pivots='["lastUpdate"]' | ||
columns='["comp_time","va", "vb", "vc", "rpm", "position", "iq", "id","frequency","avg_frequency"]'> | ||
</perspective-viewer> | ||
|
||
</div> | ||
<div id="wrapper"> | ||
<div id="butons"> | ||
|
||
|
||
<form class="controls"> | ||
<div width="100%" class="title">Simulation [step=0.1ms]</div> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td style="width: uto%;"> | ||
<input class="simulation_button" value="pause" onclick="state='pause'" | ||
type="button"> | ||
</td> | ||
<td style="width: auto%;"> | ||
<input class="simulation_button" value="run" onclick="state='run'" | ||
type="button"> | ||
</td> | ||
<td style="width: 2auto"> | ||
<input class="restart_button" value="restart" onclick="restart()" | ||
type="button"> | ||
</td> | ||
<td style="width: auto;"> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<div width="100%" class="title"> Controller</div> | ||
|
||
<table> | ||
<tbody> | ||
<tr> | ||
<td style="width: auto;"> | ||
<input class="controller_button" value="Open-loop" onclick="controler=0" | ||
type="button"> | ||
</td> | ||
<td style="width: auto;"> | ||
<input class="controller_button" value="FOC speed" onclick="controler=1" | ||
type="button"> | ||
</td> | ||
<td style="width: auto;"> | ||
<input class="controller_button" value="FOC position" onclick="controler=2" | ||
type="button"> | ||
</td> | ||
<td style="width: auto;"> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
</div> | ||
|
||
<div id="input" width="50%"> | ||
|
||
|
||
<div class="slidecontainer"> | ||
<p> Vbus [v]</p> | ||
<input id="vbus" value="24" min="0" max="36" oninput="vbus_out.value=this.value" type="range"> | ||
<output name="vbus_out" for="offset">24</output> | ||
</div> | ||
|
||
|
||
<div class="slidecontainer"> | ||
|
||
<p>Load torque: [Nm]</p> | ||
<input id="loadt" value="0" min="0" max="100" oninput="loadt_out.value=this.value/100" | ||
type="range"> | ||
<output name="loadt_out" for="offset">0</output> | ||
</div> | ||
|
||
<div class="slidecontainer"> | ||
|
||
<p>Load inertia: [kg*m^2]</p> | ||
<input id="loadj" value="0" min="0" max="100" oninput="loadj_out.value=this.value/1000" | ||
type="range"> | ||
<output name="loadj_out" for="offset">0</output> | ||
|
||
</div> | ||
|
||
<div class="slidecontainer"> | ||
|
||
|
||
<p>Pos ref: [degree]</p> | ||
<input id="pos" value="180" min="0" max="360" oninput="pos_out.value=this.value" type="range"> | ||
<output name="pos_out" for="offset">180</output> | ||
</div> | ||
|
||
|
||
<div class="slidecontainer"> | ||
|
||
<p>Speed ref: [rpm]</p> | ||
<input id="rpm" value="10" min="0" max="100" oninput="rpm_out.value=this.value" type="range"> | ||
<output name="rpm_out" for="offset">10</output> | ||
</div> | ||
|
||
|
||
|
||
|
||
</form> | ||
</div> | ||
</div> | ||
|
||
<!-- <div class="sim"> | ||
<canvas id="canvas" style="width:600px, height:320px" width="600" height="320"></canvas> | ||
</div> --> | ||
|
||
|
||
</div> | ||
|
||
</body> | ||
|
||
</html> |
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,152 @@ | ||
perspective-viewer { | ||
width: 100%; | ||
height: 600px; | ||
clear: both; | ||
background: white; | ||
overflow: hidden; | ||
} | ||
body { | ||
width:70%; | ||
height: auto; | ||
margin: 0px auto; | ||
background: #eee; | ||
color: #333; | ||
font-family: Arial, sans-serif; | ||
font-size: 16px; | ||
} | ||
.frame { | ||
border: 5px solid #ccc; | ||
border-radius: 5px; | ||
} | ||
|
||
|
||
.Simulation_board{ | ||
text-align: right; | ||
} | ||
|
||
|
||
|
||
.scope { | ||
/* width: 900px; */ | ||
height: 600px; | ||
clear: both; | ||
background: grey; | ||
width:100% | ||
} | ||
|
||
.header { | ||
padding: 5px; | ||
text-align: center; | ||
background: rgba(0,0,0,0.2); | ||
color: black; | ||
font-size: 25px; | ||
padding: 5px; | ||
height: 150px; | ||
font-style: oblique; | ||
font-family: verdana; | ||
} | ||
|
||
.headerframe { | ||
border: 5px solid #ccc; | ||
border-radius: 5px; | ||
opacity: 0.8; | ||
} | ||
|
||
.controls { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
|
||
/* button run and pause*/ | ||
|
||
input[type=button]{ | ||
display: inline-block; | ||
padding: 15px 25px; | ||
font-size: 24px; | ||
cursor: pointer; | ||
text-align: center; | ||
text-decoration: none; | ||
outline: none; | ||
color: #fff; | ||
background-color: #4CAF50; | ||
border: none; | ||
border-radius: 15px; | ||
box-shadow: 0; | ||
margin: 4px 2px; | ||
} | ||
|
||
|
||
input[type=button]:active { | ||
background-color: blue; | ||
box-shadow: 0 5px #666; | ||
transform: translateY(4px); | ||
} | ||
|
||
.title { | ||
vertical-align: center; | ||
text-align: left; | ||
font-size: 150%; | ||
width: 100%; | ||
float: left; | ||
padding: 15px; | ||
font-weight: bold | ||
} | ||
.slidecontainer { | ||
vertical-align: center; | ||
text-align: left; | ||
font-size: 150%; | ||
width: 100%; | ||
font-weight: bold | ||
/* padding: 1px; */ | ||
} | ||
|
||
#wrapper { | ||
width: 100%; | ||
overflow: hidden; /* add this to contain floated children */ | ||
} | ||
#butons { | ||
width: 50%; | ||
float:left; /* add this */ | ||
overflow: hidden; | ||
/* border: 1px solid green; */ | ||
} | ||
#input { | ||
width: 50%; | ||
|
||
/* border: 1px solid green; */ | ||
float: left; /* add this */ | ||
} | ||
|
||
|
||
input[type=range] { | ||
-webkit-appearance: none; | ||
margin: 10px 0; | ||
width: 60%; | ||
} | ||
input[type=range]:focus { | ||
outline: none; | ||
} | ||
input[type=range]::-webkit-slider-runnable-track { | ||
width: 100%; | ||
height: 12.8px; | ||
cursor: pointer; | ||
animate: 0.2s; | ||
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; | ||
background: green; | ||
border-radius: 25px; | ||
border: 0px solid #000101; | ||
} | ||
input[type=range]::-webkit-slider-thumb { | ||
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d; | ||
border: 0px solid #000000; | ||
height: 20px; | ||
width: 39px; | ||
border-radius: 7px; | ||
background: #585657; | ||
cursor: pointer; | ||
-webkit-appearance: none; | ||
margin-top: -3.6px; | ||
} | ||
|
||
|
Oops, something went wrong.