leekom 发表于 2024-9-11 16:27

昊芯HXS320F28034数字信号处理器项目中电机相位控制与检测调试

本帖最后由 leekom 于 2024-9-11 16:29 编辑

<div _blank="" tdoc-data-src="{&quot;mainStory&quot;:[{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;昊芯HXS320F28034数字信号处理器DSP,对电机使用&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:0,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:0,&quot;len&quot;:30},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;差&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:30,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:30,&quot;len&quot;:1},&quot;property&quot;:{&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;速&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:31,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:31,&quot;len&quot;:1},&quot;property&quot;:{&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;编码器,也称为增量式编码器,其工作原理是将位移转换成周期性的电信号,再将这个电信号转变成计数脉冲,用脉冲的个数表示位移的大小。&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:32,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:32,&quot;len&quot;:63},&quot;property&quot;:{&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;\r&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:95,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:95,&quot;len&quot;:1},&quot;property&quot;:{&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;isPlaceholder&quot;:true,&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyParagraphProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:95,&quot;len&quot;:1},&quot;property&quot;:{&quot;pStyle&quot;:{&quot;val&quot;:&quot;000001&quot;},&quot;ind&quot;:{&quot;firstLine&quot;:840,&quot;firstLineChars&quot;:400},&quot;numPr&quot;:{}},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;ParagraphProperty&quot;,&quot;builtinStyleName&quot;:&quot;Normal&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;其QEP测速的实现方式如下:&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:96,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:96,&quot;len&quot;:14},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;\r&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:110,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:110,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;isPlaceholder&quot;:true,&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyParagraphProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:110,&quot;len&quot;:1},&quot;property&quot;:{&quot;pStyle&quot;:{&quot;val&quot;:&quot;000001&quot;},&quot;ind&quot;:{&quot;firstLine&quot;:840,&quot;firstLineChars&quot;:400},&quot;numPr&quot;:{}},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;ParagraphProperty&quot;,&quot;builtinStyleName&quot;:&quot;Normal&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;采用GPIO MUX定义引脚:其引脚对应&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:111,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:111,&quot;len&quot;:20},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;在码盘的边缘上开有相等角度的缝隙(分为透明和不透明部分),在开缝码盘两边分别安装光源及光敏元件。当码盘随工作轴一起转动时,每转过一个缝隙就产生一次光线的明暗变化&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:131,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:131,&quot;len&quot;:80},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;ascii&quot;:&quot;Arial&quot;,&quot;hAnsi&quot;:&quot;Arial&quot;,&quot;cs&quot;:&quot;Arial&quot;},&quot;i&quot;:{&quot;val&quot;:false},&quot;iCs&quot;:{&quot;val&quot;:false},&quot;caps&quot;:{&quot;val&quot;:false},&quot;color&quot;:{&quot;val&quot;:&quot;333333&quot;},&quot;spacing&quot;:{&quot;val&quot;:0},&quot;sz&quot;:{&quot;val&quot;:210},&quot;szCs&quot;:{&quot;val&quot;:210},&quot;shd&quot;:{&quot;val&quot;:&quot;STShd_clear&quot;,&quot;color&quot;:&quot;STHexColorAuto_auto&quot;,&quot;fill&quot;:&quot;ffffff&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;,&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:211,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:211,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;,&quot;ascii&quot;:&quot;Arial&quot;,&quot;hAnsi&quot;:&quot;Arial&quot;,&quot;cs&quot;:&quot;Arial&quot;},&quot;i&quot;:{&quot;val&quot;:false},&quot;iCs&quot;:{&quot;val&quot;:false},&quot;caps&quot;:{&quot;val&quot;:false},&quot;color&quot;:{&quot;val&quot;:&quot;333333&quot;},&quot;spacing&quot;:{&quot;val&quot;:0},&quot;sz&quot;:{&quot;val&quot;:210},&quot;szCs&quot;:{&quot;val&quot;:210},&quot;shd&quot;:{&quot;val&quot;:&quot;STShd_clear&quot;,&quot;color&quot;:&quot;STHexColorAuto_auto&quot;,&quot;fill&quot;:&quot;ffffff&quot;},&quot;lang&quot;:{&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;从而&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:212,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:212,&quot;len&quot;:2},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;,&quot;ascii&quot;:&quot;Arial&quot;,&quot;hAnsi&quot;:&quot;Arial&quot;,&quot;cs&quot;:&quot;Arial&quot;},&quot;i&quot;:{&quot;val&quot;:false},&quot;iCs&quot;:{&quot;val&quot;:false},&quot;caps&quot;:{&quot;val&quot;:false},&quot;color&quot;:{&quot;val&quot;:&quot;333333&quot;},&quot;spacing&quot;:{&quot;val&quot;:0},&quot;sz&quot;:{&quot;val&quot;:210},&quot;szCs&quot;:{&quot;val&quot;:210},&quot;shd&quot;:{&quot;val&quot;:&quot;STShd_clear&quot;,&quot;color&quot;:&quot;STHexColorAuto_auto&quot;,&quot;fill&quot;:&quot;ffffff&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;获取差分编码器正交脉冲QEPA与QEPB、索引QEPI信号;&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:214,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:214,&quot;len&quot;:30},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;\r&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:244,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:244,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;isPlaceholder&quot;:true,&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyParagraphProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:244,&quot;len&quot;:1},&quot;property&quot;:{&quot;pStyle&quot;:{&quot;val&quot;:&quot;000001&quot;},&quot;ind&quot;:{&quot;firstLine&quot;:840,&quot;firstLineChars&quot;:400},&quot;numPr&quot;:{}},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;ParagraphProperty&quot;,&quot;builtinStyleName&quot;:&quot;Normal&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;通过QDECCTL选择,上升沿、下降沿或双边沿捕获计数方式,得到时钟信号xCLK,&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:245,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:245,&quot;len&quot;:46},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;变化的信号经过整形放大,可以得到一定幅值和功率的电脉冲输出信号。脉冲数就等于转过的缝隙数。将该脉冲信号送到计数器中去进行计数,从测得的数码数就能知道码盘转过的角度&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:291,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:291,&quot;len&quot;:81},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;ascii&quot;:&quot;Arial&quot;,&quot;hAnsi&quot;:&quot;Arial&quot;,&quot;cs&quot;:&quot;Arial&quot;},&quot;i&quot;:{&quot;val&quot;:false},&quot;iCs&quot;:{&quot;val&quot;:false},&quot;caps&quot;:{&quot;val&quot;:false},&quot;color&quot;:{&quot;val&quot;:&quot;333333&quot;},&quot;spacing&quot;:{&quot;val&quot;:0},&quot;sz&quot;:{&quot;val&quot;:210},&quot;szCs&quot;:{&quot;val&quot;:210},&quot;shd&quot;:{&quot;val&quot;:&quot;STShd_clear&quot;,&quot;color&quot;:&quot;STHexColorAuto_auto&quot;,&quot;fill&quot;:&quot;ffffff&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;;&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:372,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:372,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;\r&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:373,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:373,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;isPlaceholder&quot;:true,&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyParagraphProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:373,&quot;len&quot;:1},&quot;property&quot;:{&quot;pStyle&quot;:{&quot;val&quot;:&quot;000001&quot;},&quot;ind&quot;:{&quot;firstLine&quot;:840,&quot;firstLineChars&quot;:400},&quot;numPr&quot;:{}},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;ParagraphProperty&quot;,&quot;builtinStyleName&quot;:&quot;Normal&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;经解码QDU逻辑处理,得到方向的高低电平信号iDIR;&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:374,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:374,&quot;len&quot;:27},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;\r&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:401,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:401,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;isPlaceholder&quot;:true,&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyParagraphProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:401,&quot;len&quot;:1},&quot;property&quot;:{&quot;pStyle&quot;:{&quot;val&quot;:&quot;000001&quot;},&quot;ind&quot;:{&quot;firstLine&quot;:840,&quot;firstLineChars&quot;:400},&quot;numPr&quot;:{}},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;ParagraphProperty&quot;,&quot;builtinStyleName&quot;:&quot;Normal&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;通过QDECCTL选择引脚模式:正交、方向、增或减计数,读取方向QDIR、时钟QCLK信号;&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:402,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:402,&quot;len&quot;:52},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;\r&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:454,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:454,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;isPlaceholder&quot;:true,&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyParagraphProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:454,&quot;len&quot;:1},&quot;property&quot;:{&quot;pStyle&quot;:{&quot;val&quot;:&quot;000001&quot;},&quot;ind&quot;:{&quot;firstLine&quot;:840,&quot;firstLineChars&quot;:400},&quot;numPr&quot;:{}},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;ParagraphProperty&quot;,&quot;builtinStyleName&quot;:&quot;Normal&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;通过QEPCTL选择,位置计数控制PCCU模式:索引位置事件、最大位置锁存、单位超时锁存;使能QEPCTL,捕获N线光电编码器输出双边沿脉冲,使位置计数器产生计数,从而计算电机转速。&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:455,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:455,&quot;len&quot;:103},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;\r&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:558,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:558,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;hint&quot;:&quot;STHint_eastAsia&quot;},&quot;lang&quot;:{&quot;val&quot;:&quot;en-US&quot;,&quot;eastAsia&quot;:&quot;zh-CN&quot;},&quot;isPlaceholder&quot;:true,&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyParagraphProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:558,&quot;len&quot;:1},&quot;property&quot;:{&quot;pStyle&quot;:{&quot;val&quot;:&quot;000001&quot;},&quot;ind&quot;:{&quot;firstLine&quot;:840,&quot;firstLineChars&quot;:400},&quot;numPr&quot;:{}},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;ParagraphProperty&quot;,&quot;builtinStyleName&quot;:&quot;Normal&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;\u0013&quot;,&quot;range&quot;:{&quot;gcpBegin&quot;:559,&quot;len&quot;:0},&quot;preventTextTrackChanges&quot;:false},&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyRunProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:559,&quot;len&quot;:1},&quot;property&quot;:{&quot;rFonts&quot;:{&quot;ascii&quot;:&quot;宋体&quot;,&quot;hAnsi&quot;:&quot;宋体&quot;,&quot;eastAsia&quot;:&quot;宋体&quot;,&quot;cs&quot;:&quot;宋体&quot;},&quot;sz&quot;:{&quot;val&quot;:240},&quot;szCs&quot;:{&quot;val&quot;:240},&quot;isPlaceholder&quot;:true,&quot;author&quot;:&quot;p.144115233544640245&quot;},&quot;mode&quot;:1,&quot;preventFormatTrackChanges&quot;:false},&quot;propertyType&quot;:&quot;RunProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;ModifyFieldProp&quot;,&quot;param&quot;:{&quot;range&quot;:{&quot;gcpBegin&quot;:559,&quot;len&quot;:1},&quot;property&quot;:{&quot;fldCharType&quot;:&quot;STFldCharType_begin&quot;,&quot;nestingLevel&quot;:1},&quot;mode&quot;:1},&quot;propertyType&quot;:&quot;FieldCharProperty&quot;,&quot;builtinStyleName&quot;:&quot;&quot;},{&quot;operationType&quot;:&quot;InsertText&quot;,&quot;param&quot;:{&quot;text&quot;:&quot;INCLUDEPICTURE \\d \&quot;&lt;a target=">
<div>昊芯HXS320F28034数字信号处理器DSP,对电机使用差分编码器,也称为增量式编码器,其工作原理是将位移转换成周期性的电信号,再将这</div>

