完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我正在用F28027的开发板制作 闭环控制回路。我用 DPL的 2p2z, ADC, Epwm,来进行闭环控制。
一切链接的非常顺利,也可以正常的闭环控制,2p2z非常精确的控制pid。 但是,如果我不能增加任意一条 变量声明,例如 long test;在 [ProjectName]-main.c 文件的 main() 文件头处。 如果加入了一条以上的变量,2p2z的输出变得不可控,也就是说,无论反馈端是什么,out都不变。 不知道这是linker的问题还是别的问题?我尝试更改RAM linker, .ebss 的地址,或者 dataRAM的地址或者长度,结果没有任何变化。 下面是我的linker 文件的内容: /*==================================================================================*/ /* User specific Linker command file for running from RAM */ /*==================================================================================*/ /* FILE: F28027_RAM_ProjectName.CMD */ /* */ /* Description: Linker command file for User custom sections targetted to run */ /* from RAM. */ /* */ /* Target: TMS320F28027 */ /* */ /* Version: 1.1 */ /* */ /*----------------------------------------------------------------------------------*/ /* Copyright Texas Instruments ? 2007 */ /*----------------------------------------------------------------------------------*/ /* Revision History: */ /*----------------------------------------------------------------------------------*/ /* Date | Description */ /*----------------------------------------------------------------------------------*/ /* 04/23/09 | Release 1.1 */ /*----------------------------------------------------------------------------------*/ /* Define the memory block start/length for the DSP2802x PAGE 0 will be used to organize program sections PAGE 1 will be used to organize data sections Notes: Memory blocks on F28022 are uniform (ie same physical memory) in both PAGE 0 and PAGE 1. That is the same memory region should not be defined for both PAGE 0 and PAGE 1. Doing so will result in corruption of program and/or data. The L0 memory blocks is mirrored - that is it can be accessed in high memory or low memory. For simplicity only one instance is used in this linker file. Contiguous SARAM memory blocks can be combined if required to create a larger memory block. */ MEMORY [ PAGE 0 : BEGIN : origin = 0x000000, length = 0x000002 BOOT_RSVD : origin = 0x000002, length = 0x00004E RAMM0 : origin = 0x000050, length = 0x0003B0 progRAM : origin = 0x008000, length = 0x000800 IQTABLES : origin = 0x3FE000, length = 0x000B50 /* IQ Math Tables in Boot ROM */ IQTABLES2 : origin = 0x3FEB50, length = 0x00008C /* IQ Math Tables in Boot ROM */ IQTABLES3 : origin = 0x3FEBDC, length = 0x0000AA /* IQ Math Tables in Boot ROM */ RESET : origin = 0x3FFFC0, length = 0x000002 BOOTROM : origin = 0x3FF27C, length = 0x000D44 PAGE 1 : RAMM1 : origin = 0x000480, length = 0x000400 dataRAM : origin = 0x008800, length = 0x000800 ] SECTIONS [ codestart : > BEGIN, PAGE = 0 ramfuncs : > progRAM, PAGE = 0 .text : > progRAM, PAGE = 0 .cinit : > RAMM0, PAGE = 0 .pinit : > RAMM0, PAGE = 0 .switch : > RAMM0, PAGE = 0 .reset : > RESET, PAGE = 0, TYPE = DSECT .stack : > RAMM1, PAGE = 1 .ebss : > dataRAM, PAGE = 1 .econst : > RAMM1, PAGE = 1 .esysmem : > RAMM1, PAGE = 1 IQmath : > progRAM, PAGE = 0 IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD ] SECTIONS [ /************* DPLIB Sections C28x ************************/ /* ADCDRV_1ch section */ ADCDRV_1ch_Section : > dataRAM PAGE = 1 /* ADCDRV_4ch section */ ADCDRV_8ch_Section : > dataRAM PAGE = 1 /* CNTL_2P2Z section */ CNTL_2P2Z_Section : > dataRAM PAGE = 1 CNTL_2P2Z_InternalData : > dataRAM PAGE = 1 CNTL_2P2Z_Coef : > dataRAM PAGE = 1 /* CNTL_3P3Z section */ CNTL_3P3Z_Section : > dataRAM PAGE = 1 CNTL_3P3Z_InternalData : > dataRAM PAGE = 1 CNTL_3P3Z_Coef : > dataRAM PAGE = 1 /*DLOG_4CH section */ DLOG_4CH_Section : > dataRAM PAGE = 1 DLOG_BUFF : > dataRAM PAGE = 1 /*MATH_EMAVG section */ MATH_EMAVG_Section : > dataRAM PAGE = 1 /*PFC_ICMD section*/ PFC_ICMD_Section : > dataRAM PAGE = 1 /*PFC_INVSQR section*/ PFC_INVSQR_Section : > dataRAM PAGE = 1 /* PWMDRV_1ch driver section */ PWMDRV_1ch_Section : > dataRAM PAGE = 1 /* PWMDRV_1chHiRes driver section */ PWMDRV_1chHiRes_Section : > dataRAM PAGE = 1 /* PWMDRV_PFC2PhiL driver section */ PWMDRV_PFC2PhiL_Section : > dataRAM PAGE = 1 /* PWMDRV_PSFB driver section */ PWMDRV_PSFB_Section : > dataRAM PAGE = 1 /* PWMDRV_DualUpDwnCnt driver section */ PWMDRV_DualUpDwnCnt_Section : > dataRAM PAGE = 1 /* PWMDRV_ComplPairDB driver section */ PWMDRV_ComplPairDB_Section : > dataRAM PAGE = 1 /* ZeroNet_Section */ ZeroNet_Section : > dataRAM PAGE = 1 ] /* //=========================================================================== // End of file. //=========================================================================== */ |
|
相关推荐
7 个讨论
|
|
// Connect the CNTL_2P2Z block to the variables CNTL_2P2Z_Fdbk1 = &RltA; //Q24 [0, 1) CNTL_2P2Z_Out1 = &Out; //Q24 [0, 1) CNTL_2P2Z_Ref1 = &Ref; //Q24 [0, 1) CNTL_2P2Z_Coef1 = &CNTL_2P2Z_CoefStruct1.b2; // Coefficients for the Voltage Loop // PID coefficients & Clamping (Q26) Dmax = _IQ24(0.984375); //Q24 Dmin = _IQ24(0.0); //Q24 Pgain = _IQ26(0.001953); //Q26 Igain = _IQ26(0.001250); //Q26 Dgain = _IQ26(0.0); //Q26 // Coefficient init --- Coeeficient values in Q26 // Use IQ Maths to generate floating point values for the CLA CNTL_2P2Z_CoefStruct1.b2 = Dgain; // B2 CNTL_2P2Z_CoefStruct1.b1 = (Igain-Pgain-Dgain-Dgain); // B1 CNTL_2P2Z_CoefStruct1.b0 = (Pgain + Igain + Dgain); // B0 CNTL_2P2Z_CoefStruct1.a2 = 0.0; // A2 = 0 CNTL_2P2Z_CoefStruct1.a1 = _IQ26(1.0); // A1 = 1 CNTL_2P2Z_CoefStruct1.max = Dmax; //Clamp Hi CNTL_2P2Z_CoefStruct1.min = Dmin; //Clamp Min 2p2z的Node链接到了ADC,我用了ADCDRV8ch的,用Epwm1来驱动INT,用2p2z的out来驱动Epwm的Duty口。 |
|
|
|
|
|
jfsuwef 发表于 2018-8-31 18:10 各位大佬,我搞定了,就是memory的问题,是progRAM的大小和dataRAM的大小问题,这个程序,我的progRAM太小,之前总想着扩大dataRAM,因为觉得dataRAM的数据没有变化。可能是数据不够,刚才才明白,是程序不够用了,所以出来的数据不变。 各位大佬如果有建议,也给指导一下。 |
|
|
|
|
|
xianhaizhe 发表于 2018-8-31 18:55 谢谢你的回复,我的问题已经解决了,是linker的内存设置问题。你说的在最小值处加上负数方法可能对稳定性有帮助,还没有尝试,可以去试试。 |
|
|
|
|
|
只有小组成员才能发言,加入小组>>
868 浏览 0 评论
TMS320F28377D:新做了以377d为芯片的板子,上电后芯片复位引脚出现方波请问如何解决?
2054 浏览 0 评论
TPS55340通电后输入端保险丝烧断,芯片输入和GND之间短路
3792 浏览 4 评论
5148 浏览 0 评论
请问如何用DM368对RGB格式的图片数据进行编码生成JPEG格式图片?
1843 浏览 1 评论
CC3100BOOST使用CC3200lunchXL进行烧录
837浏览 2评论
72浏览 2评论
83浏览 2评论
72浏览 2评论
102浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-17 14:39 , Processed in 0.919314 second(s), Total 71, Slave 60 queries .
Powered by 电子发烧友网
© 2015 www.ws-dc.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号