Skip to content

Commit 153ccf8

Browse files
committed
final merge commit
1 parent e019bd9 commit 153ccf8

9 files changed

Lines changed: 22 additions & 17 deletions

File tree

src/BLDCMotor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ int trap_150_map[12][3] = {
3434
// - pp - pole pair number
3535
// - R - motor phase resistance
3636
// - KV - motor kv rating (rmp/v)
37-
// - L - motor phase inductance
37+
// - Lq - motor q-axis inductance [H]
38+
// - Ld - motor d-axis inductance [H]
3839
BLDCMotor::BLDCMotor(int pp, float _R, float _KV, float _Lq, float _Ld)
3940
: FOCMotor()
4041
{

src/BLDCMotor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class BLDCMotor: public FOCMotor
2121
@param pp pole pairs number
2222
@param R motor phase resistance - [Ohm]
2323
@param KV motor KV rating (1/K_bemf) - rpm/V
24-
@param L_q motor phase inductance - [H]
25-
@param L_d motor direct axis inductance - [H]
24+
@param Lq motor q-axis inductance - [H]
25+
@param Ld motor d-axis inductance - [H]
2626
*/
2727
BLDCMotor(int pp, float R = NOT_SET, float KV = NOT_SET, float L_q = NOT_SET, float L_d = NOT_SET);
2828

src/HybridStepperMotor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// - pp - pole pair number
66
// - R - motor phase resistance
77
// - KV - motor kv rating (rmp/v)
8-
// - L - motor phase inductance [H]
8+
// - Lq - motor q-axis inductance [H]
9+
// - Ld - motor d-axis inductance [H]
910
HybridStepperMotor::HybridStepperMotor(int pp, float _R, float _KV, float _Lq, float _Ld)
1011
: FOCMotor()
1112
{

src/HybridStepperMotor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class HybridStepperMotor : public FOCMotor
2525
* @param pp pole pair number
2626
* @param R motor phase resistance - [Ohm]
2727
* @param KV motor KV rating (1/K_bemf) - rpm/V
28-
* @param L motor phase inductance - [H]
28+
* @param Lq motor q-axis inductance - [H]
29+
* @param Ld motor d-axis inductance - [H]
2930
*/
3031
HybridStepperMotor(int pp, float R = NOT_SET, float KV = NOT_SET, float L_q = NOT_SET, float L_d = NOT_SET);
3132

src/StepperMotor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
// - pp - pole pair number
77
// - R - motor phase resistance
88
// - KV - motor kv rating (rmp/v)
9-
// - L - motor phase inductance [H]
9+
// - Lq - motor q-axis inductance [H]
10+
// - Ld - motor d-axis inductance [H]
1011
StepperMotor::StepperMotor(int pp, float _R, float _KV, float _Lq, float _Ld)
1112
: FOCMotor()
1213
{

src/StepperMotor.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ class StepperMotor: public FOCMotor
2121
{
2222
public:
2323
/**
24-
StepperMotor class constructor
25-
@param pp pole pair number
26-
@param R motor phase resistance - [Ohm]
27-
@param KV motor KV rating (1/K_bemf) - rpm/V
28-
@param L motor phase inductance - [H]
24+
* StepperMotor class constructor
25+
* @param pp pole pair number
26+
* @param R motor phase resistance - [Ohm]
27+
* @param KV motor KV rating (1/K_bemf) - rpm/V
28+
* @param Lq motor q-axis inductance - [H]
29+
* @param Ld motor d-axis inductance - [H]
2930
*/
3031
StepperMotor(int pp, float R = NOT_SET, float KV = NOT_SET, float L_q = NOT_SET, float L_d = NOT_SET);
3132

src/common/base_classes/FOCMotor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ void FOCMotor::move(float new_target) {
706706
// angle set point
707707
shaft_angle_sp = target;
708708
// calculate the torque command - sensor precision: this calculation is ok, but based on bad value from previous calculation
709-
current_sp = P_angle(shaft_angle_sp - shaft_angle); // if current/foc_current torque control
709+
current_sp = P_angle(shaft_angle_sp - shaft_angle);
710710
break;
711711
case MotionControlType::angle:
712712
// TODO sensor precision: this calculation is not numerically precise. The target value cannot express precise positions when

src/communication/Commander.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ void Commander::motion(FOCMotor* motor, char* user_cmd, char* separator){
425425
break;
426426
default:
427427
// change control type
428-
if(!GET && value >= 0 && (int)value < 5) // if set command
428+
if(!GET && value >= 0 && (int)value < 6) // if set command
429429
motor->updateMotionControlType((MotionControlType)value); // update motion control type
430430
switch(motor->controller){
431431
case MotionControlType::torque:

src/sensors/MagneticSensorSPI.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/** Typical configuration for the 14bit AMS AS5147 magnetic sensor over SPI interface */
55
MagneticSensorSPIConfig_s AS5147_SPI = {
66
.spi_mode = SPI_MODE1,
7-
.clock_speed = 1000000,
7+
.clock_speed = 1000000, // 1MHz clock (AMS should be able to accept up to 10MHz)
88
.bit_resolution = 14,
99
.angle_register = 0x3FFF,
1010
.data_start_bit = 13,
@@ -17,7 +17,7 @@ MagneticSensorSPIConfig_s AS5147_SPI = {
1717
// Ex. https://community.simplefoc.com/t/esp32s3-qtpy-platformio-spi-problem/7444
1818
MagneticSensorSPIConfig_s AS5048_SPI = {
1919
.spi_mode = SPI_MODE1,
20-
.clock_speed = 1000000,
20+
.clock_speed = 1000000, // 1MHz clock (AMS should be able to accept up to 10MHz)
2121
.bit_resolution = 14,
2222
.angle_register = 0x3FFF,
2323
.data_start_bit = 13,
@@ -26,7 +26,7 @@ MagneticSensorSPIConfig_s AS5048_SPI = {
2626
};
2727
MagneticSensorSPIConfig_s AS5047_SPI = {
2828
.spi_mode = SPI_MODE1,
29-
.clock_speed = 1000000,
29+
.clock_speed = 1000000, // 1MHz clock (AMS should be able to accept up to 10MHz)
3030
.bit_resolution = 14,
3131
.angle_register = 0x3FFF,
3232
.data_start_bit = 13,
@@ -37,7 +37,7 @@ MagneticSensorSPIConfig_s AS5047_SPI = {
3737
/** Typical configuration for the 14bit MonolithicPower MA730 magnetic sensor over SPI interface */
3838
MagneticSensorSPIConfig_s MA730_SPI = {
3939
.spi_mode = SPI_MODE0,
40-
.clock_speed = 1000000,
40+
.clock_speed = 1000000,
4141
.bit_resolution = 14,
4242
.angle_register = 0x0000,
4343
.data_start_bit = 15,

0 commit comments

Comments
 (0)