<div>个电信号转变成计数脉冲,用脉冲的个数表示位移的大小。</div>

<div>其QEP测速的实现方式如下:<br />
采用GPIO MUX定义引脚:其引脚对应在码盘的边缘上开有相等角度的缝隙(分为透明和不透明部分),在开缝码盘两边分别安装光源及光敏元</div>

<div>件。当码盘随工作轴一起转动时,每转过一个缝隙就产生一次光线的明暗变化,从而获取差分编码器正交脉冲QEPA与QEPB、索引QEPI信号;</div>

<div>通过QDECCTL选择,上升沿、下降沿或双边沿捕获计数方式,得到时钟信号xCLK,变化的信号经过整形放大,可以得到一定幅值和功率的</div>

<div>电脉冲输出信号。脉冲数就等于转过的缝隙数。将该脉冲信号送到计数器中去进行计数,从测得的数码数就能知道码盘转过的角度;</div>

<div>经解码QDU逻辑处理,得到方向的高低电平信号iDIR;<br />
通过QDECCTL选择引脚模式:正交、方向、增或减计数,读取方向QDIR、时钟QCLK信号;<br />
通过QEPCTL选择,位置计数控制PCCU模式:索引位置事件、最大位置锁存、单位超时锁存;使能QEPCTL,捕获N线光电编码器</div>

