-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New PlatformIO env (`nanofoc`) for the NanoFOC hardware - Huge thanks to @lgc00 for the initial NanoFOC configuration and prototyping! - Uses `HWCDC` rather than `UartStream` as the serial `Stream` interface (ESP32-S3 specific change) - Support for MAQ430 magnetic encoder sensor - Motor-specific PID tuning constants moved to separate header files --------- Co-authored-by: lgc00 <lgcasd1+1@gmail.com>
- Loading branch information
Showing
8 changed files
with
162 additions
and
29 deletions.
There are no files selected for viewing
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
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
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,13 @@ | ||
#pragma once | ||
#include <sensors/MagneticSensorSPI.h> | ||
|
||
/** Configured fro 12bit MA710 and MAQ430 magnetic sensor over SPI interface*/ | ||
MagneticSensorSPIConfig_s MAQ430_SPI = { | ||
.spi_mode = SPI_MODE3, | ||
.clock_speed = 1000000, | ||
.bit_resolution = 12, | ||
.angle_register = 0x0000, | ||
.data_start_bit = 15, | ||
.command_rw_bit = 0, // not required | ||
.command_parity_bit = 17 // parity not implemented | ||
}; |
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
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,12 @@ | ||
#pragma once | ||
|
||
// Tuning parameters for the MAD2804 motor (orange stator). | ||
|
||
#define FOC_PID_P 1 | ||
#define FOC_PID_I 0 | ||
#define FOC_PID_D 0.148 | ||
#define FOC_PID_OUTPUT_RAMP 5000 | ||
#define FOC_PID_LIMIT 3 | ||
|
||
#define FOC_VOLTAGE_LIMIT 3 | ||
#define FOC_LPF 0.0075 |
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,9 @@ | ||
#pragma once | ||
|
||
#if MOTOR_WANZHIDA_ONCE_TOP | ||
#include "motors/wanzhida_once_top.h" | ||
#elif MOTOR_MAD2804 | ||
#include "motors/mad2804.h" | ||
#else | ||
#error "No motor configuration specified!" | ||
#endif |
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,12 @@ | ||
#pragma once | ||
|
||
// Tuning parameters for the Wanzhida/Oncetop OT-EM3215D2450Y1R, | ||
// sold by SparkFun (ROB-20441). | ||
|
||
#define FOC_PID_P 4 | ||
#define FOC_PID_I 0 | ||
#define FOC_PID_D 0.04 | ||
#define FOC_PID_OUTPUT_RAMP 10000 | ||
#define FOC_PID_LIMIT 10 | ||
|
||
#define FOC_VOLTAGE_LIMIT 5 |
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