Skip to content

Commit 5fce6a5

Browse files
committed
Merge branch 'dev' of https://github.com/simplefoc/Arduino-FOC into dev
2 parents 44f6666 + f74e0cf commit 5fce6a5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/common/base_classes/Sensor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ void Sensor::update() {
1717
/** get current angular velocity (rad/s) */
1818
float Sensor::getVelocity() {
1919
// calculate sample time
20-
float Ts = (angle_prev_ts - vel_angle_prev_ts)*1e-6f;
20+
float Ts = (angle_prev_ts - vel_angle_prev_ts)*1e-6;
2121
// TODO handle overflow - we do need to reset vel_angle_prev_ts
22-
if (Ts<minDeltaT) return velocity; // don't update velocity if deltaT is too small
22+
if (Ts < min_elapsed_time) return velocity; // don't update velocity if deltaT is too small
2323

2424
velocity = ( (float)(full_rotations - vel_full_rotations)*_2PI + (angle_prev - vel_angle_prev) ) / Ts;
2525
vel_angle_prev = angle_prev;

src/common/base_classes/Sensor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class Sensor{
105105
/**
106106
* Minimum time between updates to velocity. If time elapsed is lower than this, the velocity is not updated.
107107
*/
108-
float minDeltaT = 0.000100; // default is 100 microseconds, or 10kHz
108+
float min_elapsed_time = 0.000100; // default is 100 microseconds, or 10kHz
109109

110110
protected:
111111
/**

src/drivers/hardware_specific/esp8266_mcu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void* _configure4PWM(long pwm_frequency,const int pinA, const int pinB, const in
7070
_setHighFrequency(pwm_frequency, pinC);
7171
_setHighFrequency(pwm_frequency, pinD);
7272
GenericDriverParams* params = new GenericDriverParams {
73-
.pins = { pin1A, pin1B, pin2A, pin2B },
73+
.pins = { pinA, pinB, pinC, pinD },
7474
.pwm_frequency = pwm_frequency
7575
};
7676
return params;
@@ -112,4 +112,4 @@ void _writeDutyCycle4PWM(float dc_1a, float dc_1b, float dc_2a, float dc_2b, vo
112112
analogWrite(((GenericDriverParams*)params)->pins[3], 255.0f*dc_2b);
113113
}
114114

115-
#endif
115+
#endif

0 commit comments

Comments
 (0)