<div>输出双边沿脉冲,使位置计数器产生计数,从而计算电机转速。</div>

<div></div>

<div>其A\B\C对应差分编码器,通过检测码盘上的缝隙引起的光线明暗变化,将其转换为电脉冲信号,并通过计数器计算脉冲数量来测量位移大小。</div>

<div>同时,通过两套光电转换装置产生的相位差信号来判断旋转方向,常用方法如下:</div>

<div>(1)T法:一个脉冲周期fclk内,捕获脉冲计数,载入16位定时器QCTMR。单位事件发生时,更新载入QCPRDLAT,电机转速n=60*fclk/(4N*QCPRDLAT)。QCTMR上溢时,位置方向QDIR将变化,使捕获单元QEPSTS发生错误标志,故仅适用于低速测量。</div>

<div>(2)M法:规定检测事件Tc内,捕获脉冲计数。单位事件发生时,锁存到32位QPOSILAT和QPOSSLAT,故电机转速n=60*QPOSSLAT/(4N*Tc),适用于高速测量。</div>

<div>由此设计QEP测速实例:EPWM配置1KHz PWM波,模拟1000线编码器旋转,EQEP采用M法与T法测量60rpm与6000rpm下旋转的转速,单位周期为 SysFreq*100,采用上升沿计数,捕获得到脉冲计数,实现转速测量,采用定时器中断实现三种不同功能切换,故硬件连接如下:GPIO0-GPIO20,GPIO1-GPIO21。基于以上分析,在CDK上开发QEP脉冲捕获输出,代码包括:EPWM与EQEP的GPIO引脚配置,EPWM 1KHz两路互差90&deg;的PWM波输出配置,EQEP单位时间锁存计数捕获功能配置,定时器Timer0配置,计数捕获、M法与T法测速程序及其功能切换的定时器中断服务程序,主程序调用执行。</div>

