39 Commits

Author SHA1 Message Date
Hakan Bastedt
b242ec3315 Pending video release 2024-01-06 21:59:09 +01:00
Hakan Bastedt
f66c600dc7 Soon video release 2024-01-06 21:02:09 +01:00
Hakan Bastedt
9a41ccd2bc Added linuxcnc test config before video release 2024-01-06 20:54:15 +01:00
Hakan Bastedt
9dcc713fab Added a commandedVelocity variable for hal 2024-01-06 20:53:34 +01:00
Hakan Bastedt
ccde6ef15e definitely works better now with SM2 sync. handleStepper is back. 2024-01-05 21:37:55 +01:00
Hakan Bastedt
7e06b0ce68 ooops it was set to use DC sync, not the intention, SM2 sync was intended. Switch to SM2 sync 2024-01-05 21:33:06 +01:00
Hakan Bastedt
37d3ea6567 Solution was to NOT do the steps in the IRQ. Set a flag and do pulses outside of the irq. 2024-01-05 19:33:13 +01:00
Hakan Bastedt
ed168df64e It actually makes pulses at 1ms intervals here. Saving this moment. 2024-01-05 17:46:31 +01:00
Hakan Bastedt
1168f7e5ad Now it is occasionally updating correct 1 ms. wip. 2024-01-04 23:00:09 +01:00
Hakan Bastedt
93405efd63 Why is actualposition updated every 2 ms, not every 1 ms? 2024-01-04 22:23:52 +01:00
Hakan Bastedt
484c984e49 Basic function using SM2 sync inteerupt. Stepgen half functional 2024-01-04 21:38:40 +01:00
Hakan Bastedt
e6cd5356c9 tests with linuxcnc, DC sync is not the way to go, leaving that 2024-01-04 11:39:01 +01:00
Hakan Bastedt
5978ebec24 Pending tests. Merging this branch 2024-01-02 23:58:29 +01:00
Hakan Bastedt
d4a83eae80 Use frequency instead of pulse width - much better resolution at high freq. 2024-01-02 23:55:32 +01:00
Hakan Bastedt
2e8e938345 Bugs found. set duty cycle after overflow() 2024-01-02 23:51:58 +01:00
Hakan Bastedt
cc1ca73219 wip, local testing to start 2024-01-02 23:32:47 +01:00
Hakan Bastedt
b57bd740ab double float = fal_float size added to lcec. LCNC starts and works 2024-01-02 18:46:26 +01:00
Hakan Bastedt
8007a2ff6c Test with minium pulse delay 5 usec - can be set easily. 2024-01-01 22:52:14 +01:00
Hakan Bastedt
a21e932b5a Direction pin works in test 2024-01-01 22:48:50 +01:00
Hakan Bastedt
64d62a954a Basic test with puls sequence 2024-01-01 22:42:12 +01:00
Hakan Bastedt
f99d9bab77 Here are those changes... Worked in another repositiry hehe 2024-01-01 20:40:29 +01:00
Hakan Bastedt
703bbfb03a wip, stepper doesn't run 2024-01-01 15:27:29 +01:00
Hakan Bastedt
f0ec7a834c Tested, works in linuxcnc, doesn't work in free run mode 2024-01-01 00:37:45 +01:00
Hakan Bastedt
28f01a9919 WIP, non-functional 2023-12-31 20:09:55 +01:00
Hakan Bastedt
bf8fccd0d6 Patch for lcec to support 64-bit floats 2023-12-31 13:06:32 +01:00
Hakan Bastedt
f27a27ed1b 64-bit data types added 2023-12-31 13:00:48 +01:00
Hakan Bastedt
485901120c Reshuffle file structure 2023-12-31 09:17:42 +01:00
Hakan Bastedt
1851f4168e Geographic annotation on pcb 2 2023-12-31 09:07:56 +01:00
Hakan Bastedt
ab034e93f8 wip stepgen 2023-12-31 08:57:37 +01:00
Hakan Bastedt
0929d23207 DC synchronization works, interrupt counter counts 2023-12-30 20:41:52 +01:00
Hakan Bastedt
818f853af0 Pending video release 2023-12-29 17:37:27 +01:00
Hakan Bastedt
5abaf4ace7 Pending video release 2023-12-29 15:05:23 +01:00
Hakan Bastedt
2a1111c537 Updates to encoder 2023-12-28 18:46:13 +01:00
Hakan Bastedt
d9b088687f New pcb 2023-12-28 18:45:54 +01:00
Hakan Bastedt
2790280c4a Added linuxcnc files 2023-12-26 18:24:03 +01:00
Hakan Bastedt
890a81952b Encoder works also for threading cycle. non-optmized. 2023-12-26 18:16:04 +01:00
Hakan Bastedt
d878101c62 After making board no 2. work 2023-12-25 20:46:53 +01:00
Hakan Bastedt
3cd2755645 Added arduino sketch to write a valid eeprom for lan9252. 2023-12-24 23:29:03 +01:00
Hakan Bastedt
49c804516d Tested in the lathe. Works, of course 2023-12-24 23:28:10 +01:00
222 changed files with 89186 additions and 1723 deletions

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -52,10 +52,12 @@
<option value="INTEGER8">INTEGER8</option>
<option value="INTEGER16">INTEGER16</option>
<option value="INTEGER32">INTEGER32</option>
<option value="INTEGER64">INTEGER64</option>
<option value="UNSIGNED8">UNSIGNED8</option>
<option value="UNSIGNED16">UNSIGNED16</option>
<option value="UNSIGNED32">UNSIGNED32</option>
<option value="UNSIGNED32">UNSIGNED64</option>
<option value="REAL32">REAL32</option>
<option value="REAL64">REAL64</option>
<option value="VISIBLE_STRING">VISIBLE STRING</option>
</select></td>
</tr>
@@ -412,4 +414,4 @@
<input id="restoreFileInput" type='file' accept=".json" style="visibility:hidden;" onchange="readFile(event)" />
</form>
</div>
</body>
</body>

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -28,10 +28,13 @@ const DTYPE = {
INTEGER8 : 'INTEGER8',
INTEGER16 : 'INTEGER16',
INTEGER32 : 'INTEGER32',
INTEGER32 : 'INTEGER64',
UNSIGNED8 : 'UNSIGNED8',
UNSIGNED16 : 'UNSIGNED16',
UNSIGNED32 : 'UNSIGNED32',
UNSIGNED32 : 'UNSIGNED64',
REAL32 : 'REAL32',
REAL64 : 'REAL64',
VISIBLE_STRING : 'VISIBLE_STRING',
/* TODO implement missing less common types */
// OCTET_STRING : 'OCTET_STRING',
@@ -49,10 +52,13 @@ const dtype_bitsize = {
'INTEGER8' : 8,
'INTEGER16' : 16,
'INTEGER32' : 32,
'INTEGER64' : 64,
'UNSIGNED8' : 8,
'UNSIGNED16' : 16,
'UNSIGNED32' : 32,
'UNSIGNED64' : 64,
'REAL32' : 32,
'REAL64' : 64,
'VISIBLE_STRING' : 8,
};
const booleanPaddingBitsize = 7;
@@ -62,10 +68,13 @@ const ESI_DT = {
'INTEGER8': { name: 'SINT', bitsize: 8, ctype: 'int8_t' },
'INTEGER16': { name: 'INT', bitsize: 16, ctype: 'int16_t' },
'INTEGER32': { name: 'DINT', bitsize: 32, ctype: 'int32_t' },
'INTEGER64': { name: 'LINT', bitsize: 64, ctype: 'int64_t' },
'UNSIGNED8': { name: 'USINT', bitsize: 8, ctype: 'uint8_t' },
'UNSIGNED16': { name: 'UINT', bitsize: 16, ctype: 'uint16_t' },
'UNSIGNED32': { name: 'UDINT', bitsize: 32, ctype: 'uint32_t' },
'REAL32': { name: 'REAL', bitsize: 32, ctype: 'float' }, // TODO check C type name
'UNSIGNED64': { name: 'ULINT', bitsize: 64, ctype: 'uint64_t' },
'REAL32': { name: 'REAL', bitsize: 32, ctype: 'float' },
'REAL64': { name: 'LREAL', bitsize: 64, ctype: 'double' },
'VISIBLE_STRING': { name: 'STRING', bitsize: 8, ctype: 'char *' }, // TODO check C type name
};

14
Firmware/.vscode/settings.json vendored Executable file
View File

@@ -0,0 +1,14 @@
{
"files.associations": {
"ecat_slv.h": "c",
"compare": "cpp",
"*.tpp": "cpp",
"*.tcc": "cpp",
"deque": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"system_error": "cpp"
},
"C_Cpp.errorSquiggles": "disabled"
}

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -4,8 +4,8 @@
#define USE_FOE 0
#define USE_EOE 0
#define MBXSIZE 128
#define MBXSIZEBOOT 128
#define MBXSIZE 512
#define MBXSIZEBOOT 512
#define MBXBUFFERS 3
#define MBX0_sma 0x1000
@@ -33,7 +33,7 @@
#define SM3_smc 0x20
#define SM3_act 1
#define MAX_MAPPINGS_SM2 7
#define MAX_MAPPINGS_SM2 4
#define MAX_MAPPINGS_SM3 6
#define MAX_RXPDO_SIZE 512

View File

@@ -1,12 +1,12 @@
:2000000080060344640000000000000000001400E1100000D20400000100000002000000D1
:2000200000000000000000000000000000000000001080008010800004000000000000001C
:2000000080060344640000000000000000001400AA0A0000CCBCBB000200000001000000A1
:20002000000000000000000000000000000000000010000200120002040000000000000096
:200040000000000000000000000000000000000000000000000000000000000000000000A0
:20006000000000000000000000000000000000000000000000000000000000000F00010070
:200080000A002100040C456173657243415432303030096D79456E636F64657206494D479
:2000A000434259224D6574616C4D7573696E67732045617365724341542032303030206518
:2000C0006E636F6465721E0010000203010400130000000000000000000011000000000049
:2000E00000000000000000000000280002000102030029001000001080002600010180104F
:200100008000220001020016000024000103001A000020000104FFFFFFFFFFFFFFFFFFFFC7
:200080000A002000040C4561736572434154323030300E4D616368696E65436F6E74726F64
:2000A0006C06494D474342591A4D6574616C4D7573696E67732045617365724341542032E6
:2000C000303030001E00100002030104001300000000000000000000110000000000000034
:2000E000000000000000000028000200010203002900100000100002260001010012000249
:20010000220001020016000024000103001A000020000104FFFFFFFFFFFFFFFFFFFFFFFF49
:20012000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDF
:20014000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF
:20016000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F

View File

@@ -1,32 +1,39 @@
{
"form": {},
"form": {
"VendorName": "MetalMusings",
"VendorID": "0xaaa",
"ProductCode": "0xbbbccc",
"ProfileNo": "5001",
"RevisionNumber": "0x002",
"SerialNumber": "0x001",
"HWversion": "0.0.1",
"SWversion": "0.0.1",
"EEPROMsize": "2048",
"RxMailboxOffset": "0x1000",
"TxMailboxOffset": "0x1200",
"MailboxSize": "512",
"SM2Offset": "0x1600",
"SM3Offset": "0x1A00",
"TextGroupType": "MachineControl",
"TextGroupName5": "Incremental encoder",
"ImageName": "IMGCBY",
"TextDeviceType": "EaserCAT2000",
"TextDeviceName": "MetalMusings EaserCAT 2000",
"Port0Physical": "Y",
"Port1Physical": "Y",
"Port2Physical": " ",
"Port3Physical": " ",
"ESC": "LAN9252",
"SPImode": "3",
"CoeDetailsEnableSDO": "EnableSDO",
"CoeDetailsEnableSDOInfo": "EnableSDOInfo",
"CoeDetailsEnablePDOAssign": "EnablePDOAssign",
"CoeDetailsEnablePDOConfiguration": "EnablePDOConfiguration",
"CoeDetailsEnableUploadAtStartup": "EnableUploadAtStartup",
"CoeDetailsEnableSDOCompleteAccess": "EnableSDOCompleteAccess"
},
"od": {
"sdo": {
"2000": {
"otype": "RECORD",
"name": "StepperData",
"access": "RO",
"items": [
{
"name": "Max SubIndex"
},
{
"name": "Period",
"dtype": "UNSIGNED16",
"data": "&Obj.StepperData.Period",
"value": "1000",
"access": "RO"
},
{
"name": "Resolution",
"dtype": "REAL32",
"value": "2.5",
"access": "RO",
"data": "&Obj.StepperData.Resolution"
}
],
"isSDOitem": true
},
"A": {
"otype": "RECORD",
"name": "Error Settings",
@@ -44,143 +51,125 @@
},
"txpdo": {
"6000": {
"otype": "VAR",
"name": "EncPos",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "REAL64",
"value": "0",
"data": "&Obj.EncPos"
},
"6001": {
"otype": "VAR",
"name": "EncFrequency",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "REAL64",
"value": "0",
"data": "&Obj.EncFrequency"
},
"6002": {
"otype": "VAR",
"name": "DiffT",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "UNSIGNED32",
"value": "0",
"data": "&Obj.DiffT"
},
"6003": {
"otype": "VAR",
"name": "IndexByte",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "UNSIGNED32",
"value": "0",
"data": "&Obj.IndexByte"
},
"6004": {
"otype": "VAR",
"name": "IndexStatus",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "UNSIGNED32",
"value": "0",
"data": "&Obj.IndexStatus"
},
"6005": {
"otype": "RECORD",
"name": "EncoderOut",
"name": "StepGenOut1",
"access": "RO",
"items": [
{
"name": "Max SubIndex"
},
{
"name": "ECount",
"dtype": "INTEGER32",
"name": "ActualPosition",
"dtype": "REAL64",
"data": "&Obj.StepGenOut1.ActualPosition",
"value": "0",
"access": "RO",
"data": "&Obj.EncoderOut.ECount"
},
{
"name": "IndexTriggered",
"dtype": "UNSIGNED8",
"value": "0",
"access": "RW",
"data": "&Obj.EncoderOut.IndexTriggered"
"access": "RO"
}
],
"pdo_mappings": [
"txpdo"
]
},
"6040": {
"otype": "VAR",
"name": "ControlWord",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "UNSIGNED16",
"value": "0",
"data": "&Obj.ControlWord"
},
"6060": {
"otype": "VAR",
"name": "OpMode",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "UNSIGNED8",
"value": "0",
"data": "&Obj.OpMode"
},
"607A": {
"otype": "VAR",
"name": "TargetPosition",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "INTEGER32",
"value": "0",
"data": "&Obj.TargetPosition"
},
"60FF": {
"otype": "VAR",
"name": "TargetVelocity",
"access": "RO",
"pdo_mappings": [
"txpdo"
],
"dtype": "INTEGER32",
"value": "0",
"data": "&Obj.TargetVelocity"
}
},
"rxpdo": {
"6041": {
"otype": "VAR",
"name": "StatusWord",
"access": "RO",
"pdo_mappings": [
"rxpdo"
],
"dtype": "UNSIGNED16",
"value": "0",
"data": "&Obj.StatusWord"
},
"6061": {
"otype": "VAR",
"name": "OpModeDisplay",
"access": "RO",
"pdo_mappings": [
"rxpdo"
],
"dtype": "UNSIGNED8",
"value": "0",
"data": "&Obj.OpModeDisplay"
},
"6064": {
"otype": "VAR",
"name": "ActualPosition",
"access": "RO",
"pdo_mappings": [
"rxpdo"
],
"dtype": "INTEGER32",
"value": "0",
"data": "&Obj.ActualPosition"
},
"6077": {
"otype": "VAR",
"name": "ActualTorque",
"access": "RO",
"pdo_mappings": [
"rxpdo"
],
"dtype": "INTEGER32",
"value": "0",
"data": "&Obj.ActualTorque"
},
"7000": {
"otype": "VAR",
"name": "EncPosScale",
"access": "RO",
"pdo_mappings": [
"rxpdo"
],
"dtype": "INTEGER32",
"value": "0",
"data": "&Obj.EncPosScale"
},
"7001": {
"otype": "VAR",
"name": "IndexLatchEnable",
"access": "RO",
"pdo_mappings": [
"rxpdo"
],
"dtype": "UNSIGNED32",
"value": "0",
"data": "&Obj.IndexLatchEnable"
},
"7002": {
"otype": "RECORD",
"name": "EncoderIn",
"name": "StepGenIn1",
"access": "RO",
"items": [
{
"name": "Max SubIndex"
},
{
"name": "IndexEnable",
"dtype": "UNSIGNED8",
"name": "CommandedPosition",
"dtype": "REAL64",
"data": "&Obj.StepGenIn1.CommandedPosition",
"value": "0",
"access": "RO",
"data": "&Obj.EncoderIn.IndexEnable"
"access": "RO"
},
{
"name": "Reset",
"dtype": "UNSIGNED8",
"name": "CommandedVelocity",
"dtype": "REAL64",
"value": "0",
"access": "RO",
"data": "&Obj.EncoderIn.Reset"
"data": "&Obj.StepGenIn1.CommandedVelocity"
}
],
"pdo_mappings": [
@@ -196,17 +185,6 @@
],
"dtype": "INTEGER32",
"value": "0"
},
"606C": {
"otype": "VAR",
"name": "ActualVelocity",
"access": "RO",
"pdo_mappings": [
"rxpdo"
],
"dtype": "INTEGER32",
"value": "0",
"data": "&Obj.ActualVelocity"
}
}
},

242
Firmware/lib/soes/objectlist.c Executable file
View File

@@ -0,0 +1,242 @@
#include "esc_coe.h"
#include "utypes.h"
#include <stddef.h>
static const char acName1000[] = "Device Type";
static const char acName1008[] = "Device Name";
static const char acName1009[] = "Hardware Version";
static const char acName100A[] = "Software Version";
static const char acName1018[] = "Identity Object";
static const char acName1018_00[] = "Max SubIndex";
static const char acName1018_01[] = "Vendor ID";
static const char acName1018_02[] = "Product Code";
static const char acName1018_03[] = "Revision Number";
static const char acName1018_04[] = "Serial Number";
static const char acName1600[] = "EncPosScale";
static const char acName1600_00[] = "Max SubIndex";
static const char acName1600_01[] = "EncPosScale";
static const char acName1601[] = "IndexLatchEnable";
static const char acName1601_00[] = "Max SubIndex";
static const char acName1601_01[] = "IndexLatchEnable";
static const char acName1602[] = "StepGenIn1";
static const char acName1602_00[] = "Max SubIndex";
static const char acName1602_01[] = "CommandedPosition";
static const char acName1602_02[] = "CommandedVelocity";
static const char acName1A00[] = "EncPos";
static const char acName1A00_00[] = "Max SubIndex";
static const char acName1A00_01[] = "EncPos";
static const char acName1A01[] = "EncFrequency";
static const char acName1A01_00[] = "Max SubIndex";
static const char acName1A01_01[] = "EncFrequency";
static const char acName1A02[] = "DiffT";
static const char acName1A02_00[] = "Max SubIndex";
static const char acName1A02_01[] = "DiffT";
static const char acName1A03[] = "IndexByte";
static const char acName1A03_00[] = "Max SubIndex";
static const char acName1A03_01[] = "IndexByte";
static const char acName1A04[] = "IndexStatus";
static const char acName1A04_00[] = "Max SubIndex";
static const char acName1A04_01[] = "IndexStatus";
static const char acName1A05[] = "StepGenOut1";
static const char acName1A05_00[] = "Max SubIndex";
static const char acName1A05_01[] = "ActualPosition";
static const char acName1C00[] = "Sync Manager Communication Type";
static const char acName1C00_00[] = "Max SubIndex";
static const char acName1C00_01[] = "Communications Type SM0";
static const char acName1C00_02[] = "Communications Type SM1";
static const char acName1C00_03[] = "Communications Type SM2";
static const char acName1C00_04[] = "Communications Type SM3";
static const char acName1C12[] = "Sync Manager 2 PDO Assignment";
static const char acName1C12_00[] = "Max SubIndex";
static const char acName1C12_01[] = "PDO Mapping";
static const char acName1C12_02[] = "PDO Mapping";
static const char acName1C12_03[] = "PDO Mapping";
static const char acName1C13[] = "Sync Manager 3 PDO Assignment";
static const char acName1C13_00[] = "Max SubIndex";
static const char acName1C13_01[] = "PDO Mapping";
static const char acName1C13_02[] = "PDO Mapping";
static const char acName1C13_03[] = "PDO Mapping";
static const char acName1C13_04[] = "PDO Mapping";
static const char acName1C13_05[] = "PDO Mapping";
static const char acName1C13_06[] = "PDO Mapping";
static const char acName6000[] = "EncPos";
static const char acName6001[] = "EncFrequency";
static const char acName6002[] = "DiffT";
static const char acName6003[] = "IndexByte";
static const char acName6004[] = "IndexStatus";
static const char acName6005[] = "StepGenOut1";
static const char acName6005_00[] = "Max SubIndex";
static const char acName6005_01[] = "ActualPosition";
static const char acName7000[] = "EncPosScale";
static const char acName7001[] = "IndexLatchEnable";
static const char acName7002[] = "StepGenIn1";
static const char acName7002_00[] = "Max SubIndex";
static const char acName7002_01[] = "CommandedPosition";
static const char acName7002_02[] = "CommandedVelocity";
const _objd SDO1000[] =
{
{0x0, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1000, 5001, NULL},
};
const _objd SDO1008[] =
{
{0x0, DTYPE_VISIBLE_STRING, 208, ATYPE_RO, acName1008, 0, "MetalMusings EaserCAT 2000"},
};
const _objd SDO1009[] =
{
{0x0, DTYPE_VISIBLE_STRING, 40, ATYPE_RO, acName1009, 0, "0.0.1"},
};
const _objd SDO100A[] =
{
{0x0, DTYPE_VISIBLE_STRING, 40, ATYPE_RO, acName100A, 0, "0.0.1"},
};
const _objd SDO1018[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1018_00, 4, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1018_01, 2730, NULL},
{0x02, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1018_02, 12303564, NULL},
{0x03, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1018_03, 2, NULL},
{0x04, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1018_04, 1, &Obj.serial},
};
const _objd SDO1600[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1600_00, 1, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1600_01, 0x70000020, NULL},
};
const _objd SDO1601[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1601_00, 1, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1601_01, 0x70010020, NULL},
};
const _objd SDO1602[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1602_00, 2, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1602_01, 0x70020140, NULL},
{0x02, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1602_02, 0x70020240, NULL},
};
const _objd SDO1A00[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A00_00, 1, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1A00_01, 0x60000040, NULL},
};
const _objd SDO1A01[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A01_00, 1, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1A01_01, 0x60010040, NULL},
};
const _objd SDO1A02[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A02_00, 1, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1A02_01, 0x60020020, NULL},
};
const _objd SDO1A03[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A03_00, 1, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1A03_01, 0x60030020, NULL},
};
const _objd SDO1A04[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A04_00, 1, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1A04_01, 0x60040020, NULL},
};
const _objd SDO1A05[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A05_00, 1, NULL},
{0x01, DTYPE_UNSIGNED64, 64, ATYPE_RO, acName1A05_01, 0x60050140, NULL},
};
const _objd SDO1C00[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C00_00, 4, NULL},
{0x01, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C00_01, 1, NULL},
{0x02, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C00_02, 2, NULL},
{0x03, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C00_03, 3, NULL},
{0x04, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C00_04, 4, NULL},
};
const _objd SDO1C12[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C12_00, 3, NULL},
{0x01, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_01, 0x1600, NULL},
{0x02, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_02, 0x1601, NULL},
{0x03, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_03, 0x1602, NULL},
};
const _objd SDO1C13[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C13_00, 6, NULL},
{0x01, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_01, 0x1A00, NULL},
{0x02, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_02, 0x1A01, NULL},
{0x03, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_03, 0x1A02, NULL},
{0x04, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_04, 0x1A03, NULL},
{0x05, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_05, 0x1A04, NULL},
{0x06, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_06, 0x1A05, NULL},
};
const _objd SDO6000[] =
{
{0x0, DTYPE_REAL64, 64, ATYPE_RO | ATYPE_TXPDO, acName6000, 0, &Obj.EncPos},
};
const _objd SDO6001[] =
{
{0x0, DTYPE_REAL64, 64, ATYPE_RO | ATYPE_TXPDO, acName6001, 0, &Obj.EncFrequency},
};
const _objd SDO6002[] =
{
{0x0, DTYPE_UNSIGNED32, 32, ATYPE_RO | ATYPE_TXPDO, acName6002, 0, &Obj.DiffT},
};
const _objd SDO6003[] =
{
{0x0, DTYPE_UNSIGNED32, 32, ATYPE_RO | ATYPE_TXPDO, acName6003, 0, &Obj.IndexByte},
};
const _objd SDO6004[] =
{
{0x0, DTYPE_UNSIGNED32, 32, ATYPE_RO | ATYPE_TXPDO, acName6004, 0, &Obj.IndexStatus},
};
const _objd SDO6005[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName6005_00, 1, NULL},
{0x01, DTYPE_REAL64, 64, ATYPE_RO, acName6005_01, 0, &Obj.StepGenOut1.ActualPosition},
};
const _objd SDO7000[] =
{
{0x0, DTYPE_INTEGER32, 32, ATYPE_RO | ATYPE_RXPDO, acName7000, 0, &Obj.EncPosScale},
};
const _objd SDO7001[] =
{
{0x0, DTYPE_UNSIGNED32, 32, ATYPE_RO | ATYPE_RXPDO, acName7001, 0, &Obj.IndexLatchEnable},
};
const _objd SDO7002[] =
{
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7002_00, 2, NULL},
{0x01, DTYPE_REAL64, 64, ATYPE_RO, acName7002_01, 0, &Obj.StepGenIn1.CommandedPosition},
{0x02, DTYPE_REAL64, 64, ATYPE_RO, acName7002_02, 0, &Obj.StepGenIn1.CommandedVelocity},
};
const _objectlist SDOobjects[] =
{
{0x1000, OTYPE_VAR, 0, 0, acName1000, SDO1000},
{0x1008, OTYPE_VAR, 0, 0, acName1008, SDO1008},
{0x1009, OTYPE_VAR, 0, 0, acName1009, SDO1009},
{0x100A, OTYPE_VAR, 0, 0, acName100A, SDO100A},
{0x1018, OTYPE_RECORD, 4, 0, acName1018, SDO1018},
{0x1600, OTYPE_RECORD, 1, 0, acName1600, SDO1600},
{0x1601, OTYPE_RECORD, 1, 0, acName1601, SDO1601},
{0x1602, OTYPE_RECORD, 2, 0, acName1602, SDO1602},
{0x1A00, OTYPE_RECORD, 1, 0, acName1A00, SDO1A00},
{0x1A01, OTYPE_RECORD, 1, 0, acName1A01, SDO1A01},
{0x1A02, OTYPE_RECORD, 1, 0, acName1A02, SDO1A02},
{0x1A03, OTYPE_RECORD, 1, 0, acName1A03, SDO1A03},
{0x1A04, OTYPE_RECORD, 1, 0, acName1A04, SDO1A04},
{0x1A05, OTYPE_RECORD, 1, 0, acName1A05, SDO1A05},
{0x1C00, OTYPE_ARRAY, 4, 0, acName1C00, SDO1C00},
{0x1C12, OTYPE_ARRAY, 3, 0, acName1C12, SDO1C12},
{0x1C13, OTYPE_ARRAY, 6, 0, acName1C13, SDO1C13},
{0x6000, OTYPE_VAR, 0, 0, acName6000, SDO6000},
{0x6001, OTYPE_VAR, 0, 0, acName6001, SDO6001},
{0x6002, OTYPE_VAR, 0, 0, acName6002, SDO6002},
{0x6003, OTYPE_VAR, 0, 0, acName6003, SDO6003},
{0x6004, OTYPE_VAR, 0, 0, acName6004, SDO6004},
{0x6005, OTYPE_RECORD, 1, 0, acName6005, SDO6005},
{0x7000, OTYPE_VAR, 0, 0, acName7000, SDO7000},
{0x7001, OTYPE_VAR, 0, 0, acName7001, SDO7001},
{0x7002, OTYPE_RECORD, 2, 0, acName7002, SDO7002},
{0xffff, 0xff, 0xff, 0xff, NULL, NULL}
};

