Skip to content

Commit f4c4b09

Browse files
authored
Merge pull request #14 from runger1101001/dev
some small fixes and updates
2 parents e9de9b3 + 01f7502 commit f4c4b09

File tree

6 files changed

+65
-5
lines changed

6 files changed

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

docs/simplefoc_libraries/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ In the context of the <span class="simple">Simple<span class="foc">FOC</span>pro
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

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.

docs/simplefoc_library/hardware/mcus/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span> su
1818
- [ESP32 and ESP8266](esp_mcu)
1919
- [Teensy](teensy_mcu)
2020
- [SAMD21/SAMD51](samd_mcu)
21-
- [Raspberry Pi Pico](rpi_mcu) - *initial support*
21+
- [Raspberry Pi Pico](rpi_mcu)
2222
- [Portenta H7](portenta_mcu) - *initial support*
2323
- [nRF52](nrf52_mcu) - *initial support*
2424

docs/simplefoc_library/hardware/mcus/rpi_pico.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span> re
2323

2424

2525
<blockquote class="warning"> <p class="heading">BEWARE: limitations of the current implementation ⚠️</p>
26-
Raspberry Pi Pico has only the early stage of support. The PWM features work well and have been tested and most of the sensors will work well!
26+
Raspberry Pi Pico's ADC features are not sufficient for low-side current sensing, but inline current sensing is supported. Current sensing is recently developed, and not well tested.
2727
</blockquote>
2828

2929
## Arduino IDE support package

docs/simplefoc_library/hardware/mcus/stm32.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ MCU | 2 PWM mode | 4PWM mode | 3 PWM mode | 6 PWM mode | pwm frequency config
1616
--- | --- |--- |--- |--- |---
1717
stm32 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
1818

19-
Stm32 devices have full coagulability using the <span class="simple">Simple<span class="foc">FOC</span>library</span> and will work with all driver types.
19+
Stm32 devices have full compatibility using the <span class="simple">Simple<span class="foc">FOC</span>library</span> and will work with all driver types.
2020

2121
Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span> will support most of the stm32 boards out there. Stm32 boards are very powerful and they are the most common choice for implementing motion control applications. Here are two most commonly used families of boards with this library.
2222

0 commit comments

Comments
 (0)