1- #include " HybridStepperMotor .h"
1+ #include " HybridStepperMotorOld .h"
22#include " ./communication/SimpleFOCDebug.h"
33
4- // HybridStepperMotor (int pp)
4+ // HybridStepperMotorOld (int pp)
55// - pp - pole pair number
66// - R - motor phase resistance
77// - KV - motor kv rating (rmp/v)
88// - 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)
1010 : FOCMotor()
1111{
1212 // number od pole pairs
@@ -27,13 +27,13 @@ HybridStepperMotor::HybridStepperMotor(int pp, float _R, float _KV, float _induc
2727/* *
2828 Link the driver which controls the motor
2929*/
30- void HybridStepperMotor ::linkDriver (BLDCDriver *_driver)
30+ void HybridStepperMotorOld ::linkDriver (BLDCDriver *_driver)
3131{
3232 driver = _driver;
3333}
3434
3535// init hardware pins
36- int HybridStepperMotor ::init ()
36+ int HybridStepperMotorOld ::init ()
3737{
3838 if (!driver || !driver->initialized )
3939 {
@@ -74,7 +74,7 @@ int HybridStepperMotor::init()
7474}
7575
7676// disable motor driver
77- void HybridStepperMotor ::disable ()
77+ void HybridStepperMotorOld ::disable ()
7878{
7979 // set zero to PWM
8080 driver->setPwm (0 , 0 , 0 );
@@ -84,7 +84,7 @@ void HybridStepperMotor::disable()
8484 enabled = 0 ;
8585}
8686// enable motor driver
87- void HybridStepperMotor ::enable ()
87+ void HybridStepperMotorOld ::enable ()
8888{
8989 // disable enable
9090 driver->enable ();
@@ -97,7 +97,7 @@ void HybridStepperMotor::enable()
9797/* *
9898 * FOC functions
9999 */
100- int HybridStepperMotor ::initFOC ()
100+ int HybridStepperMotorOld ::initFOC ()
101101{
102102 int exit_flag = 1 ;
103103
@@ -132,7 +132,7 @@ int HybridStepperMotor::initFOC()
132132}
133133
134134// Encoder alignment to electrical 0 angle
135- int HybridStepperMotor ::alignSensor ()
135+ int HybridStepperMotorOld ::alignSensor ()
136136{
137137 int exit_flag = 1 ; // success
138138 SIMPLEFOC_DEBUG (" MOT: Align sensor." );
@@ -226,7 +226,7 @@ int HybridStepperMotor::alignSensor()
226226
227227// Encoder alignment the absolute zero angle
228228// - to the index
229- int HybridStepperMotor ::absoluteZeroSearch ()
229+ int HybridStepperMotorOld ::absoluteZeroSearch ()
230230{
231231
232232 SIMPLEFOC_DEBUG (" MOT: Index search..." );
@@ -261,7 +261,7 @@ int HybridStepperMotor::absoluteZeroSearch()
261261
262262// Iterative function looping FOC algorithm, setting Uq on the Motor
263263// The faster it can be run the better
264- void HybridStepperMotor ::loopFOC ()
264+ void HybridStepperMotorOld ::loopFOC ()
265265{
266266
267267 // 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()
293293// It runs either angle, velocity or voltage loop
294294// - needs to be called iteratively it is asynchronous function
295295// - if target is not set it uses motor.target value
296- void HybridStepperMotor ::move (float new_target)
296+ void HybridStepperMotorOld ::move (float new_target)
297297{
298298
299299 // set internal target variable
@@ -394,7 +394,7 @@ void HybridStepperMotor::move(float new_target)
394394 }
395395}
396396
397- void HybridStepperMotor ::setPhaseVoltage (float Uq, float Ud, float angle_el)
397+ void HybridStepperMotorOld ::setPhaseVoltage (float Uq, float Ud, float angle_el)
398398{
399399 angle_el = _normalizeAngle (angle_el);
400400 float _ca = _cos (angle_el);
@@ -473,7 +473,7 @@ void HybridStepperMotor::setPhaseVoltage(float Uq, float Ud, float angle_el)
473473// Function (iterative) generating open loop movement for target velocity
474474// - target_velocity - rad/s
475475// it uses voltage_limit variable
476- float HybridStepperMotor ::velocityOpenloop (float target_velocity)
476+ float HybridStepperMotorOld ::velocityOpenloop (float target_velocity)
477477{
478478 // get current timestamp
479479 unsigned long now_us = _micros ();
@@ -509,7 +509,7 @@ float HybridStepperMotor::velocityOpenloop(float target_velocity)
509509// Function (iterative) generating open loop movement towards the target angle
510510// - target_angle - rad
511511// it uses voltage_limit and velocity_limit variables
512- float HybridStepperMotor ::angleOpenloop (float target_angle)
512+ float HybridStepperMotorOld ::angleOpenloop (float target_angle)
513513{
514514 // get current timestamp
515515 unsigned long now_us = _micros ();
0 commit comments