40
Firmware/lib/soes/utypes.h Executable file
View File

@@ -0,0 +1,40 @@
#ifndef __UTYPES_H__
#define __UTYPES_H__
#include "cc.h"
/* Object dictionary storage */
typedef struct
{
/* Identity */
uint32_t serial;
/* Inputs */
double EncPos;
double EncFrequency;
uint32_t DiffT;
uint32_t IndexByte;
uint32_t IndexStatus;
struct
{
double ActualPosition;
} StepGenOut1;
/* Outputs */
int32_t EncPosScale;
uint32_t IndexLatchEnable;
struct
{
double CommandedPosition;
double CommandedVelocity;
} StepGenIn1;
} _Objects;
extern _Objects Obj;
#endif /* __UTYPES_H__ */

View File

@@ -14,9 +14,10 @@ platform = ststm32
board = genericSTM32F407VGT6
upload_protocol = stlink
debug_tool = stlink
debug_build_flags = -O0 -g -ggdb
debug_build_flags = -O0 -g -ggdb
monitor_port = COM7
monitor_speed = 115200
build_flags = -Wl,--no-warn-rwx-segment
lib_deps =
SPI
lib_deps =
SPI
rlogiacco/CircularBuffer@^1.3.3

268
Firmware/src/main.cpp Executable file
View File