<div>int main(void)</div>

<div>{</div>

<div>/*初始化系统控制*/</div>

<div>InitSysCtrl();</div>

<div>/*初始EPWM GPIO*/</div>

<div>InitEPwm1Gpio();</div>

<div>/*EQEP1引脚配置*/</div>

<div>InitEQep1Gpio();</div>

<div>/*初始化LED配置,用于指示实际转速是否到达给定转速*/</div>

<div>InitLED();</div>

<div>/*关中断*/</div>

<div>InitPieCtrl();</div>

<div>/*清中断*/</div>

<div>IER = 0x0000;</div>

<div>IFR = 0x0000;</div>

<div>/*初始化PIE中断向量表*/</div>

<div>InitPieVectTable();</div>

<div>/*定时器配置*/</div>

<div>Timer0_init();</div>

<div>EALLOW;</div>

<div>/*将timer0_ISR入口地址赋给TINT0,执行M法、T法测速切换中断服务程序*/</div>

<div>PieVectTable.TINT0 = &amp;timer0_ISR;</div>

<div>EDIS;</div>

<div>/*电机转速初始化*/</div>

<div>MotorSpeed_init();</div>

<div>EALLOW;</div>

<div>/*禁用TBCLK同步,允许EPWM初始化配置*/</div>

<div>SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0;</div>

<div>EDIS;</div>

<div>/*配置epwm1,用于模拟编码器旋转*/</div>

<div>EPWM1_Config();</div>

<div>EALLOW;</div>

<div>/*使能TBCLK同步,EPWM配置功能起作用*/</div>

<div>SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1;</div>

<div>EDIS;</div>

<div>/*EQEP脉冲捕获配置*/</div>

<div>EQEP_pulseCap();</div>

<div>/*使能打开相应的CPU IER中断*/</div>

<div>IER |= M_INT1;</div>

<div>/*使能打开相应的PIE IER中断*/</div>

<div>PieCtrlRegs.PIEIER1.bit.INTx7 = 1;</div>

<div>/*使能打开全局中断*/</div>

<div>EINT;</div>

<div>while(1)</div>

<div>{}</div>

<div>return 0;</div>

<div>}</div>

<div>A\B\C三个相位如下图:</div>

<div></div>

<div>CDK上开发QEP测速程序,其编译结果为:</div>

<div></div>

<div>编译通过后,就可以开始调试了,其中M法测速调试结果如下:</div>

<div></div>

<div>T法测速调试结果如下:</div>

<div></div>

<div>所捕获的光电编码器QEP正交脉冲波形为</div>

<div></div>

<div>&nbsp;</div>

<div>&nbsp;</div>
<!--importdoc--></div>

<div>
<div>
<p><!--importdoc--></p>
</div>
</div>

Jacktang 发表于 2024-9-12 07:33

<p>T法和M法主要的区别是什么</p>

leekom 发表于 2024-9-29 14:36

<p>后续更新测量与FPGA监测方法</p>
页: [1]
查看完整版本: 昊芯HXS320F28034数字信号处理器项目中电机相位控制与检测调试