Skip to content

Commit d791fcc

Browse files
committed
Merge branch 'dev'
2 parents 0d2168a + 94deb57 commit d791fcc

File tree

27 files changed

+388
-93
lines changed

27 files changed

+388
-93
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: 8 additions & 8 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,12 +24,12 @@ 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

3131

32-
So this represents a less-supported effort to provide some useful building blocks for DC-Motors.
32+
So this represents a less-supported effort to provide some useful building blocks for DC-Motors. [Read more ...](dc_motors_library)
3333

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

@@ -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://webcontroller.simplefoc.com/" 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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
layout: default
3+
title: <span class="simple">Simple<span class="foc">DC</span>Motor</span>
4+
nav_order: 1
5+
permalink: /dc_motors_library
6+
parent: libraries
7+
grand_parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
8+
has_children: False
9+
has_toc: False
10+
---
11+
12+
13+
# <span class="simple">Simple<span class="foc">DC</span> Motor</span> library
14+
15+
![Library Compile](https://github.com/simplefoc/Arduino-FOC-dcmotor/workflows/Library%20Compile/badge.svg)
16+
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
17+
![arduino-library-badge](https://www.ardu-badge.com/badge/SimpleDCMotor.svg?)
18+
19+
20+
The <span class="simple">Simple<span class="foc">DC</span>Motor library</span> extends <span class="simple">Simple<span class="foc">FOC</span> library to handle DC motors via their commonly used driver types.
21+
22+
## What is it?
23+
24+
A collection of `DCDriver` classes and a `DCMotor` class that build on <span class="simple">Simple<span class="foc">FOC</span>library</span>.
25+
26+
## What's in there?
27+
28+
- `DCMotor` class
29+
- `DCDriver` classes for different DC motor driver types
30+
- Some examples how to use them
31+
32+
## What's the advantage?
33+
34+
- The core library doesn't work with DC motors, that's not its purpose. This library adds DC motor functionality.
35+
36+
- This lets you use the many sensor drivers available in SimpleFOC, as well as helpful classes like the Commander, when working with DC motors also.
37+
38+
- And it allows you to use SimpleFOC's control architecture to use closed loop control, so in combination with a sensor, you can turn even a cheap DC motor into an accurate digital servo.
39+
40+
## How can I use it?
41+
42+
```cpp
43+
#include "SimpleDCMotor.h"
44+
```
45+
46+
It is in the arduino library manager, called "SimpleDCMotor". Install as normal for arduino libraries in Arduino IDE or PlatformIO.
47+
48+
Please see the readme file on github and the library examples for how to use it.
49+
50+
### GitHub
51+
52+
You can find the source code for the library here: [https://github.com/simplefoc/Arduino-FOC-dcmotor](https://github.com/simplefoc/Arduino-FOC-dcmotor).
53+
54+
55+
## Documentation
56+
57+
Please see the documentation on github. Note that there is additional documentation in the `drivers` subdirectory describing the individual DC motor drivers.
58+
59+
60+

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://webcontroller.simplefoc.com/" 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://webcontroller.simplefoc.com/" 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 leave 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://webcontroller.simplefoc.com/" 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+
```

docs/simplefoc_library/cheatsheet/options.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ motor.controller | MotionControlType::torque | Motion control mode
3535
motor.torque_controller | TorqueControlType::voltage | Torque control mode
3636
motor.motion_downsample | 0 | Set to values > 1 to reduce how often move() is executed compared to loopFOC(). On fast MCUs it makes sense to reduce how often move() gets called.
3737
motor.phase_resistance | NOT SET | Motor phase resistance. If set, used to calculate current limits based on voltage limits. Value in Ohms.
38-
motor.K_bemf | NOT SET | motor back emf constant, as 1/KV. Units 1/rad/s/V. Set via motor constructor, where you can specify KV in RPM/V.
38+
motor.KV_rating | NOT SET | motor KV rating, RMS value. Can also be set via motor constructor, where you can specify KV in RPM/V.
39+
motor.phase_inductance | NOT SET | motor inductance, in H. Units Henry. Can also be set via motor constructor.
3940
motor.voltage_limit | 12V | Global voltage limit. Limits Q-axis voltage.
4041
motor.current_limit | 2A | Global current limit. Limits Q-axis current.
4142
motor.velocity_limit | 20rad/s | Global velocity limit. Value in rad/s.

0 commit comments

Comments
 (0)