added slave files
This commit is contained in:
parent
33269ff676
commit
7938bfa26c
|
@ -0,0 +1,755 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<EtherCATInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="EtherCATInfo.xsd" Version="1.8">
|
||||
<Vendor>
|
||||
<Id>#x000004D8</Id>
|
||||
<Name>Microchip Technology Inc</Name>
|
||||
</Vendor>
|
||||
<Descriptions>
|
||||
<Groups>
|
||||
<Group>
|
||||
<Type>LAN9252-2_motor_Master</Type>
|
||||
<Name LcId="1033">LAN9252-2_motor_Master</Name>
|
||||
<ImageData16x14>424DD8020000000000003600000028000000100000000E0000000100180000000000A2020000120B0000120B000000000000000000001306E31306E3190CE42B1FE62B1FE61306E31F13E5190CE42519E51306E31306E3190CE42F24E7190CE41306E31306E31306E31306E35F56EC645CED645CED4137E91F13E5473DE95F57EC3227E71306E3473DE95A51EC271BE61306E31306E31409CA524CC68E8AD74F48C1615CC82218D03E36BF716BCE746FCE453DC01307CE3931BA7D78D27671D1150CB21409CA1712801B1D1D1B1D1D1B1D1D1B1D1D120B891B1D1D1B1D1D1B1D1D1B1D1D120B891B1D1D1B1D1D1B1D1D1B1D1D1712801712807F8080D4D5D5D4D5D5383939120B89545656D4D5D5D4D5D5626464130C89292B2BD4D5D5D4D5D56264641915801712804647471B1D1DAAAAAAD4D5D5130E82383939292B2B717272D4D5D5151183D4D5D57F80801B1D1D7172721E1C81191580464747D4D5D5D4D5D51B1D1D19158A292B2BD4D5D5D4D5D5292B2B1B1B8AD4D5D56264641B1D1D1B1D1D2427821E1D81D4D5D54647476264643839391E208BD4D5D57F8080464747545656242A8BD4D5D59B9C9C292B2BAAAAAA2D3683252882464747D4D5D5D4D5D51B1D1D272D85292B2BD4D5D5D4D5D5292B2B2E37861B1D1DD4D5D5D4D5D5464747394484323BB52324812122822426822526824554C0323883292B822A2D83353C84424CBF3238843940842E32834853865D6EBB5262EB3E43E83334E74147E94349E9535FEB4D56EA5662EB484DEA545DEB636FED545AEA5A63EC6671ED8CA0F290A5F2748AEF6B7BEE5D68EC6874ED788AEF8397F17684EF7986EF8C9FF2818FF1818EF08E9DF18A97F18791F19BA9F3B0C0F691A4F291A2F28390F192A1F29CACF3A3B3F498A6F3A4B3F4AEBDF5B0BEF59EA8F3A3ADF4BBC7F7C4D1F8CAD7F8CED9F9B4C4F6B8C8F6ACB8F59AA3F3B6C1F6C5D2F8C2CDF8CCD7F9D2DDF9D5E0FAD2DAF9D5DCF9DFE7FBE2E9FBE5EBFBE8EEFB0000</ImageData16x14>
|
||||
</Group>
|
||||
</Groups>
|
||||
<Devices>
|
||||
<Device Physics="YY">
|
||||
<Type ProductCode="#x00000002" RevisionNo="#x00000005">LAN9252-2_motor_Master</Type>
|
||||
<Name LcId="1033"><![CDATA[MSRM 2_motor_Master Ethercat Slave]]></Name>
|
||||
<Info>
|
||||
<EtherCATController>
|
||||
<DpramSize>4096</DpramSize>
|
||||
<SmCount>4</SmCount>
|
||||
<FmmuCount>3</FmmuCount>
|
||||
</EtherCATController>
|
||||
<Port>
|
||||
<Type>MII</Type>
|
||||
<PhysicalPhyAddr>0</PhysicalPhyAddr>
|
||||
</Port>
|
||||
<Port>
|
||||
<Type>MII</Type>
|
||||
<PhysicalPhyAddr>1</PhysicalPhyAddr>
|
||||
</Port>
|
||||
<IdentificationAdo>#x0012</IdentificationAdo>
|
||||
</Info>
|
||||
<GroupType>LAN9252-2_motor_Master</GroupType>
|
||||
<Fmmu>Outputs</Fmmu>
|
||||
<Fmmu>Inputs</Fmmu>
|
||||
<Sm StartAddress="#x1100" ControlByte="#x04" Enable="1">Outputs</Sm>
|
||||
<Sm StartAddress="#x1800" ControlByte="0" Enable="1">Inputs</Sm>
|
||||
<RxPdo Fixed="1" Sm="0">
|
||||
<Index>#x1a00</Index>
|
||||
<Name>ECAT2MCU</Name>
|
||||
<Entry>
|
||||
<Index>#x3101</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M1__control_mode</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3102</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M1__control_set</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3103</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__desired_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3104</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__desired_speed</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3105</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__desired__current</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3106</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Max_Pos</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3107</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Max_velocity</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3108</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Max_current</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3109</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Spare</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x310A</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M2__control_mode</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x310B</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M2__control_set</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x310C</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__desired_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x310D</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__desired_speed</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x310E</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__desired__current</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x310F</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Max_Pos</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3110</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Max_velocity</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3111</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Max_current</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3112</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Spare</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3113</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M3__control_mode</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3114</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M3__control_set</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3115</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__desired_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3116</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__desired_speed</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3117</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__desired__current</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3118</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Max_Pos</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3119</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Max_velocity</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x311A</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Max_current</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x311B</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Spare</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x311C</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M4__control_mode</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x311D</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M4__control_set</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x311E</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__desired_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x311F</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__desired_speed</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3120</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__desired__current</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3121</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Max_Pos</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3122</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Max_velocity</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3123</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Max_current</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3124</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Spare</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
</RxPdo>
|
||||
<TxPdo Fixed="1" Sm="1">
|
||||
<Index>#x1600</Index>
|
||||
<Name>MCU2ECAT</Name>
|
||||
<Entry>
|
||||
<Index>#x3001</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M1__status</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3002</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M1__mode</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3003</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Joint_rel_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3004</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Joint_abs_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3005</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Motor_speed</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3006</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Motor_current_bus</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3007</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Motor_currentPhA</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3008</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Motor_currentPhB</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3009</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Motor_currentPhC</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x300A</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Motor_hallState</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x300B</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M1__Motor_dutyCycle</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x300C</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M2__status</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x300D</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M2__mode</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x300E</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Joint__rel_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x300F</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Joint_abs_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3010</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Motor_speed</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3011</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Motor_current_bus</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3012</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Motor_currentPhA</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3013</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Motor_currentPhB</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3014</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Motor_currentPhC</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3015</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Motor_hallState</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3016</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M2__Motor_dutyCycle</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3017</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>EMG__CH1</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3018</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>EMG__CH2</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3019</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>EMG__CH3</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x301A</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>EMG__CH4</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x301B</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>EMG__CH5</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x301C</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>EMG__CH6</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x301D</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>EMG__CH7</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x301E</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>EMG__CH8</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x301F</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M3__status</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3020</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M3__mode</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3021</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Joint__rel_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3022</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Joint_abs_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3023</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Motor_speed</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3024</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Motor_current_bus</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3025</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Motor_currentPhA</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3026</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Motor_currentPhB</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3027</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Motor_currentPhC</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3028</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Motor_hallState</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3029</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M3__Motor_dutyCycle</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x302A</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M4__status</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x302B</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>M4__mode</Name>
|
||||
<DataType>BYTE</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x302C</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Joint__rel_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x302D</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Joint_abs_position</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x302E</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Motor_speed</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x302F</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Motor_current_bus</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3030</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Motor_currentPhA</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3031</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Motor_currentPhB</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3032</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Motor_currentPhC</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3033</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Motor_hallState</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3034</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>M4__Motor_dutyCycle</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3035</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>IMU__q_x0</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3036</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>IMU__q_y0</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3037</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>IMU__q_z0</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3038</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>IMU__q_w0</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3039</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>FSR__CH1</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x303A</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>FSR__CH2</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x303B</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>FSR__CH3</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x303C</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>FSR__CH4</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x303D</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>FSR__CH5</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x303E</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>Pressure__CH1</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x303F</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>Pressure__CH2</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
<Entry>
|
||||
<Index>#x3040</Index>
|
||||
<SubIndex>1</SubIndex>
|
||||
<BitLen>16</BitLen>
|
||||
<Name>Pressure__CH3</Name>
|
||||
<DataType>INT</DataType>
|
||||
</Entry>
|
||||
</TxPdo>
|
||||
<Eeprom>
|
||||
<ByteSize>2048</ByteSize>
|
||||
<ConfigData>803100CC1000F0FF</ConfigData>
|
||||
</Eeprom>
|
||||
</Device>
|
||||
</Devices>
|
||||
</Descriptions>
|
||||
</EtherCATInfo>
|
|
@ -8,8 +8,7 @@
|
|||
#define ETHERCAT_QSPI_H_
|
||||
|
||||
#include "atmel_start.h"
|
||||
#include <hpl_qspi_config.h>
|
||||
#include <hpl_sercom_config.h>
|
||||
|
||||
|
||||
#define ECAT_SIZE_WR 64 //max fifo size
|
||||
#define ECAT_SIZE_RD ECAT_SIZE_WR
|
||||
|
|
|
@ -0,0 +1,269 @@
|
|||
/*
|
||||
* EtherCAT_SlaveDef.h
|
||||
*
|
||||
* Created: 01/08/2021 12:56:16
|
||||
* Author: Nick-XMG
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ETHERCAT_SLAVEDEF_H_
|
||||
#define ETHERCAT_SLAVEDEF_H_
|
||||
|
||||
#include "Ethercat_QSPI.h"
|
||||
|
||||
//Write To Ecat Total Bytes (XX bytes)
|
||||
/* Motor 1*/
|
||||
static volatile uint8_t *M1_Status = (uint8_t *)&QSPI_tx_buffer[0];
|
||||
static volatile uint8_t *M1_Mode = (((uint8_t *)&QSPI_tx_buffer[0])+1);
|
||||
static volatile int16_t *M1_Joint_rel_position = (((int16_t *)&QSPI_tx_buffer[0])+1);
|
||||
static volatile int16_t *M1_Joint_abs_position = ((int16_t *)&QSPI_tx_buffer[1]);
|
||||
static volatile int16_t *M1_Motor_speed = (((int16_t *)&QSPI_tx_buffer[1])+1);
|
||||
static volatile int16_t *M1_Motor_current_bus = ((int16_t *)&QSPI_tx_buffer[2]);
|
||||
static volatile int16_t *M1_Motor_currentPhA = (((int16_t *)&QSPI_tx_buffer[2])+1);
|
||||
static volatile int16_t *M1_Motor_currentPhB = ((int16_t *)&QSPI_tx_buffer[3]);
|
||||
static volatile int16_t *M1_Motor_currentPhC = (((int16_t *)&QSPI_tx_buffer[3])+1);
|
||||
static volatile int16_t *M1_Motor__hallState = ((int16_t *)&QSPI_tx_buffer[4]);
|
||||
static volatile int16_t *M1_Motor_dutyCycle = (((int16_t *)&QSPI_tx_buffer[4])+1);
|
||||
/* Motor 2*/
|
||||
static volatile uint8_t *M2_Status = (uint8_t *)&QSPI_tx_buffer[5];
|
||||
static volatile uint8_t *M2_Mode = (((uint8_t *)&QSPI_tx_buffer[5])+1);
|
||||
static volatile int16_t *M2_Joint_rel_position = (((int16_t *)&QSPI_tx_buffer[5])+1);
|
||||
static volatile int16_t *M2_Joint_abs_position = ((int16_t *)&QSPI_tx_buffer[6]);
|
||||
static volatile int16_t *M2_Motor_speed = (((int16_t *)&QSPI_tx_buffer[6])+1);
|
||||
static volatile int16_t *M2_Motor_current_bus = ((int16_t *)&QSPI_tx_buffer[7]);
|
||||
static volatile int16_t *M2_Motor_currentPhA = (((int16_t *)&QSPI_tx_buffer[7])+1);
|
||||
static volatile int16_t *M2_Motor_currentPhB = ((int16_t *)&QSPI_tx_buffer[8]);
|
||||
static volatile int16_t *M2_Motor_currentPhC = (((int16_t *)&QSPI_tx_buffer[8])+1);
|
||||
static volatile int16_t *M2_Motor__hallState = ((int16_t *)&QSPI_tx_buffer[9]);
|
||||
static volatile int16_t *M2_Motor_dutyCycle = (((int16_t *)&QSPI_tx_buffer[9])+1);
|
||||
/* EMG */
|
||||
static volatile int16_t *EMG_CH1 = (((int16_t *)&QSPI_tx_buffer[10]));
|
||||
static volatile int16_t *EMG_CH2 = (((int16_t *)&QSPI_tx_buffer[10])+1);
|
||||
static volatile int16_t *EMG_CH3 = (((int16_t *)&QSPI_tx_buffer[11]));
|
||||
static volatile int16_t *EMG_CH4 = (((int16_t *)&QSPI_tx_buffer[11])+1);
|
||||
static volatile int16_t *EMG_CH5 = (((int16_t *)&QSPI_tx_buffer[12]));
|
||||
static volatile int16_t *EMG_CH6 = (((int16_t *)&QSPI_tx_buffer[12])+1);
|
||||
static volatile int16_t *EMG_CH7 = (((int16_t *)&QSPI_tx_buffer[13]));
|
||||
static volatile int16_t *EMG_CH8 = (((int16_t *)&QSPI_tx_buffer[13])+1);
|
||||
/* Motor 3*/
|
||||
static volatile uint8_t *M3_Status = (uint8_t *)&QSPI_tx_buffer[14];
|
||||
static volatile uint8_t *M3_Mode = (((uint8_t *)&QSPI_tx_buffer[14])+1);
|
||||
static volatile int16_t *M3_Joint_rel_position = (((int16_t *)&QSPI_tx_buffer[14])+1);
|
||||
static volatile int16_t *M3_Joint_abs_position = ((int16_t *)&QSPI_tx_buffer[15]);
|
||||
static volatile int16_t *M3_Motor_speed = (((int16_t *)&QSPI_tx_buffer[15])+1);
|
||||
static volatile int16_t *M3_Motor_current_bus = ((int16_t *)&QSPI_tx_buffer[16]);
|
||||
static volatile int16_t *M3_Motor_currentPhA = (((int16_t *)&QSPI_tx_buffer[16])+1);
|
||||
static volatile int16_t *M3_Motor_currentPhB = ((int16_t *)&QSPI_tx_buffer[17]);
|
||||
static volatile int16_t *M3_Motor_currentPhC = (((int16_t *)&QSPI_tx_buffer[17])+1);
|
||||
static volatile int16_t *M3_Motor__hallState = ((int16_t *)&QSPI_tx_buffer[18]);
|
||||
static volatile int16_t *M3_Motor_dutyCycle = (((int16_t *)&QSPI_tx_buffer[18])+1);
|
||||
/* Motor 4*/
|
||||
static volatile uint8_t *M4_Status = (uint8_t *)&QSPI_tx_buffer[19];
|
||||
static volatile uint8_t *M4_Mode = (((uint8_t *)&QSPI_tx_buffer[19])+1);
|
||||
static volatile int16_t *M4_Joint_rel_position = (((int16_t *)&QSPI_tx_buffer[19])+1);
|
||||
static volatile int16_t *M4_Joint_abs_position = ((int16_t *)&QSPI_tx_buffer[20]);
|
||||
static volatile int16_t *M4_Motor_speed = (((int16_t *)&QSPI_tx_buffer[20])+1);
|
||||
static volatile int16_t *M4_Motor_current_bus = ((int16_t *)&QSPI_tx_buffer[21]);
|
||||
static volatile int16_t *M4_Motor_currentPhA = (((int16_t *)&QSPI_tx_buffer[21])+1);
|
||||
static volatile int16_t *M4_Motor_currentPhB = ((int16_t *)&QSPI_tx_buffer[22]);
|
||||
static volatile int16_t *M4_Motor_currentPhC = (((int16_t *)&QSPI_tx_buffer[22])+1);
|
||||
static volatile int16_t *M4_Motor__hallState = ((int16_t *)&QSPI_tx_buffer[23]);
|
||||
static volatile int16_t *M4_Motor_dutyCycle = (((int16_t *)&QSPI_tx_buffer[23])+1);
|
||||
/* IMU */
|
||||
static volatile int16_t *q_x0 = (((int16_t *)&QSPI_tx_buffer[24]));
|
||||
static volatile int16_t *q_y0 = (((int16_t *)&QSPI_tx_buffer[24])+1);
|
||||
static volatile int16_t *q_z0 = (((int16_t *)&QSPI_tx_buffer[25]));
|
||||
static volatile int16_t *q_w0 = (((int16_t *)&QSPI_tx_buffer[25])+1);
|
||||
/* EMG */
|
||||
static volatile int16_t *FSR_CH1 = (((int16_t *)&QSPI_tx_buffer[26]));
|
||||
static volatile int16_t *FSR_CH2 = (((int16_t *)&QSPI_tx_buffer[26])+1);
|
||||
static volatile int16_t *FSR_CH3 = (((int16_t *)&QSPI_tx_buffer[27]));
|
||||
static volatile int16_t *FSR_CH4 = (((int16_t *)&QSPI_tx_buffer[27])+1);
|
||||
static volatile int16_t *FSR_CH5 = (((int16_t *)&QSPI_tx_buffer[28]));
|
||||
static volatile int16_t *Pressure_CH1 = (((int16_t *)&QSPI_tx_buffer[28])+1);
|
||||
static volatile int16_t *Pressure_CH2 = (((int16_t *)&QSPI_tx_buffer[29]));
|
||||
static volatile int16_t *Pressure_CH3 = (((int16_t *)&QSPI_tx_buffer[29])+1);
|
||||
|
||||
//Read From Ecat Total (XX Bytes)
|
||||
//QSPI_rx_buffer
|
||||
/* Motor 1*/
|
||||
static volatile uint8_t *M1_Control_mode = ((uint8_t *)&QSPI_rx_buffer[0]);
|
||||
static volatile uint8_t *M1_Control_set = (((uint8_t *)&QSPI_rx_buffer[0])+1);
|
||||
static volatile int16_t *M1_Desired_pos = ((int16_t *)&QSPI_rx_buffer[0]+1);
|
||||
static volatile int16_t *M1_Desired_speed = ((int16_t *)&QSPI_rx_buffer[1]);
|
||||
static volatile int16_t *M1_Desired_current = ((int16_t *)&QSPI_rx_buffer[1]+1);
|
||||
static volatile int16_t *M1_Max_pos = ((int16_t *)&QSPI_rx_buffer[2]);
|
||||
static volatile int16_t *M1_Max_velocity = ((int16_t *)&QSPI_rx_buffer[2]+1);
|
||||
static volatile int16_t *M1_Max_current = ((int16_t *)&QSPI_rx_buffer[3]);
|
||||
static volatile int16_t *M1_Spare = ((int16_t *)&QSPI_rx_buffer[3]+1);
|
||||
///* Motor 2*/
|
||||
static volatile uint8_t *M2_Control_mode = ((uint8_t *)&QSPI_rx_buffer[4]);
|
||||
static volatile uint8_t *M2_Control_set = (((uint8_t *)&QSPI_rx_buffer[4])+1);
|
||||
static volatile int16_t *M2_Desired_pos = ((int16_t *)&QSPI_rx_buffer[4]+1);
|
||||
static volatile int16_t *M2_Desired_speed = ((int16_t *)&QSPI_rx_buffer[5]);
|
||||
static volatile int16_t *M2_Desired_current = ((int16_t *)&QSPI_rx_buffer[5]+1);
|
||||
static volatile int16_t *M2_Max_pos = ((int16_t *)&QSPI_rx_buffer[6]);
|
||||
static volatile int16_t *M2_Max_velocity = ((int16_t *)&QSPI_rx_buffer[6]+1);
|
||||
static volatile int16_t *M2_Max_current = ((int16_t *)&QSPI_rx_buffer[7]);
|
||||
static volatile int16_t *M2_Spare = ((int16_t *)&QSPI_rx_buffer[7]+1);
|
||||
///* Motor 3*/
|
||||
static volatile uint8_t *M3_Control_mode = ((uint8_t *)&QSPI_rx_buffer[8]);
|
||||
static volatile uint8_t *M3_Control_set = (((uint8_t *)&QSPI_rx_buffer[8])+1);
|
||||
static volatile int16_t *M3_Desired_pos = ((int16_t *)&QSPI_rx_buffer[8]+1);
|
||||
static volatile int16_t *M3_Desired_speed = ((int16_t *)&QSPI_rx_buffer[9]);
|
||||
static volatile int16_t *M3_Desired_current = ((int16_t *)&QSPI_rx_buffer[9]+1);
|
||||
static volatile int16_t *M3_Max_pos = ((int16_t *)&QSPI_rx_buffer[10]);
|
||||
static volatile int16_t *M3_Max_velocity = ((int16_t *)&QSPI_rx_buffer[10]+1);
|
||||
static volatile int16_t *M3_Max_current = ((int16_t *)&QSPI_rx_buffer[11]);
|
||||
static volatile int16_t *M3_Spare = ((int16_t *)&QSPI_rx_buffer[11]+1);
|
||||
///* Motor 4*/
|
||||
static volatile uint8_t *M4_Control_mode = ((uint8_t *)&QSPI_rx_buffer[12]);
|
||||
static volatile uint8_t *M4_Control_set = (((uint8_t *)&QSPI_rx_buffer[12])+1);
|
||||
static volatile int16_t *M4_Desired_pos = ((int16_t *)&QSPI_rx_buffer[12]+1);
|
||||
static volatile int16_t *M4_Desired_speed = ((int16_t *)&QSPI_rx_buffer[13]);
|
||||
static volatile int16_t *M4_Desired_current = ((int16_t *)&QSPI_rx_buffer[13]+1);
|
||||
static volatile int16_t *M4_Max_pos = ((int16_t *)&QSPI_rx_buffer[14]);
|
||||
static volatile int16_t *M4_Max_velocity = ((int16_t *)&QSPI_rx_buffer[14]+1);
|
||||
static volatile int16_t *M4_Max_current = ((int16_t *)&QSPI_rx_buffer[15]);
|
||||
static volatile int16_t *M4_Spare = ((int16_t *)&QSPI_rx_buffer[15]+1);
|
||||
|
||||
//void update_telemetry(void)
|
||||
//{
|
||||
//inline int16_t convert_to_mA(volatile float32_t current_PU)
|
||||
//{
|
||||
//return (int16_t)(current_PU*1000.0f);
|
||||
//}
|
||||
//
|
||||
//*state = applicationStatus.currentstate;
|
||||
//*status = applicationStatus.fault;
|
||||
//*motor_rel_position = Motor1.motor_status.Num_Steps;
|
||||
//*motor_abs_position = 0;
|
||||
//*motor_dutyCycle = Motor1.motor_status.duty_cycle;
|
||||
//*motor_speed = (int16_t)Motor1.motor_status.calc_rpm;
|
||||
//*motor_torque = 0;
|
||||
//*motor_currentPHA = convert_to_mA(Motor1.Iphase_pu.A);
|
||||
//*motor_currentPHB = convert_to_mA(Motor1.Iphase_pu.B);
|
||||
//*motor_currentPHC = convert_to_mA(Motor1.Iphase_pu.C);
|
||||
//*motor_currentBUS = convert_to_mA(Motor1.Iphase_pu.Bus);
|
||||
//*hall_state = Motor1.motor_status.currentHallPattern;
|
||||
//*Spare_byte1 = Motor1.motor_setpoints.directionOffset;
|
||||
//*Spare_1 = Motor1.motor_status.actualDirection;
|
||||
////*Spare_2 = 0;
|
||||
//}
|
||||
//
|
||||
void update_setpoints(void)
|
||||
{
|
||||
volatile uint8_t a = *M1_Control_mode;
|
||||
volatile uint8_t b = *M1_Control_set;
|
||||
volatile int16_t c = *M1_Desired_pos;
|
||||
volatile int16_t d = *M1_Desired_speed;
|
||||
volatile int16_t e = *M1_Desired_current;
|
||||
volatile int16_t f = *M1_Max_pos;
|
||||
volatile int16_t g = *M1_Max_velocity;
|
||||
volatile int16_t h = *M1_Max_current;
|
||||
volatile int16_t i = *M1_Spare;
|
||||
//inline float32_t convert_int_to_PU(volatile int16_t input)
|
||||
//{
|
||||
//return ((float32_t)(input/1000.0f));
|
||||
//}
|
||||
////Motor1.des_mode = 0;
|
||||
////Motor1.set = 0;
|
||||
//Motor1.motor_setpoints.desired_position = *desired_position;
|
||||
//Motor1.motor_setpoints.desired_speed = *desired_speed;
|
||||
////Motor1.desired_speed = 1500;
|
||||
//Motor1.motor_setpoints.desired_torque = convert_int_to_PU(*desired_torque);
|
||||
////Motor1.controllerParam.I_kp = 0;
|
||||
////Motor1.controllerParam.I_ki = 0;
|
||||
////Motor1.controllerParam.V_kp = 0;
|
||||
////Motor1.controllerParam.V_kd = 0;
|
||||
////Motor1.controllerParam.V_kd = 0;
|
||||
////Motor1.controllerParam.P_kp = 0;
|
||||
////Motor1.controllerParam.P_ki = 0;
|
||||
////Motor1.reductionRatio = 0;
|
||||
//Motor1.motor_setpoints.max_velocity = *max_velocity;
|
||||
//Motor1.motor_setpoints.max_current = convert_int_to_PU(*max_current);
|
||||
//Motor1.motor_setpoints.max_torque = convert_int_to_PU(*max_torque);
|
||||
////Motor1.Spare1 = 0;
|
||||
////Motor1.Spare2 = 0;
|
||||
////Motor1.Spare3 = 0;
|
||||
////Motor1.Spare4 = 0;
|
||||
}
|
||||
|
||||
|
||||
static inline void comms_check(void)
|
||||
{
|
||||
/* Motor 1*/
|
||||
*M1_Status = 1;
|
||||
*M1_Mode = 2;
|
||||
*M1_Joint_rel_position = -3;
|
||||
*M1_Joint_abs_position = 4;
|
||||
*M1_Motor_speed = -5;
|
||||
*M1_Motor_current_bus = 6;
|
||||
*M1_Motor_currentPhA = -7;
|
||||
*M1_Motor_currentPhB = 8;
|
||||
*M1_Motor_currentPhC = -9;
|
||||
*M1_Motor__hallState = 10;
|
||||
*M1_Motor_dutyCycle = -11;
|
||||
/* Motor 2*/
|
||||
*M2_Status = 12;
|
||||
*M2_Mode = 13;
|
||||
*M2_Joint_rel_position = 14;
|
||||
*M2_Joint_abs_position = -15;
|
||||
*M2_Motor_speed = 16;
|
||||
*M2_Motor_current_bus = -17;
|
||||
*M2_Motor_currentPhA = 18;
|
||||
*M2_Motor_currentPhB = -19;
|
||||
*M2_Motor_currentPhC = 20;
|
||||
*M2_Motor__hallState = -21;
|
||||
*M3_Motor_dutyCycle = 22;
|
||||
/* EMG */
|
||||
*EMG_CH1 = -23;
|
||||
*EMG_CH2 = 24;
|
||||
*EMG_CH3 = -25;
|
||||
*EMG_CH4 = 26;
|
||||
*EMG_CH5 = -27;
|
||||
*EMG_CH6 = 28;
|
||||
*EMG_CH7 = -29;
|
||||
*EMG_CH8 = 30;
|
||||
|
||||
/* Motor 3*/
|
||||
*M3_Status = 1;
|
||||
*M3_Mode = 2;
|
||||
*M3_Joint_rel_position = -3;
|
||||
*M3_Joint_abs_position = 4;
|
||||
*M3_Motor_speed = -5;
|
||||
*M3_Motor_current_bus = 6;
|
||||
*M3_Motor_currentPhA = -7;
|
||||
*M3_Motor_currentPhB = 8;
|
||||
*M3_Motor_currentPhC = -9;
|
||||
*M3_Motor__hallState = 10;
|
||||
*M3_Motor_dutyCycle = -11;
|
||||
/* Motor 4*/
|
||||
*M4_Status = 12;
|
||||
*M4_Mode = 13;
|
||||
*M4_Joint_rel_position = 14;
|
||||
*M4_Joint_abs_position = -15;
|
||||
*M4_Motor_speed = 16;
|
||||
*M4_Motor_current_bus = -17;
|
||||
*M4_Motor_currentPhA = 18;
|
||||
*M4_Motor_currentPhB = -19;
|
||||
*M4_Motor_currentPhC = 20;
|
||||
*M4_Motor__hallState = -21;
|
||||
*M4_Motor_dutyCycle = 22;
|
||||
/* IMU */
|
||||
*q_x0 = 23;
|
||||
*q_y0 = -24;
|
||||
*q_z0 = 25;
|
||||
*q_w0 = -26;
|
||||
/* EMG */
|
||||
*FSR_CH1 = 27;
|
||||
*FSR_CH2 = -28;
|
||||
*FSR_CH3 = 29;
|
||||
*FSR_CH4 = -30;
|
||||
*FSR_CH5 = 31;
|
||||
*Pressure_CH1 = -32;
|
||||
*Pressure_CH2 = 33;
|
||||
*Pressure_CH3 = -34;
|
||||
}
|
||||
|
||||
#endif /* ETHERCAT_SLAVEDEF_H_ */
|
|
@ -6,6 +6,8 @@
|
|||
*/
|
||||
|
||||
#include "Ethercat_QSPI.h"
|
||||
#include <hpl_qspi_config.h>
|
||||
#include <hpl_sercom_config.h>
|
||||
|
||||
#define SQI_READ (0x0B<<16)
#define SQI_WRITE (0x02<<16)
#define SQI_INC (0x40<<8)
#define SQI_DEC (0x80<<8)
|
||||
#define ECAT_PRAM_RD_DATA 0x0000
#define ECAT_PRAM_WR_DATA 0x0020
#define HW_CFG 0x0074
#define BYTE_TEST 0x0064
#define ECAT_PRAM_RD_ADDR_LEN 0x0308
#define ECAT_PRAM_RD_CMD 0x030C
#define ECAT_PRAM_WR_ADDR_LEN 0x0310
#define ECAT_PRAM_WR_CMD 0x0314
#define LAN9252_RDY (1<<27)
#define PDRAM_RD_ADDRESS 0x1100
#define PDRAM_RD_LENGTH ECAT_SIZE_RD //do the math later to automatize. fixed to 64 for now.
#define PDRAM_WR_ADDRESS 0x1800
#define PDRAM_WR_LENGTH ECAT_SIZE_WR
#define PDRAM_LENGTH_MAX 64
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* EtherCAT_QSPI.h
|
||||
*
|
||||
* Created: 31/07/2021 17:51:24
|
||||
* Author: Nick-XMG
|
||||
*/
|
||||
#ifndef ETHERCAT_QSPI_H_
|
||||
#define ETHERCAT_QSPI_H_
|
||||
|
||||
#include "atmel_start.h"
|
||||
|
||||
|
||||
#define ECAT_SIZE_WR 64 //max fifo size
|
||||
#define ECAT_SIZE_RD ECAT_SIZE_WR
|
||||
#define ECAT_SIZE_WR_REG ECAT_SIZE_WR/4
|
||||
#define ECAT_SIZE_RD_REG ECAT_SIZE_WR/4
|
||||
|
||||
#define buffer_size 3*ECAT_SIZE_WR_REG //changed to double
|
||||
#define motor_buffer_size buffer_size/3
|
||||
|
||||
|
||||
extern enum ecat_states {abort_fifo,dlt_rdram,cf_dlt_rdram,write_fifo,config_fifo,read_fifo,wait,wait2,en_SQI,temp,rd_rdy};
|
||||
extern volatile enum ecat_states ecat_state;
|
||||
extern volatile enum ecat_states next_ecat_state;
|
||||
|
||||
volatile uint32_t QSPI_tx_buffer[buffer_size];
|
||||
volatile uint32_t QSPI_rx_buffer[buffer_size];
|
||||
|
||||
//static uint32_t QSPI_tx_buffer[buffer_size] = {47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,
|
||||
//31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,
|
||||
//15,14,13,12,11,10, 9,8,7,6,5,4,3,2,1,0};
|
||||
//static uint32_t QSPI_rx_buffer[buffer_size] = {0};
|
||||
extern volatile bool run_ECAT;
|
||||
void config_qspi(void);
|
||||
|
||||
|
||||
|
||||
#endif /* ETHERCAT_QSPI_H_ */
|
|
@ -30,15 +30,15 @@
|
|||
<EraseKey />
|
||||
<AsfFrameworkConfig>
|
||||
<framework-data xmlns="">
|
||||
<options />
|
||||
<configurations />
|
||||
<files />
|
||||
<documentation help="" />
|
||||
<offline-documentation help="" />
|
||||
<dependencies>
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.50.0" />
|
||||
</dependencies>
|
||||
</framework-data>
|
||||
<options />
|
||||
<configurations />
|
||||
<files />
|
||||
<documentation help="" />
|
||||
<offline-documentation help="" />
|
||||
<dependencies>
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.50.0" />
|
||||
</dependencies>
|
||||
</framework-data>
|
||||
</AsfFrameworkConfig>
|
||||
<Compiler>gcc</Compiler>
|
||||
<atStartFilePath>.atmelstart\atmel_start_config.atstart</atStartFilePath>
|
||||
|
@ -576,6 +576,9 @@
|
|||
<Compile Include="Ethercat_QSPI.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Ethercat_SlaveDef.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="examples\driver_examples.c">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#include <atmel_start.h>
|
||||
#include "bldc.h"
|
||||
#include "EtherCAT_QSPI.h"
|
||||
#include "EtherCAT_SlaveDef.h"
|
||||
|
||||
/**
|
||||
* Example of using TIMER_0.
|
||||
*/
|
||||
static void onems_tick(const struct timer_task *const timer_task)
|
||||
static void One_ms_cycle_callback(const struct timer_task *const timer_task)
|
||||
{
|
||||
if ((ecat_state == wait2)|(ecat_state == wait)) ecat_state= write_fifo;
|
||||
|
||||
|
@ -15,10 +16,10 @@ static void onems_tick(const struct timer_task *const timer_task)
|
|||
|
||||
static struct timer_task Onems_task;
|
||||
|
||||
void onemstimer_init(void)
|
||||
void One_ms_timer_init(void)
|
||||
{
|
||||
Onems_task.interval = 1;
|
||||
Onems_task.cb = onems_tick;
|
||||
Onems_task.cb = One_ms_cycle_callback;
|
||||
Onems_task.mode = TIMER_TASK_REPEAT;
|
||||
timer_add_task(&TIMER_0, &Onems_task);
|
||||
timer_start(&TIMER_0);
|
||||
|
@ -32,16 +33,17 @@ int main(void)
|
|||
atmel_start_init();
|
||||
config_qspi();
|
||||
ECAT_STATE_MACHINE();
|
||||
onemstimer_init();
|
||||
One_ms_timer_init();
|
||||
|
||||
|
||||
/* Replace with your application code */
|
||||
while (1) {
|
||||
//delay_ms(100);
|
||||
//m1_hall = readM1Hall();
|
||||
//m2_hall = readM2Hall();
|
||||
*M1_Motor__hallState = readM1Hall();
|
||||
*M2_Motor__hallState = readM2Hall();
|
||||
//x += 1;
|
||||
QSPI_tx_buffer[0] += 1;
|
||||
//comms_check();
|
||||
//update_setpoints();
|
||||
if (run_ECAT) ECAT_STATE_MACHINE();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue