Skip to content

Commit

Permalink
feat(motor): monitoring variables (#10)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **New Features**
- Enhanced monitoring capabilities for the BLDC motor control setup
through new and adjusted constants and parameters.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
hcd-bdltd authored Feb 11, 2024
2 parents 603eae0 + d57d65f commit 000008e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ lib_deps =
Wire @ 1.0.0
Simple FOC @ 2.3.2

build_flags = -D HAL_ADC_MODULE_ONLY -D HAL_OPAMP_MODULE_ENABLED
build_flags = -D HAL_OPAMP_MODULE_ENABLED
8 changes: 6 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

#include <SimpleFOC.h>

#define POLE_PAIRS 7
#define _MON_ALL (0b1111111)
#define POLE_PAIRS (7)

// BLDC motor & driver instance
BLDCMotor motor = BLDCMotor(POLE_PAIRS);
Expand Down Expand Up @@ -82,6 +83,9 @@ void setup() {
motor.velocity_limit = 4;

// use monitoring with serial
motor.monitor_separator = '\t';
motor.monitor_decimals = 2;
motor.monitor_variables = _MON_ALL;
motor.useMonitoring(Serial);

// initialize motor
Expand Down Expand Up @@ -111,7 +115,7 @@ void loop() {

// function intended to be used with serial plotter to monitor motor variables
// significantly slowing the execution down!!!!
// motor.monitor();
motor.monitor();

// user communication
command.run();
Expand Down

0 comments on commit 000008e

Please sign in to comment.