@@ -0,0 +1,268 @@
#include <Arduino.h>
#include <HardwareTimer.h>
#include <stdio.h>
extern "C"
{
#include "ecat_slv.h"
#include "utypes.h"
};
#include <CircularBuffer.h>
#define RINGBUFFERLEN 101
CircularBuffer<double_t, RINGBUFFERLEN> Pos;
CircularBuffer<uint32_t, RINGBUFFERLEN> TDelta;
#include <Stm32F4_Encoder.h>
int64_t PreviousEncoderCounterValue = 0;
int64_t unwrap_encoder(uint16_t in, int64_t *prev);
Encoder EncoderInit;
Encoder *encP = &EncoderInit;
#define INDEX_PIN PA2
HardwareSerial Serial1(PA10, PA9);
_Objects Obj;
void indexPulse(void);
double PosScaleRes = 1.0;
uint32_t CurPosScale = 1;
uint8_t OldLatchCEnable = 0;
volatile uint8_t indexPulseFired = 0;
uint32_t nFires = 0;
volatile uint8_t pleaseZeroTheCounter = 0;
#define STEPPER_DIR_PIN PA12
#define STEPPER_STEP_PIN PA11
HardwareTimer *MyTim;
volatile uint32_t stepCount = 0, stepPulses = 0;
volatile double_t actualPosition = 0;
volatile double_t requestedPosition, requestedVelocity;
uint32_t sync0CycleTime = 0;
void handleStepper(void);
void makePulses(uint32_t period /* in usecs */, int32_t pulses /* nr of pulses to do*/);
void cb_set_outputs(void) // Master outputs gets here, slave inputs, first operation
{
if (Obj.IndexLatchEnable && !OldLatchCEnable) // Should only happen first time IndexCEnable is set
{
pleaseZeroTheCounter = 1;
}
OldLatchCEnable = Obj.IndexLatchEnable;
if (CurPosScale != Obj.EncPosScale && Obj.EncPosScale != 0)
{
CurPosScale = Obj.EncPosScale;
PosScaleRes = 1.0 / double(CurPosScale);
}
requestedPosition = Obj.StepGenIn1.CommandedPosition;
requestedVelocity = Obj.StepGenIn1.CommandedVelocity;
}
void cb_get_inputs(void) // Set Master inputs, slave outputs, last operation
{
Obj.IndexStatus = 0;
if (indexPulseFired)
{
Obj.IndexStatus = 1;
indexPulseFired = 0;
nFires++;
PreviousEncoderCounterValue = 0;
}
// Obj.DiffT = sync0CycleTime;
int64_t pos = unwrap_encoder(TIM2->CNT, &PreviousEncoderCounterValue);
double CurPos = pos * PosScaleRes;
Obj.EncPos = CurPos;
double diffT = 0;
double diffPos = 0;
TDelta.push(ESCvar.Time); // Running average over the length of the circular buffer
Pos.push(CurPos);
if (Pos.size() >= 2)
{
diffT = 1.0e-9 * (TDelta.last() - TDelta.first()); // Time is in nanoseconds
diffPos = fabs(Pos.last() - Pos.first());
}
Obj.EncFrequency = diffT != 0 ? diffPos / diffT : 0.0; // Revolutions per second
Obj.IndexByte = digitalRead(INDEX_PIN);
if (Obj.IndexByte)
Serial1.printf("IS 1\n");
Obj.StepGenOut1.ActualPosition = actualPosition;
Obj.DiffT = 10000 * requestedPosition; // deltaT;
}
void ESC_interrupt_enable(uint32_t mask);
void ESC_interrupt_disable(uint32_t mask);
uint16_t dc_checker(void);
static esc_cfg_t config =
{
.user_arg = NULL,
.use_interrupt = 1,
.watchdog_cnt = 150,
.set_defaults_hook = NULL,
.pre_state_change_hook = NULL,
.post_state_change_hook = NULL,
.application_hook = handleStepper, // StepGen,
.safeoutput_override = NULL,
.pre_object_download_hook = NULL,
.post_object_download_hook = NULL,
.rxpdo_override = NULL,
.txpdo_override = NULL,
.esc_hw_interrupt_enable = ESC_interrupt_enable,
.esc_hw_interrupt_disable = ESC_interrupt_disable,
.esc_hw_eep_handler = NULL,
.esc_check_dc_handler = dc_checker,
};
void TimerStep_CB(void)
{
stepCount++;
if (stepCount == stepPulses)
{
MyTim->pause();
}
}
void makePulses(uint32_t period /* in usecs */, int32_t pulses /* nr of pulses to do*/)
{
byte sgn = pulses > 0 ? HIGH : LOW;
digitalWrite(STEPPER_DIR_PIN, sgn); // I think one should really wait a bit when changed
uint32_t puls = abs(pulses);
MyTim->setOverflow(abs(pulses) * 1000000 / period, HERTZ_FORMAT);
MyTim->setCaptureCompare(4, 50, PERCENT_COMPARE_FORMAT); // 50 %
stepCount = 0;
stepPulses = abs(pulses);
MyTim->resume();
}
void sync0Handler(void);
void setup(void)
{
Serial1.begin(115200);
rcc_config();
TIM_TypeDef *Instance = TIM1;
MyTim = new HardwareTimer(Instance);
MyTim->setMode(4, TIMER_OUTPUT_COMPARE_PWM2, STEPPER_STEP_PIN);
MyTim->attachInterrupt(TimerStep_CB);
pinMode(STEPPER_DIR_PIN, OUTPUT);
// Set starting count value
EncoderInit.SetCount(Tim2, 0);
attachInterrupt(digitalPinToInterrupt(INDEX_PIN), indexPulse, RISING); // Always when Index triggered
// EncoderInit.SetCount(Tim3, 0);
// EncoderInit.SetCount(Tim4, 0);
// EncoderInit.SetCount(Tim8, 0);
ecat_slv_init(&config);
}
volatile byte serveIRQ = 0;
void loop(void)
{
ESCvar.PrevTime = ESCvar.Time;
if (serveIRQ)
{
DIG_process(DIG_PROCESS_WD_FLAG | DIG_PROCESS_OUTPUTS_FLAG |
DIG_PROCESS_APP_HOOK_FLAG | DIG_PROCESS_INPUTS_FLAG);
serveIRQ = 0;
}
ecat_slv_poll();
}
#define ONE_PERIOD 65536
#define HALF_PERIOD 32768
int64_t unwrap_encoder(uint16_t in, int64_t *prev)
{
int64_t c64 = (int32_t)in - HALF_PERIOD; // remove half period to determine (+/-) sign of the wrap
int64_t dif = (c64 - *prev); // core concept: prev + (current - prev) = current
// wrap difference from -HALF_PERIOD to HALF_PERIOD. modulo prevents differences after the wrap from having an incorrect result
int64_t mod_dif = ((dif + HALF_PERIOD) % ONE_PERIOD) - HALF_PERIOD;
if (dif < -HALF_PERIOD)
mod_dif += ONE_PERIOD; // account for mod of negative number behavior in C
int64_t unwrapped = *prev + mod_dif;
*prev = unwrapped; // load previous value
return unwrapped + HALF_PERIOD; // remove the shift we applied at the beginning, and return
}
void indexPulse(void)
{
if (pleaseZeroTheCounter)
{
TIM2->CNT = 0;
indexPulseFired = 1;
Pos.clear();
TDelta.clear();
pleaseZeroTheCounter = 0;
}
}
void sync0Handler(void)
{
serveIRQ = 1;
}
void handleStepper(void)
{
byte forwardDirection = 0; // 1 if going forward
int32_t pulsesToGo = 100 * (requestedPosition - actualPosition);
if (pulsesToGo != 0)
makePulses(900, pulsesToGo); // Make the pulses using hardware timer
actualPosition = requestedPosition;
}
void ESC_interrupt_enable(uint32_t mask)
{
// Enable interrupt for SYNC0 or SM2 or SM3
uint32_t user_int_mask = ESCREG_ALEVENT_DC_SYNC0 |
ESCREG_ALEVENT_SM2 |
ESCREG_ALEVENT_SM3;
if (mask & user_int_mask)
{
ESC_ALeventmaskwrite(ESC_ALeventmaskread() | (mask & user_int_mask));
attachInterrupt(digitalPinToInterrupt(PC3), sync0Handler, RISING);
// Set LAN9252 interrupt pin driver as push-pull active high
uint32_t bits = 0x00000111;
ESC_write(0x54, &bits, 4);
// Enable LAN9252 interrupt
bits = 0x00000001;
ESC_write(0x5c, &bits, 4);
}
}
void ESC_interrupt_disable(uint32_t mask)
{
// Enable interrupt for SYNC0 or SM2 or SM3
uint32_t user_int_mask = ESCREG_ALEVENT_DC_SYNC0 |
ESCREG_ALEVENT_SM2 |
ESCREG_ALEVENT_SM3;
if (mask & user_int_mask)
{
// Disable interrupt from SYNC0
ESC_ALeventmaskwrite(ESC_ALeventmaskread() & ~(mask & user_int_mask));
detachInterrupt(digitalPinToInterrupt(PC3));
// Disable LAN9252 interrupt
uint32_t bits = 0x00000000;
ESC_write(0x5c, &bits, 4);
}
}
extern "C" uint32_t ESC_SYNC0cycletime(void);
// Setup of DC
uint16_t dc_checker(void)
{
// Indicate we run DC
ESCvar.dcsync = 0;
sync0CycleTime = ESC_SYNC0cycletime();
return 0;
}

