Skip to content

Commit dfab936

Browse files
committed
add a page describing drivers library
1 parent f6b4a59 commit dfab936

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
layout: default
3+
title: SimpleFOC Drivers Library
4+
nav_order: 9
5+
permalink: /drivers_library
6+
parent: Writing the Code
7+
grand_parent: Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span>
8+
has_children: False
9+
has_toc: False
10+
---
11+
12+
13+
# SimpleFOC drivers library
14+
15+
![Library Compile](https://github.com/simplefoc/Arduino-FOC-Drivers/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/Simple%20FOC%20Drivers.svg?)
18+
19+
20+
The <span class="simple">Simple<span class="foc">FOC</span>library</span>'s main objective is to provide an efficient low level motion motor control for BLDC and stepper motors.
21+
22+
There are a vast number of hardware and software options you might choose when implementing a FOC controlled motor system in conjunction - things like whole driver boards, different sensors, integrated driver ICs, different communications protocols and more.
23+
24+
The main library cannot possibly cover all these topics without becoming "overloaded", and hence hard to understand, maintain and use. So our approach is to keep the core library as lean and simple as we can - just the algorithms for motor driving, the PWM support for the different MCUs, and some universal, generic sensor and communications components.
25+
26+
The philosophy is that this will be enough to help you solve your motor control objectives, and there are other sources for the other code needed for your system.
27+
28+
One of these sources is the <span class="simple">Simple<span class="foc">FOC</span></span> drivers library.
29+
30+
## What is it?
31+
32+
A collection of drivers and supporting code you can use with <span class="simple">Simple<span class="foc">FOC</span>library</span>.
33+
34+
## What's in there?
35+
36+
It is steadily growing, but at the moment we have:
37+
38+
- a driver for the DRV8316 integrated 3-phase driver from TI
39+
- various sensor drivers for different magnetic sensor ICs
40+
- a communications driver for I2C
41+
42+
## What's the advantage?
43+
44+
- The drivers in the drivers repo enable functionality for components that don't work with the standard core library. For example, the TLE5012B sensor is not supported by the generic MagneticSensorSPI class, but there is a specific driver for it in the drivers repository.
45+
46+
- The drivers in the drivers repo may have extended functionality. So for example while the AS5048A sensor is supported by the generic MagneticSensorSPI class, the specific driver for it allows querying its other registers, allows detecting sensor erros, and is easier to use because it has the correct settings "embedded".
47+
48+
- Using the comms drivers provided as a starting point not only gets you off to a quick start, but also makes it more likely your solutions will be interoperable with those of others (or at least easy to adapt).
49+
50+
## How can I use it?
51+
52+
```c++
53+
#include "SimpleFOCDrivers.h"
54+
```
55+
56+
It is in the arduino library manager, called "Simple FOC Drivers". Install as normal for arduino libraries in Arduino IDE or PlatformIO.
57+
58+
To use some code from the library, include the specific driver module you want. For example:
59+
60+
```c++
61+
#include "encoders/as5048a/MagneticSensorAS5048A.h"
62+
```
63+
64+
Then check the README for the specific driver for further instructions, or post in the forum or discord if you get stuck!
65+
66+
### GitHub
67+
68+
You can find the source code for the library here: [https://github.com/simplefoc/Arduino-FOC-drivers](https://github.com/simplefoc/Arduino-FOC-drivers).
69+
70+
71+
## Documentation
72+
73+
Each module / driver is documented in its README file that can be found in its respective sub-directory.
74+
75+
The [README](https://github.com/simplefoc/Arduino-FOC-drivers) for the main repository has an index to help you find things.
76+
77+
78+
## How do we decide what goes there?
79+
80+
While working on <span class="simple">Simple<span class="foc">FOC</span> library</span> we sometimes develop code to support our projects that doesn't directly relate to the core library, or receive contributions of code that don't quite fit. We find a home for it in the drivers library.
81+
82+
So the drivers repository is for code that falls into one of these categories:
83+
84+
- hardware-specific, like for a specific sensor or driver chip
85+
- solves problems related to motor control but that aren't needed by everyone using the library
86+
- implements specific communications protocols
87+
88+
The code in the drivers repository is:
89+
90+
- not used by as many users, so less well tested
91+
- not as completely documented as the core library
92+
- probably more suited for experienced users
93+

index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Therefore this is an attempt to:
4141
</ul>
4242
</li>
4343
<li>Generic sensor class - to implement a new sensor only implement one function <a href="https://docs.simplefoc.com/generic_sensor">see docs</a></li>
44+
<li>First release of the <a href="/drivers_library">Drivers Library</a> v1.0.0 to Arduino library manager</li>
4445
</ul>
4546
</blockquote>
4647

0 commit comments

Comments
 (0)