got some comms working, still stops working when motor runs

This commit is contained in:
Nicolas Trimborn 2021-08-19 13:45:50 +02:00
parent 412654754c
commit 5d712c8003
8 changed files with 935 additions and 25 deletions

View File

@ -0,0 +1,895 @@
<?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="#x00000006">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>16</BitLen>
<Name>SPARE__1_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3114</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__2_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3115</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__3_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3116</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__4_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3117</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__5_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3118</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__6_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3119</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__7_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x311A</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__8_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x311B</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__9_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x311C</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__10_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x311D</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__11_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x311E</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__12_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x311F</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__13_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3120</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__14_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3121</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__15_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3122</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__16_RX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3123</Index>
<SubIndex>1</SubIndex>
<BitLen>8</BitLen>
<Name>M3__control_mode</Name>
<DataType>BYTE</DataType>
</Entry>
<Entry>
<Index>#x3124</Index>
<SubIndex>1</SubIndex>
<BitLen>8</BitLen>
<Name>M3__control_set</Name>
<DataType>BYTE</DataType>
</Entry>
<Entry>
<Index>#x3125</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__desired_position</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3126</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__desired_speed</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3127</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__desired__current</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3128</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Max_Pos</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3129</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Max_velocity</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x312A</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Max_current</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x312B</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Spare</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x312C</Index>
<SubIndex>1</SubIndex>
<BitLen>8</BitLen>
<Name>M4__control_mode</Name>
<DataType>BYTE</DataType>
</Entry>
<Entry>
<Index>#x312D</Index>
<SubIndex>1</SubIndex>
<BitLen>8</BitLen>
<Name>M4__control_set</Name>
<DataType>BYTE</DataType>
</Entry>
<Entry>
<Index>#x312E</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__desired_position</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x312F</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__desired_speed</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3130</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__desired__current</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3131</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Max_Pos</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3132</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Max_velocity</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3133</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Max_current</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3134</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>16</BitLen>
<Name>SPARE__1_TX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3020</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__2_TX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3021</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__3_TX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3022</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>SPARE__4_TX</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3023</Index>
<SubIndex>1</SubIndex>
<BitLen>8</BitLen>
<Name>M3__status</Name>
<DataType>BYTE</DataType>
</Entry>
<Entry>
<Index>#x3024</Index>
<SubIndex>1</SubIndex>
<BitLen>8</BitLen>
<Name>M3__mode</Name>
<DataType>BYTE</DataType>
</Entry>
<Entry>
<Index>#x3025</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Joint__rel_position</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3026</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Joint_abs_position</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3027</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Motor_speed</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3028</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Motor_current_bus</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3029</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Motor_currentPhA</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x302A</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Motor_currentPhB</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x302B</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Motor_currentPhC</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x302C</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Motor_hallState</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x302D</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M3__Motor_dutyCycle</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x302E</Index>
<SubIndex>1</SubIndex>
<BitLen>8</BitLen>
<Name>M4__status</Name>
<DataType>BYTE</DataType>
</Entry>
<Entry>
<Index>#x302F</Index>
<SubIndex>1</SubIndex>
<BitLen>8</BitLen>
<Name>M4__mode</Name>
<DataType>BYTE</DataType>
</Entry>
<Entry>
<Index>#x3030</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Joint__rel_position</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3031</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Joint_abs_position</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3032</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Motor_speed</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3033</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Motor_current_bus</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3034</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Motor_currentPhA</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3035</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Motor_currentPhB</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3036</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Motor_currentPhC</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3037</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Motor_hallState</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3038</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>M4__Motor_dutyCycle</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3039</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>IMU__q_x0</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x303A</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>IMU__q_y0</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x303B</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>IMU__q_z0</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x303C</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>IMU__q_w0</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x303D</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>FSR__CH1</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x303E</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>FSR__CH2</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x303F</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>FSR__CH3</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3040</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>FSR__CH4</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3041</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>FSR__CH5</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3042</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>Pressure__CH1</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3043</Index>
<SubIndex>1</SubIndex>
<BitLen>16</BitLen>
<Name>Pressure__CH2</Name>
<DataType>INT</DataType>
</Entry>
<Entry>
<Index>#x3044</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>

View File

@ -208,6 +208,21 @@ static void update_setpoints(void)
Motor2.motor_setpoints.max_torque = *M2_Max_current;
Motor2.motor_setpoints.max_velocity = *M2_Max_velocity;
//*M3_Desired_pos = 1;
//*M3_Desired_speed = 2;
//*M3_Desired_current = 3;
//*M3_Max_current = 4;
//*M3_Max_current = 5;
//*M3_Max_velocity = 6;
//
//*M4_Desired_pos = 7;
//*M4_Desired_speed = 8;
//*M4_Desired_current = 9;
//*M4_Max_current = 10;
//*M4_Max_current = 11;
//*M4_Max_velocity = 12;
//volatile uint8_t a = *M1_Control_mode;
//volatile uint8_t b = *M1_Control_set;
//volatile int16_t c = *M1_Desired_pos;

View File