View File

@@ -0,0 +1,3 @@
AX58100-stm32-ethercat-backups
.~lock*
fp-info-cache

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
"Id";"Designator";"Footprint";"Quantity";"Designation";"Supplier and ref";
1;"J8";"JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical";1;"Stepper 2";;;
2;"U1";"LQFP-80-1EP_10x10mm_P0.4mm_EP5.3x4.5mm_ThermalVias";1;"AX58100";;;
3;"B3,B7,B4,B6,B5";"C_0805_2012Metric";5;"BLM18EG221SN1D";;;
4;"R59,R61,R51,R45,R60,R58,R50,R57,R53,R52,R56,R55,R46,R54";"R_0805_2012Metric";14;"1k";;;
5;"U5";"LQFP-100_14x14mm_P0.5mm";1;"STM32F407VGT6";;;
6;"U2";"SOIC-8_3.9x4.9mm_P1.27mm";1;"24LC32A";;;
7;"R3,R49,R2,R48,R1";"R_0805_2012Metric";5;"22";;;
8;"C23,C21,C24,C22,C19,C25,C26,C20";"C_0805_2012Metric";8;"10pF";;;
9;"J3,J4,J5";"JST_XH_B6B-XH-A_1x06_P2.50mm_Vertical";3;"Conn_01x06_Pin";;;
10;"J9";"PinHeader_1x04_P2.54mm_Vertical";1;"I2C bus2";;;
11;"C45,C36,C34,C37,C38,C9,C39,C27,C13,C12,C40,C10,C8,C6,C29,C11,C46,C28,C3,C33,C41,C5,C2,C31,C18,C43,C14,C4,C7,C1";"C_0805_2012Metric";30;"0.1uF";;;
12;"Y2";"Crystal_HC49-U_Vertical";1;"8 MHz";;;
13;"R11,R7,R30,R12,R5,R10,R38,R13,R40,R33,R8";"R_0805_2012Metric";11;"4.7k";;;
14;"D1,D2";"LED_0805_2012Metric";2;"Green led";;;
15;"R28,R39,R25,R41,R26,R44,R27";"R_0805_2012Metric";7;"510";;;
16;"J14";"JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical";1;"Encoder 4";;;
17;"C35,C32,C44,C30";"C_0805_2012Metric";4;"10uF";;;
18;"C49,C53";"C_0805_2012Metric";2;"2.2uF";;;
19;"D4,D5";"LED_0805_2012Metric";2;"Blue led";;;
20;"R22,R18,R19,R20,R17,R23,R21,R24";"R_0805_2012Metric";8;"49.9";;;
21;"C17,C15";"C_0805_2012Metric";2;"18pF";;;
22;"Y1";"Crystal_SMD_SeikoEpson_TSX3225-4Pin_3.2x2.5mm";1;"NXK25.000AE12F-KAB6-12";;;
23;"J12";"JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical";1;"Encoder 2";;;
24;"J1";"JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical";1;"Conn_01x02_Pin";;;
25;"IN1,OUT1";"PulseJack JB0011D01BNL";2;"J0011D01BNL";;;
26;"J2";"JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical";1;"STLINK";;;
27;"C52,C51";"C_0805_2012Metric";2;"22pF";;;
28;"B2,B1";"C_0805_2012Metric";2;"BLM18EG221S";;;
29;"J10";"JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical";1;"DAC1";;;
30;"U4";"SOT-223-3_TabPin2";1;"AMS1117-3.3";;;
31;"J7";"JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical";1;"Stepper 1";;;
32;"J6";"JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical";1;"Serial usart1";;;
33;"SW1";"SW_Push_1P1T_XKB_TS-1187A";1;"SW PB";;;
34;"C16";"C_0805_2012Metric";1;"1uF";;;
35;"D3";"LED_0805_2012Metric";1;"Red led";;;
36;"J13";"JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical";1;"Encoder 3";;;
37;"J11";"JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical";1;"Encoder 1";;;
38;"U3";"SOT-223-3_TabPin2";1;"AMS1117-1.2";;;
39;"R6";"R_0805_2012Metric";1;"12k 1%";;;
1 Id Designator Footprint Quantity Designation Supplier and ref
2 1 J8 JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical 1 Stepper 2
3 2 U1 LQFP-80-1EP_10x10mm_P0.4mm_EP5.3x4.5mm_ThermalVias 1 AX58100
4 3 B3,B7,B4,B6,B5 C_0805_2012Metric 5 BLM18EG221SN1D
5 4 R59,R61,R51,R45,R60,R58,R50,R57,R53,R52,R56,R55,R46,R54 R_0805_2012Metric 14 1k
6 5 U5 LQFP-100_14x14mm_P0.5mm 1 STM32F407VGT6
7 6 U2 SOIC-8_3.9x4.9mm_P1.27mm 1 24LC32A
8 7 R3,R49,R2,R48,R1 R_0805_2012Metric 5 22
9 8 C23,C21,C24,C22,C19,C25,C26,C20 C_0805_2012Metric 8 10pF
10 9 J3,J4,J5 JST_XH_B6B-XH-A_1x06_P2.50mm_Vertical 3 Conn_01x06_Pin
11 10 J9 PinHeader_1x04_P2.54mm_Vertical 1 I2C bus2
12 11 C45,C36,C34,C37,C38,C9,C39,C27,C13,C12,C40,C10,C8,C6,C29,C11,C46,C28,C3,C33,C41,C5,C2,C31,C18,C43,C14,C4,C7,C1 C_0805_2012Metric 30 0.1uF
13 12 Y2 Crystal_HC49-U_Vertical 1 8 MHz
14 13 R11,R7,R30,R12,R5,R10,R38,R13,R40,R33,R8 R_0805_2012Metric 11 4.7k
15 14 D1,D2 LED_0805_2012Metric 2 Green led
16 15 R28,R39,R25,R41,R26,R44,R27 R_0805_2012Metric 7 510
17 16 J14 JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical 1 Encoder 4
18 17 C35,C32,C44,C30 C_0805_2012Metric 4 10uF
19 18 C49,C53 C_0805_2012Metric 2 2.2uF
20 19 D4,D5 LED_0805_2012Metric 2 Blue led
21 20 R22,R18,R19,R20,R17,R23,R21,R24 R_0805_2012Metric 8 49.9
22 21 C17,C15 C_0805_2012Metric 2 18pF
23 22 Y1 Crystal_SMD_SeikoEpson_TSX3225-4Pin_3.2x2.5mm 1 NXK25.000AE12F-KAB6-12
24 23 J12 JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical 1 Encoder 2
25 24 J1 JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical 1 Conn_01x02_Pin
26 25 IN1,OUT1 PulseJack JB0011D01BNL 2 J0011D01BNL
27 26 J2 JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical 1 STLINK
28 27 C52,C51 C_0805_2012Metric 2 22pF
29 28 B2,B1 C_0805_2012Metric 2 BLM18EG221S
30 29 J10 JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical 1 DAC1
31 30 U4 SOT-223-3_TabPin2 1 AMS1117-3.3
32 31 J7 JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical 1 Stepper 1
33 32 J6 JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical 1 Serial usart1
34 33 SW1 SW_Push_1P1T_XKB_TS-1187A 1 SW PB
35 34 C16 C_0805_2012Metric 1 1uF
36 35 D3 LED_0805_2012Metric 1 Red led
37 36 J13 JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical 1 Encoder 3
38 37 J11 JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical 1 Encoder 1
39 38 U3 SOT-223-3_TabPin2 1 AMS1117-1.2
40 39 R6 R_0805_2012Metric 1 12k 1%

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,77 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "7ffffff_80000001",
"zone_display_mode": 0
},
"meta": {
"filename": "Ax58100-stm32-ethercat.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

View File

@@ -0,0 +1,506 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"board_outline_line_width": 0.09999999999999999,
"copper_line_width": 0.19999999999999998,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.049999999999999996,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.09999999999999999,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.15,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.15,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"min_clearance": 0.5
}
},
"diff_pair_dimensions": [
{
"gap": 0.0,
"via_gap": 0.0,
"width": 0.0
}
],
"drc_exclusions": [],
"meta": {
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"connection_width": "warning",
"copper_edge_clearance": "error",
"copper_sliver": "warning",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint": "error",
"footprint_type_mismatch": "ignore",
"hole_clearance": "error",
"hole_near_hole": "error",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"lib_footprint_issues": "warning",
"lib_footprint_mismatch": "warning",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "warning",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_edge_clearance": "warning",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"solder_mask_bridge": "error",
"starved_thermal": "error",
"text_height": "warning",
"text_thickness": "warning",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zones_intersect": "error"
},
"rules": {
"max_error": 0.005,
"min_clearance": 0.0,
"min_connection": 0.0,
"min_copper_edge_clearance": 0.0,
"min_hole_clearance": 0.25,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.19999999999999998,
"min_microvia_drill": 0.09999999999999999,
"min_resolved_spokes": 2,
"min_silk_clearance": 0.0,
"min_text_height": 0.7999999999999999,
"min_text_thickness": 0.08,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.0,
"min_via_annular_width": 0.09999999999999999,
"min_via_diameter": 0.5,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0,
"solder_mask_to_copper_clearance": 0.0,
"use_height_for_length_calcs": true
},
"teardrop_options": [
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 5,
"td_on_pad_in_zone": false,
"td_onpadsmd": true,
"td_onroundshapesonly": false,
"td_ontrackend": false,
"td_onviapad": true
}
],
"teardrop_parameters": [
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_round_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_rect_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_track_end",
"td_width_to_size_filter_ratio": 0.9
}
],
"track_widths": [
0.0
],
"via_dimensions": [
{
"diameter": 0.0,
"drill": 0.0
}
],
"zones_allow_external_fillets": false
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "ignore",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "Ax58100-stm32-ethercat.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.15,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.2,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": []
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "C:/Program Files/KiCad/7.0/",
"specctra_dsn": "Ax58100-stm32-ethercat.dsn",
"step": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "",
"page_layout_descr_file": "",
"plot_directory": "",
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"5597aedc-b607-407f-bbfd-31b3b298ecb1",
""
],
[
"9f485422-734f-43d3-94ea-443cbc453d2e",
"AX58100"
],
[
"5bf93325-f5d9-4344-9bf3-f5fc91bc1622",
"AX58100 phys etc"
],
[
"d564400f-40ba-4aca-9c2a-14ec52a8353b",
"STM32F4"
],
[
"0a376a6c-0f15-42f8-81f6-3a55619be267",
"Peripherals"
]
],
"text_variables": {}
}

