Skip to content

Commit a3950b0

Browse files
committed
added docs for webcontroller
1 parent f4c4b09 commit a3950b0

File tree

22 files changed

+284
-54
lines changed

22 files changed

+284
-54
lines changed

_includes/js/custom.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ var classProps = [
109109
"index_search_velocity",
110110
"controller",
111111
"velocity_limit",
112-
"skip_align"
112+
"skip_align",
113+
"monitor_start_char",
114+
"monitor_end_char"
113115
];
114116

115117
var funcNames = [
@@ -217,7 +219,8 @@ var structProps = [
217219
"CCW",
218220
"nothing",
219221
"on_request",
220-
"user_friendly"
222+
"user_friendly",
223+
"machine_readable"
221224
];
222225
jtd.onReady(function(){
223226
document.querySelectorAll('.n').forEach(function(e) {

docs/simplefoc_libraries/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
title: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
44
description: "Arduino Simple Field Oriented Control (FOC) library ."
55
nav_order: 5
6-
permalink: /arduino_simplefoc_libraries
6+
permalink: /arduino_simplefoc_utils
77
has_children: True
88
has_toc: False
99
---
@@ -24,7 +24,7 @@ In the context of the <span class="simple">Simple<span class="foc">FOC</span>pro
2424

2525
<a href ="https://github.com/simplefoc/Arduino-FOC-drivers" class="btn"><i class="fa fa-github"></i> Github repo</a>
2626

27-
- ### <span class="simple">Simple<span class="foc">DC</span>Motor</span> - <i>coming soon!</i>
27+
- ### <span class="simple">Simple<span class="foc">DC</span>Motor</span>
2828

2929
<span class="simple">Simple<span class="foc">FOC</span>library</span> is really intended for field oriented control of PMSM/BLDC motors, it's in the name ;-). But for different reasons, sometimes DC motors are preferred, and while we're not focused on this use-case, we do have a fair amount of code that can be leveraged to help with DC-Motor control applications.
3030

@@ -42,15 +42,15 @@ In the context of the <span class="simple">Simple<span class="foc">FOC</span>pro
4242

4343
<a href ="https://github.com/simplefoc/Arduino-FOC-dcmotor" class="btn"><i class="fa fa-github"></i> Github repo</a>
4444

45+
- ### <span class="simple">Simple<span class="foc">FOC</span>webcontroller</span> by [@geekuillaume](https://github.com/geekuillaume)
46+
47+
This is a controller interface for the <span class="simple">Simple<span class="foc">FOC</span>library</span>. It uses WebSerial to communicate with a suitable micro-controller using serial port communications and the [Commander](commander_interface) interface. [Read more ... ](webcontroller)
48+
49+
<a href ="https://github.com/geekuillaume/simplefoc-webcontroller" class="btn btn"><i class="fa fa-github"></i> Github repo</a> <a href ="https://docs.simplefoc.com/simplefoc-webcontroller/" class="btn btn-primary"><i class="fa fa-github"></i> Open <span class="simple">Simple<span class="foc">FOC</span>webcontroller</span></a>
4550
- ### <span class="simple">Simple<span class="foc">FOC</span>Generator</span> by [@stijnsprojects](https://github.com/stijnsprojects)
4651

4752
A web application which helps you generate <span class="simple">Simple<span class="foc">FOC</span>library</span> arduino sketches based on the hardware that you are using.
4853

4954
<a href ="https://github.com/stijnsprojects/simplefocgenerator" class="btn btn"><i class="fa fa-github"></i> Github repo</a> <a href ="https://stijnsprojects.github.io/simplefocgenerator/" class="btn btn-primary"><i class="fa fa-github"></i> Open <span class="simple">Simple<span class="foc">FOC</span>Generator</span></a>
5055

51-
- ### <span class="simple">Simple<span class="foc">FOC</span>webcontroller</span> by [@geekuillaume](https://github.com/geekuillaume)
52-
53-
This is a controller interface for the <span class="simple">Simple<span class="foc">FOC</span>library</span>. It uses WebSerial to communicate with a suitable micro-controller using serial port communications and the [Commander](commander_interface) interface.
54-
55-
<a href ="https://github.com/geekuillaume/simplefoc-webcontroller" class="btn btn"><i class="fa fa-github"></i> Github repo</a> <a href ="https://docs.simplefoc.com/simplefoc-webcontroller/" class="btn btn-primary"><i class="fa fa-github"></i> Open <span class="simple">Simple<span class="foc">FOC</span>webcontroller</span></a>
5656

docs/simplefoc_libraries/dc_motors_library.md renamed to docs/simplefoc_libraries/libraries/dc_motors_library.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
layout: default
3-
title: <span class="simple">Simple<span class="foc">DC</span>Motor Library</span>
3+
title: <span class="simple">Simple<span class="foc">DC</span>Motor</span>
44
nav_order: 1
55
permalink: /dc_motors_library
6-
parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
6+
parent: libraries
7+
grand_parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
78
has_children: False
89
has_toc: False
910
---
@@ -20,12 +21,12 @@ The <span class="simple">Simple<span class="foc">DC</span>Motor library</span> e
2021

2122
## What is it?
2223

23-
A collection of DCDriver classes and a DCMotor class that build on <span class="simple">Simple<span class="foc">FOC</span>library</span>.
24+
A collection of `DCDriver` classes and a `DCMotor` class that build on <span class="simple">Simple<span class="foc">FOC</span>library</span>.
2425

2526
## What's in there?
2627

27-
- DCMotor class
28-
- DCDriver classes for different DC motor driver types
28+
- `DCMotor` class
29+
- `DCDriver` classes for different DC motor driver types
2930
- Some examples how to use them
3031

3132
## What's the advantage?

docs/simplefoc_libraries/drivers_library.md renamed to docs/simplefoc_libraries/libraries/drivers_library.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ layout: default
33
title: <span class="simple">Simple<span class="foc">FOC</span>Drivers</span>
44
nav_order: 1
55
permalink: /drivers_library
6-
parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
6+
parent: libraries
7+
grand_parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
78
has_children: False
89
has_toc: False
910
---
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
layout: default
3+
title: libraries
4+
parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
5+
description: "Arduino Simple Field Oriented Control (FOC) library ."
6+
nav_order: 1
7+
permalink: /additional_libraries
8+
has_children: True
9+
has_toc: False
10+
---
11+
12+
13+
# <span class="simple">Simple<span class="foc">FOC</span>utils</span>
14+
In the context of the <span class="simple">Simple<span class="foc">FOC</span>project</span> many different open-source community projects have been developed.
15+
16+
17+
## Arduino libraries
18+
19+
- ### <span class="simple">Simple<span class="foc">FOC</span>Drivers</span>
20+
21+
This library contains an assortment of drivers and supporting code for <span class="simple">Simple<span class="foc">FOC</span>library</span>.
22+
23+
24+
The intent is to keep the core of <span class="simple">Simple<span class="foc">FOC</span>library</span> clean, and thus easy to maintain, understand and port to different platforms. In addition to this core, there are various drivers and supporting code which has grown around <span class="simple">Simple<span class="foc">FOC</span>library</span>, and which we would like to make available to the community. [Read more ...](drivers_library)
25+
26+
<a href ="https://github.com/simplefoc/Arduino-FOC-drivers" class="btn"><i class="fa fa-github"></i> Github repo</a>
27+
28+
- ### <span class="simple">Simple<span class="foc">DC</span>Motor</span>
29+
30+
<span class="simple">Simple<span class="foc">FOC</span>library</span> is really intended for field oriented control of PMSM/BLDC motors, it's in the name ;-). But for different reasons, sometimes DC motors are preferred, and while we're not focused on this use-case, we do have a fair amount of code that can be leveraged to help with DC-Motor control applications.
31+
32+
33+
So this represents a less-supported effort to provide some useful building blocks for DC-Motors. [Read more ...](dc_motors_library)
34+
35+
<a href ="https://github.com/simplefoc/Arduino-FOC-dcmotor" class="btn"><i class="fa fa-github"></i> Github repo</a>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: default
3+
title: tools
4+
parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
5+
description: "Arduino Simple Field Oriented Control (FOC) library ."
6+
nav_order: 2
7+
permalink: /additional_tools
8+
has_children: True
9+
has_toc: False
10+
---
11+
12+
13+
# <span class="simple">Simple<span class="foc">FOC</span>utils</span>
14+
In the context of the <span class="simple">Simple<span class="foc">FOC</span>project</span> many different open-source community projects have been developed.
15+
16+
17+
## User interface applications
18+
19+
- ### <span class="simple">Simple<span class="foc">FOC</span>Studio</span> by [@jorgemaker](https://github.com/JorgeMaker)
20+
21+
Graphical user interface for the <span class="simple">Simple<span class="foc">FOC</span>library</span> based on python3 and PyQt5. This application allows to tune and configure any BLDC/Stepper <span class="simple">Simple<span class="foc">FOC</span>library</span> controlled device, using serial port communications and the [Commander](commander_interface) interface. [Read more ... ](studio)
22+
23+
<a href ="https://github.com/simplefoc/Arduino-FOC-dcmotor" class="btn"><i class="fa fa-github"></i> Github repo</a>
24+
25+
- ### <span class="simple">Simple<span class="foc">FOC</span>webcontroller</span> by [@geekuillaume](https://github.com/geekuillaume)
26+
27+
This is a controller interface for the <span class="simple">Simple<span class="foc">FOC</span>library</span>. It uses WebSerial to communicate with a suitable micro-controller using serial port communications and the [Commander](commander_interface) interface. [Read more ... ](webcontroller)
28+
29+
<a href ="https://github.com/geekuillaume/simplefoc-webcontroller" class="btn btn"><i class="fa fa-github"></i> Github repo</a> <a href ="https://docs.simplefoc.com/simplefoc-webcontroller/" class="btn btn-primary"><i class="fa fa-github"></i> Open <span class="simple">Simple<span class="foc">FOC</span>webcontroller</span></a>
30+
31+
- ### <span class="simple">Simple<span class="foc">FOC</span>Generator</span> by [@stijnsprojects](https://github.com/stijnsprojects)
32+
33+
A web application which helps you generate <span class="simple">Simple<span class="foc">FOC</span>library</span> arduino sketches based on the hardware that you are using.
34+
35+
<a href ="https://github.com/stijnsprojects/simplefocgenerator" class="btn btn"><i class="fa fa-github"></i> Github repo</a> <a href ="https://stijnsprojects.github.io/simplefocgenerator/" class="btn btn-primary"><i class="fa fa-github"></i> Open <span class="simple">Simple<span class="foc">FOC</span>Generator</span></a>
36+

docs/simplefoc_libraries/simplefocstudio.md renamed to docs/simplefoc_libraries/tools/simplefocstudio.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ layout: default
33
title: Simple<b>FOC</b>Studio
44
nav_order: 2
55
permalink: /studio
6-
parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
6+
parent: tools
7+
grand_parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
78
---
89

910
# *Simple**FOC**Studio* <small>by [@JorgeMaker](https://github.com/JorgeMaker) </small>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
layout: default
3+
title: Simple<b>FOC</b>WebController
4+
nav_order: 3
5+
permalink: /webcontroller
6+
parent: tools
7+
grand_parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
8+
---
9+
10+
# *Simple**FOC**WebController* <small>by [@geekuillaume](https://github.com/geekuillaume) </small>
11+
12+
This is a controller interface for the <span class="simple">Simple<span class="foc">FOC</span>library</span>. It uses WebSerial to communicate with a suitable micro-controller using serial port communications and the [Commander](commander_interface) interface.
13+
14+
Most of the code for this application was provided by [@geekuillaume](https://github.com/geekuillaume), his github repository can be found [here](https://github.com/geekuillaume/simplefoc-webcontroller) and his application can be found [here](https://simplefoc.besson.co/).
15+
Our app is a fork of his code, that has been further extended to support more devices and configuration parameters, as well as to ease the monitoring visualisation.
16+
17+
<a href ="https://github.com/geekuillaume/simplefoc-webcontroller" class="btn btn"><i class="fa fa-github"></i> Github repo</a> <a href ="https://docs.simplefoc.com/simplefoc-webcontroller/" class="btn btn-primary"><i class="fa fa-github"></i> Open <span class="simple">Simple<span class="foc">FOC</span>webcontroller</span></a>
18+
19+
20+
21+
<img src="extras/Images/webcontroller.gif" >
22+
23+
<blockquote class="info">
24+
<p class="heading">📢 Early stage project</p>
25+
This project is still in its early stage, we are counting on your patience and looking forward to hear your feedback. As there are many people in the community with far more knowledge about these kinds of apps than we do, don't hesitate to leve the issues and do the pull requests.
26+
</blockquote>
27+
28+
### Features:
29+
- Plug and play with the *Simple**FOC**library* version 2.3+
30+
- Real-time tuning and configuration of the motors
31+
- Real-time plotting and monitoring of motor variables
32+
- Support for multiple motors
33+
34+
35+
## Using the *Simple**FOC**WebController*
36+
37+
<a href ="https://docs.simplefoc.com/simplefoc-webcontroller/" class="btn btn-primary"><i class="fa fa-github"></i> Open <span class="simple">Simple<span class="foc">FOC</span>webcontroller</span></a>
38+
39+
*Simple**FOC**WebController* does not require any installation, its only requirement is that your browser has `WebSerial` support. Check the supportedd browsers [here](https://caniuse.com/web-serial).
40+
41+
### Motion control tunning blocks
42+
Once you have your application running in your browser, connected to your microcontroller running the <span class="simple">Simple<span class="foc">FOC</span>library</span>. You can easily change most of the control parameters of different motion control loops and visualise different monitored variables.
43+
44+
<img src="extras/Images/webcontroller_motor.png" class="width80">
45+
46+
### Integrated serial terminal
47+
48+
*Simple**FOC**WebController* also has integrated serial terminal for easier debugging and monitoring.
49+
50+
<img src="extras/Images/webcontroller_init.png" class="width80">
51+
52+
53+
## Arduino code
54+
Basically there are three things you need to do:
55+
1. Use the commander interface and add the motor to the commander
56+
2. Use the monitoring and add the `motor.monitor()` in the loop
57+
3. Make set the `motor.monitor_start_char` and `motor.monitor_end_char` to the same character as the motor id added to the commander
58+
59+
Here is a mockup of the code:
60+
61+
```cpp
62+
#include <SimpleFOC.h>
63+
64+
....
65+
66+
// include commander interface
67+
Commander command = Commander(Serial);
68+
void doMotor(char* cmd) { command.motor(&motor, cmd); }
69+
70+
void setup(){
71+
....
72+
// add the motor to the commander interface
73+
// The letter id (here 'M') of the motor
74+
char motor_id = 'M';
75+
command.add(motor_id,doMotor,'motor');
76+
// tell the motor to use the monitoring
77+
motor.useMonitoring(Serial);
78+
// configuring the monitoring to be well parsed by the webcontroller
79+
motor.monitor_start_char = motor_id; // the same latter as the motor id in the commander
80+
motor.monitor_end_char = motor_id; // the same latter as the motor id in the commander
81+
82+
commander.verbose = VerboseMode::machine_readable; // can be set using the webcontroller - optional
83+
...
84+
85+
}
86+
void loop(){
87+
....
88+
89+
....
90+
// real-time monitoring calls
91+
motor.monitor();
92+
// real-time commander calls
93+
command.run();
94+
}
95+
```

0 commit comments

Comments
 (0)