@ -208,6 +208,21 @@ static void update_setpoints(void)
Motor2.motor_setpoints.max_torque = *M2_Max_current;
Motor2.motor_setpoints.max_velocity = *M2_Max_velocity;
//*M3_Desired_pos = 1;
//*M3_Desired_speed = 2;
//*M3_Desired_current = 3;
//*M3_Max_current = 4;
//*M3_Max_current = 5;
//*M3_Max_velocity = 6;
//
//*M4_Desired_pos = 7;
//*M4_Desired_speed = 8;
//*M4_Desired_current = 9;
//*M4_Max_current = 10;
//*M4_Max_current = 11;
//*M4_Max_velocity = 12;
//volatile uint8_t a = *M1_Control_mode;
//volatile uint8_t b = *M1_Control_set;
//volatile int16_t c = *M1_Desired_pos;

View File

@ -39,7 +39,7 @@ void motor_StateMachine(BLDCMotor_t* const motor)
break;
case MOTOR_OPEN_LOOP_STATE:
BLDC_runOpenLoop(motor, *M1_Desired_dc);
//calculate_motor_speed(motor);
calculate_motor_speed(motor);
motor->motor_state.previousstate = motor->motor_state.currentstate;
break;
case MOTOR_V_CTRL_STATE:

View File

@ -151,22 +151,6 @@ extern DmacDescriptor _descriptor_section[DMAC_CH_NUM];
extern DmacDescriptor _write_back_section[DMAC_CH_NUM];
struct SPI_slaveboard {
struct spi_m_dma_descriptor *SPI_Mn;
uint8_t state;
uint32_t SS_pin;
uint32_t *tx_buffer;
uint32_t *rx_buffer;
};
struct SPI_slaveboard Slave_1 = {
.SPI_Mn = &SPI_1_MSIF,
.state = 0,
.SS_pin = SPI1_CS,
.tx_buffer = &QSPI_tx_buffer[16],
.rx_buffer = &QSPI_rx_buffer[16],
};
#define DMAC_CHANNEL_CONF_SERCOM_1_RECEIVE 0u
#define DMAC_CHANNEL_CONF_SERCOM_1_TRANSMIT 1U
@ -184,10 +168,10 @@ void init_spi_master_dma_descriptors()
{
_dma_set_source_address(DMAC_CHANNEL_CONF_SERCOM_1_RECEIVE,
(uint32_t *)&(((SercomSpi *)(SPI_1_MSIF.dev.prvt))->DATA.reg));
_dma_set_destination_address(DMAC_CHANNEL_CONF_SERCOM_1_RECEIVE, &Slave_1.rx_buffer[0]);
_dma_set_destination_address(DMAC_CHANNEL_CONF_SERCOM_1_RECEIVE, &QSPI_tx_buffer[16]);
_dma_set_data_amount(DMAC_CHANNEL_CONF_SERCOM_1_RECEIVE, MASTER_BUFFER_SIZE);
_dma_set_source_address(DMAC_CHANNEL_CONF_SERCOM_1_TRANSMIT, &Slave_1.tx_buffer[0]);
_dma_set_source_address(DMAC_CHANNEL_CONF_SERCOM_1_TRANSMIT, &QSPI_rx_buffer[16]);
_dma_set_destination_address(DMAC_CHANNEL_CONF_SERCOM_1_TRANSMIT,
(uint32_t *)&(((SercomSpi *)(SPI_1_MSIF.dev.prvt))->DATA.reg));
_dma_set_data_amount(DMAC_CHANNEL_CONF_SERCOM_1_TRANSMIT, MASTER_BUFFER_SIZE);

View File

@ -182,8 +182,6 @@ int main(void)
update_telemetry();
update_setpoints();
PORT->Group[1].OUTCLR.reg = (1<<GPIO_PIN(SPI1_CS));
//PORT->Group[1].OUTCLR.reg = (1<<SPI1_CS);
//gpio_set_pin_level(SPI1_CS, false);
_dma_enable_transaction(DMAC_CHANNEL_CONF_SERCOM_1_RECEIVE, false);
_dma_enable_transaction(DMAC_CHANNEL_CONF_SERCOM_1_TRANSMIT, false);
//spi_m_dma_transfer(&SPI_1_MSIF, (uint8_t*)Slave_1.tx_buffer, (uint8_t*)Slave_1.rx_buffer, MASTER_BUFFER_SIZE);

View File

@ -158,7 +158,7 @@ void APPLICATION_StateMachine(void)
case MOTORS_ON:
applicationStatus.previousstate = applicationStatus.currentstate;
//applicationStatus.currentstate ;
comms_check();
//comms_check();
motor_StateMachine(&Motor1);
motor_StateMachine(&Motor2);
break;
@ -213,15 +213,18 @@ int main(void)
while (1) {
//if (Motor1.timerflags.adc_readings_ready_tic) {process_currents();}
if (Motor1.timerflags.current_loop_tic) {
APPLICATION_StateMachine();
exec_commutation(&Motor1);
exec_commutation(&Motor2);
//APPLICATION_StateMachine();
//exec_commutation(&Motor1);
//exec_commutation(&Motor2);
}
if (Motor1.timerflags.motor_telemetry_flag) {
Motor1.timerflags.motor_telemetry_flag = false;
update_telemetry();
update_setpoints();
APPLICATION_StateMachine();
exec_commutation(&Motor1);
exec_commutation(&Motor2);
}
//if (run_ECAT) {ECAT_STATE_MACHINE();}