View File

@@ -0,0 +1,87 @@
(kicad_sch (version 20230121) (generator eeschema)
(uuid 5597aedc-b607-407f-bbfd-31b3b298ecb1)
(paper "A3")
(lib_symbols
)
(text "Huvudsida" (at 162.56 85.09 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid adf2be63-7ec7-44be-837f-901ddbc80717)
)
(sheet (at 144.78 224.79) (size 71.12 16.51) (fields_autoplaced)
(stroke (width 0.1524) (type solid))
(fill (color 0 0 0 0.0000))
(uuid 0a376a6c-0f15-42f8-81f6-3a55619be267)
(property "Sheetname" "Peripherals" (at 144.78 224.0784 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
)
(property "Sheetfile" "peripherals.kicad_sch" (at 144.78 241.8846 0)
(effects (font (size 1.27 1.27)) (justify left top))
)
(instances
(project "Ax58100-stm32-ethercat"
(path "/5597aedc-b607-407f-bbfd-31b3b298ecb1" (page "5"))
)
)
)
(sheet (at 234.95 198.12) (size 102.87 34.29) (fields_autoplaced)
(stroke (width 0.1524) (type solid))
(fill (color 0 0 0 0.0000))
(uuid 5bf93325-f5d9-4344-9bf3-f5fc91bc1622)
(property "Sheetname" "AX58100 phys etc" (at 234.95 197.4084 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
)
(property "Sheetfile" "AX58100_phy_etc.kicad_sch" (at 234.95 232.9946 0)
(effects (font (size 1.27 1.27)) (justify left top))
)
(instances
(project "Ax58100-stm32-ethercat"
(path "/5597aedc-b607-407f-bbfd-31b3b298ecb1" (page "3"))
)
)
)
(sheet (at 233.68 123.19) (size 93.98 60.96) (fields_autoplaced)
(stroke (width 0.1524) (type solid))
(fill (color 0 0 0 0.0000))
(uuid 9f485422-734f-43d3-94ea-443cbc453d2e)
(property "Sheetname" "AX58100" (at 233.68 122.4784 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
)
(property "Sheetfile" "AX48100.kicad_sch" (at 233.68 184.7346 0)
(effects (font (size 1.27 1.27)) (justify left top))
)
(instances
(project "Ax58100-stm32-ethercat"
(path "/5597aedc-b607-407f-bbfd-31b3b298ecb1" (page "2"))
)
)
)
(sheet (at 142.24 200.66) (size 74.93 17.78) (fields_autoplaced)
(stroke (width 0.1524) (type solid))
(fill (color 0 0 0 0.0000))
(uuid d564400f-40ba-4aca-9c2a-14ec52a8353b)
(property "Sheetname" "STM32F4" (at 142.24 199.9484 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
)
(property "Sheetfile" "STM32F4.kicad_sch" (at 142.24 219.0246 0)
(effects (font (size 1.27 1.27)) (justify left top))
)
(instances
(project "Ax58100-stm32-ethercat"
(path "/5597aedc-b607-407f-bbfd-31b3b298ecb1" (page "4"))
)
)
)
(sheet_instances
(path "/" (page "1"))
)
)

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3
Kicad/Ethercat-stm32/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
fp-info-cache
Ethercat-stm32-backup*
*.lck

View File

@@ -64,7 +64,7 @@
39,
40
],
"visible_layers": "002ffe8_00000001",
"visible_layers": "002202a_00000001",
"zone_display_mode": 0
},
"meta": {

Some files were not shown because too many files have changed in this diff Show More