Skip to content

Commit df7209e

Browse files
committed
Rename the sensor
1 parent b984271 commit df7209e

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/encoders/flux_observer/FluxObserverSensor.cpp renamed to src/encoders/MXLEMMING_observer/MXLEMMINGObserverSensor.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#include "FluxObserverSensor.h"
1+
#include "MXLEMMINGObserverSensor.h"
22
#include "common/foc_utils.h"
33
#include "common/time_utils.h"
44

55

6-
FluxObserverSensor::FluxObserverSensor(const FOCMotor& m) : _motor(m)
6+
MXLEMMINGObserverSensor::MXLEMMINGObserverSensor(const FOCMotor& m) : _motor(m)
77
{
88
// Derive Flux linkage from KV_rating and pole_pairs
99
if (_isset(_motor.pole_pairs) && _isset(_motor.KV_rating)){
@@ -12,7 +12,7 @@ FluxObserverSensor::FluxObserverSensor(const FOCMotor& m) : _motor(m)
1212
}
1313

1414

15-
void FluxObserverSensor::update() {
15+
void MXLEMMINGObserverSensor::update() {
1616
// Current sense is required for the observer
1717
if (!_motor.current_sense) return;
1818

@@ -24,7 +24,6 @@ void FluxObserverSensor::update() {
2424
// Update sensor, with optional downsampling of update rate
2525
if (sensor_cnt++ < sensor_downsample) return;
2626

27-
// Close to zero speed the flux observer can resonate
2827
// Estimate the BEMF and exit if it's below the threshold
2928
float bemf = _motor.voltage.q - _motor.phase_resistance * _motor.current.q;
3029
if (abs(bemf) < bemf_threshold) return;
@@ -95,13 +94,13 @@ void FluxObserverSensor::update() {
9594

9695
}
9796

98-
void FluxObserverSensor::init(){
97+
void MXLEMMINGObserverSensor::init(){
9998
this->Sensor::init(); // call base class
10099
}
101100

102101
/*
103102
Shaft angle calculation
104103
*/
105-
float FluxObserverSensor::getSensorAngle(){
104+
float MXLEMMINGObserverSensor::getSensorAngle(){
106105
return 0;
107106
}

src/encoders/flux_observer/FluxObserverSensor.h renamed to src/encoders/MXLEMMING_observer/MXLEMMINGObserverSensor.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef FLUX_OBSERVER_SENSOR_H
2-
#define FLUX_OBSERVER_SENSOR_H
1+
#ifndef MXLEMMING_OBSERVER_SENSOR_H
2+
#define MXLEMMING_OBSERVER_SENSOR_H
33

44
#include "Arduino.h"
55
#include "common/base_classes/FOCMotor.h"
@@ -9,14 +9,14 @@
99
1010
*/
1111

12-
class FluxObserverSensor : public Sensor
12+
class MXLEMMINGObserverSensor : public Sensor
1313
{
1414
public:
1515
/**
16-
FluxObserverSensor class constructor
17-
@param m Motor that the FluxObserverSensor will be linked to
16+
MXLEMMINGObserverSensor class constructor
17+
@param m Motor that the MXLEMMINGObserverSensor will be linked to
1818
*/
19-
FluxObserverSensor(const FOCMotor& m);
19+
MXLEMMINGObserverSensor(const FOCMotor& m);
2020
void update() override;
2121

2222
void init() override;

src/encoders/flux_observer/README.md renamed to src/encoders/MXLEMMING_observer/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Flux Observer Sensor
1+
# MXLEMMING Observer Sensor
22

3-
The MXLEMMING has been ported from the MESC Firmware, it's also the default Flux observer in Vesc.
4-
The [MESC book](https://davidmolony.github.io/MESC_Firmware/operation/CONTROL.html#the-sensorless-observer) explains the math behind the flux observer.
3+
The MXLEMMING Obserser has been ported from the MESC Firmware, it's also the default Flux observer in Vesc firmware.
4+
The [MESC book](https://davidmolony.github.io/MESC_Firmware/operation/CONTROL.html#the-sensorless-observer) explains the math behind this flux observer.
55

66
It's a simple solution for sensorless motor control only using phase currents and motor parameters, if tracking the position at low speed and when not driving the motor is not relevant.
77

88
### Motor Parameters:
9-
The MXLEMMING Flux Observer needs the following motor parameters to be set:
9+
The MXLEMMING Observer needs the following motor parameters to be set:
1010
- phase resistance
1111
- KV rating
1212
- phase inductance

0 commit comments

Comments
 (0)