1
- #include " HybridStepperMotor .h"
1
+ #include " HybridStepperMotorOld .h"
2
2
#include " ./communication/SimpleFOCDebug.h"
3
3
4
- // HybridStepperMotor (int pp)
4
+ // HybridStepperMotorOld (int pp)
5
5
// - pp - pole pair number
6
6
// - R - motor phase resistance
7
7
// - KV - motor kv rating (rmp/v)
8
8
// - L - motor phase inductance [H]
9
- HybridStepperMotor::HybridStepperMotor (int pp, float _R, float _KV, float _inductance)
9
+ HybridStepperMotorOld::HybridStepperMotorOld (int pp, float _R, float _KV, float _inductance)
10
10
: FOCMotor()
11
11
{
12
12
// number od pole pairs
@@ -27,13 +27,13 @@ HybridStepperMotor::HybridStepperMotor(int pp, float _R, float _KV, float _induc
27
27
/* *
28
28
Link the driver which controls the motor
29
29
*/
30
- void HybridStepperMotor ::linkDriver (BLDCDriver *_driver)
30
+ void HybridStepperMotorOld ::linkDriver (BLDCDriver *_driver)
31
31
{
32
32
driver = _driver;
33
33
}
34
34
35
35
// init hardware pins
36
- int HybridStepperMotor ::init ()
36
+ int HybridStepperMotorOld ::init ()
37
37
{
38
38
if (!driver || !driver->initialized )
39
39
{
@@ -74,7 +74,7 @@ int HybridStepperMotor::init()
74
74
}
75
75
76
76
// disable motor driver
77
- void HybridStepperMotor ::disable ()
77
+ void HybridStepperMotorOld ::disable ()
78
78
{
79
79
// set zero to PWM
80
80
driver->setPwm (0 , 0 , 0 );
@@ -84,7 +84,7 @@ void HybridStepperMotor::disable()
84
84
enabled = 0 ;
85
85
}
86
86
// enable motor driver
87
- void HybridStepperMotor ::enable ()
87
+ void HybridStepperMotorOld ::enable ()
88
88
{
89
89
// disable enable
90
90
driver->enable ();
@@ -97,7 +97,7 @@ void HybridStepperMotor::enable()
97
97
/* *
98
98
* FOC functions
99
99
*/
100
- int HybridStepperMotor ::initFOC ()
100
+ int HybridStepperMotorOld ::initFOC ()
101
101
{
102
102
int exit_flag = 1 ;
103
103
@@ -132,7 +132,7 @@ int HybridStepperMotor::initFOC()
132
132
}
133
133
134
134
// Encoder alignment to electrical 0 angle
135
- int HybridStepperMotor ::alignSensor ()
135
+ int HybridStepperMotorOld ::alignSensor ()
136
136
{
137
137
int exit_flag = 1 ; // success
138
138
SIMPLEFOC_DEBUG (" MOT: Align sensor." );
@@ -226,7 +226,7 @@ int HybridStepperMotor::alignSensor()
226
226
227
227
// Encoder alignment the absolute zero angle
228
228
// - to the index
229
- int HybridStepperMotor ::absoluteZeroSearch ()
229
+ int HybridStepperMotorOld ::absoluteZeroSearch ()
230
230
{
231
231
232
232
SIMPLEFOC_DEBUG (" MOT: Index search..." );
@@ -261,7 +261,7 @@ int HybridStepperMotor::absoluteZeroSearch()
261
261
262
262
// Iterative function looping FOC algorithm, setting Uq on the Motor
263
263
// The faster it can be run the better
264
- void HybridStepperMotor ::loopFOC ()
264
+ void HybridStepperMotorOld ::loopFOC ()
265
265
{
266
266
267
267
// update sensor - do this even in open-loop mode, as user may be switching between modes and we could lose track
@@ -293,7 +293,7 @@ void HybridStepperMotor::loopFOC()
293
293
// It runs either angle, velocity or voltage loop
294
294
// - needs to be called iteratively it is asynchronous function
295
295
// - if target is not set it uses motor.target value
296
- void HybridStepperMotor ::move (float new_target)
296
+ void HybridStepperMotorOld ::move (float new_target)
297
297
{
298
298
299
299
// set internal target variable
@@ -394,7 +394,7 @@ void HybridStepperMotor::move(float new_target)
394
394
}
395
395
}
396
396
397
- void HybridStepperMotor ::setPhaseVoltage (float Uq, float Ud, float angle_el)
397
+ void HybridStepperMotorOld ::setPhaseVoltage (float Uq, float Ud, float angle_el)
398
398
{
399
399
angle_el = _normalizeAngle (angle_el);
400
400
float _ca = _cos (angle_el);
@@ -473,7 +473,7 @@ void HybridStepperMotor::setPhaseVoltage(float Uq, float Ud, float angle_el)
473
473
// Function (iterative) generating open loop movement for target velocity
474
474
// - target_velocity - rad/s
475
475
// it uses voltage_limit variable
476
- float HybridStepperMotor ::velocityOpenloop (float target_velocity)
476
+ float HybridStepperMotorOld ::velocityOpenloop (float target_velocity)
477
477
{
478
478
// get current timestamp
479
479
unsigned long now_us = _micros ();
@@ -509,7 +509,7 @@ float HybridStepperMotor::velocityOpenloop(float target_velocity)
509
509
// Function (iterative) generating open loop movement towards the target angle
510
510
// - target_angle - rad
511
511
// it uses voltage_limit and velocity_limit variables
512
- float HybridStepperMotor ::angleOpenloop (float target_angle)
512
+ float HybridStepperMotorOld ::angleOpenloop (float target_angle)
513
513
{
514
514
// get current timestamp
515
515
unsigned long now_us = _micros ();
0 commit comments