From f79ad7035e7fc068f5e0f8b3afee7b3ef9620e7e Mon Sep 17 00:00:00 2001 From: Hakan Bastedt Date: Sun, 2 Mar 2025 08:18:51 +0100 Subject: [PATCH] Updated eeprom --- .../Firmware/lib/soes-esi/esi.json | 64 +++++++++---------- .../Firmware/lib/soes-esi/objectlist.c | 18 +++--- .../Firmware/src/StepGen3.cpp | 7 ++ 3 files changed, 48 insertions(+), 41 deletions(-) diff --git a/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/lib/soes-esi/esi.json b/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/lib/soes-esi/esi.json index b70ccf1..486538f 100755 --- a/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/lib/soes-esi/esi.json +++ b/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/lib/soes-esi/esi.json @@ -157,7 +157,7 @@ "rxpdo" ], "dtype": "REAL32", - "value": "1", + "value": "0", "data": "&Obj.Scale" }, "7001": { @@ -223,7 +223,7 @@ "rxpdo" ], "dtype": "REAL32", - "value": "100", + "value": "0", "data": "&Obj.StepsPerMM1" }, "7007": { @@ -234,7 +234,7 @@ "rxpdo" ], "dtype": "REAL32", - "value": "100", + "value": "0", "data": "&Obj.StepsPerMM2" }, "7008": { @@ -245,7 +245,7 @@ "rxpdo" ], "dtype": "REAL32", - "value": "100", + "value": "0", "data": "&Obj.StepsPerMM3" }, "7009": { @@ -256,7 +256,7 @@ "rxpdo" ], "dtype": "REAL32", - "value": "100", + "value": "0", "data": "&Obj.StepsPerMM4" }, "7010": { @@ -291,16 +291,27 @@ "dtype": "INTEGER32", "value": "0" }, - "700D": { + "700A": { "otype": "VAR", - "name": "MaxAcceleration4", + "name": "MaxAcceleration1", "access": "RO", "pdo_mappings": [ "rxpdo" ], "dtype": "REAL32", - "value": "10000", - "data": "&Obj.MaxAcceleration4" + "value": "0", + "data": "&Obj.MaxAcceleration1" + }, + "700B": { + "otype": "VAR", + "name": "MaxAcceleration2", + "access": "RO", + "pdo_mappings": [ + "rxpdo" + ], + "dtype": "REAL32", + "value": "0", + "data": "&Obj.MaxAcceleration2" }, "700C": { "otype": "VAR", @@ -310,9 +321,20 @@ "rxpdo" ], "dtype": "REAL32", - "value": "10000", + "value": "0", "data": "&Obj.MaxAcceleration3" }, + "700D": { + "otype": "VAR", + "name": "MaxAcceleration4", + "access": "RO", + "pdo_mappings": [ + "rxpdo" + ], + "dtype": "REAL32", + "value": "0", + "data": "&Obj.MaxAcceleration4" + }, "700E": { "otype": "VAR", "name": "Enable1", @@ -334,28 +356,6 @@ "dtype": "UNSIGNED8", "value": "0", "data": "&Obj.Enable2" - }, - "700A": { - "otype": "VAR", - "name": "MaxAcceleration1", - "access": "RO", - "pdo_mappings": [ - "rxpdo" - ], - "dtype": "REAL32", - "value": "10000", - "data": "&Obj.MaxAcceleration1" - }, - "700B": { - "otype": "VAR", - "name": "MaxAcceleration2", - "access": "RO", - "pdo_mappings": [ - "rxpdo" - ], - "dtype": "REAL32", - "value": "10000", - "data": "&Obj.MaxAcceleration2" } } }, diff --git a/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/lib/soes-esi/objectlist.c b/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/lib/soes-esi/objectlist.c index a229ffd..bc32db7 100755 --- a/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/lib/soes-esi/objectlist.c +++ b/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/lib/soes-esi/objectlist.c @@ -374,7 +374,7 @@ const _objd SDO6006[] = }; const _objd SDO7000[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7000, 0x3f800000, &Obj.Scale}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7000, 0x00000000, &Obj.Scale}, }; const _objd SDO7001[] = { @@ -398,35 +398,35 @@ const _objd SDO7005[] = }; const _objd SDO7006[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7006, 0x42c80000, &Obj.StepsPerMM1}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7006, 0x00000000, &Obj.StepsPerMM1}, }; const _objd SDO7007[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7007, 0x42c80000, &Obj.StepsPerMM2}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7007, 0x00000000, &Obj.StepsPerMM2}, }; const _objd SDO7008[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7008, 0x42c80000, &Obj.StepsPerMM3}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7008, 0x00000000, &Obj.StepsPerMM3}, }; const _objd SDO7009[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7009, 0x42c80000, &Obj.StepsPerMM4}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7009, 0x00000000, &Obj.StepsPerMM4}, }; const _objd SDO700A[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName700A, 0x461c4000, &Obj.MaxAcceleration1}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName700A, 0x00000000, &Obj.MaxAcceleration1}, }; const _objd SDO700B[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName700B, 0x461c4000, &Obj.MaxAcceleration2}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName700B, 0x00000000, &Obj.MaxAcceleration2}, }; const _objd SDO700C[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName700C, 0x461c4000, &Obj.MaxAcceleration3}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName700C, 0x00000000, &Obj.MaxAcceleration3}, }; const _objd SDO700D[] = { - {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName700D, 0x461c4000, &Obj.MaxAcceleration4}, + {0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName700D, 0x00000000, &Obj.MaxAcceleration4}, }; const _objd SDO700E[] = { diff --git a/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/src/StepGen3.cpp b/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/src/StepGen3.cpp index ff5d42d..fda9ade 100755 --- a/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/src/StepGen3.cpp +++ b/Cards/EaserCAT-3000-Digital-Stepper-Analog-Encoder-Frequency/Firmware/src/StepGen3.cpp @@ -1107,6 +1107,7 @@ StepGen3::StepGen3(void) dirPin[3] = PE4; rtapi_app_main(); + #if 0 stepgen_array[0].pos_scale = JOINT_1_SCALE; // Can and should be overriden by PDO values stepgen_array[0].maxaccel = JOINT_1_STEPGEN_MAXACCEL; stepgen_array[1].pos_scale = JOINT_2_SCALE; @@ -1117,6 +1118,7 @@ StepGen3::StepGen3(void) stepgen_array[3].maxaccel = JOINT_4_STEPGEN_MAXACCEL; stepgen_array[0].enable = stepgen_array[1].enable = stepgen_array[2].enable = stepgen_array[3].enable = 0; // Note that they are off by default + #endif } void StepGen3::updateStepGen(double pos_cmd1, double pos_cmd2, double pos_cmd3, double pos_cmd4, @@ -1137,6 +1139,11 @@ void StepGen3::updateStepGen(double pos_cmd1, double pos_cmd2, double pos_cmd3, stepgen_array[1].maxaccel = max_acc2; stepgen_array[2].maxaccel = max_acc3; stepgen_array[3].maxaccel = max_acc4; + stepgen_array[0].enable = enable1; + stepgen_array[1].enable = enable2; + stepgen_array[2].enable = enable3; + stepgen_array[3].enable = enable4; + for (int i = 0; i < num_chan; i++) { stepgen_t *step;