完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在“Drive Mng - Drive Settings”对话框中,有一些非活动(灰显)复选框可启用差异术语。
如何激活这些复选框? #stmcwb-FOC-4.0 以上来自于谷歌翻译 以下为原文 In the dialog ''Drive Mng - Drive Settings'' there are some inactive (grayed out) check boxes to enable differential terms. How can a activate these check boxes? #stmcwb-foc-4.0 |
|
相关推荐
1个回答
|
|
Ciao Christian
事情并不像看起来那么简单。理想的不仅仅是激活WB中的复选框,因为在FW中不能自动启用差分terrm。 我试着更好地解释一下。 启用FW中任何PI的差异项均使用PI的PID代码,并且必须更改实际创建PI的函数的名称。 这是通过MCTasks.c中的MCBoot函数完成的。让我们考虑一下这个函数创建的速度PI: oPIDSpeed [M1] =(CPI)PI_NewObject(&amp; PISpeedParamsM1); 而且,正如您可以在函数名称中读到的那样,它只创建一个PI(而不是PID)。要创建PID,必须使用另一个函数 PID_NewObject(pPIParams_t pPIParam,pPIDParams_t pPIDParam); 你必须改变oPIDSpeed的类型 CPI oPIDSpeed [NBR_OF_MOTORS]; 至 CPID_PI oPIDSpeed [NBR_OF_MOTORS]; 关于PID_NewObject所需的参数结构,您可以照常使用PISpeedParamsM1,但您还需要创建另一个定义差异部分的结构。这在PID_PIRegulatorClass.h中定义为: typedef const struct { int16_t hDefKdGain; / *&LT!;默认Kd增益,用于初始化Kd 获得软件变量* / uint16_t hKdDivisor; / *&LT!; Kd获得除数,与之结合使用 Kd增益允许获得小数值。 如果未定义FULL_MISRA_C_COMPLIANCY 除数是通过实施的 algebrical右移以加速PI 执行。只有在这种情况下这个参数 指定正确的班次数 执行* / uint16_t hKdDivisorPOW2; / *&LT!; Kd获得除数表示为2的幂。 例如。如果增益除数是512的值 必须是9因为2 ^ 9 = 512 * / } PIDParams_t,* pPIDParams_t; 这不是在SystemNDriveParams.h中管理的。所以你需要创建它,例如在#include''SystemNDriveParams.h'之后的MCTasks.c的开头。 PIDParams_t PISpeedParamsM1 = { PID_SPEED_KD_DEFAULT, SP_KDDIV, (uint16_t)SP_KDDIV_LOG2 } 像这样...... 因此,还需要做一些工作来使用差分项。 再见 梁咏琪 以上来自于谷歌翻译 以下为原文 Ciao Christian The thing is not as simple as it might seem. Ideed is not just matter of activate the check boxes in the WB because the differential terrm is not automaticaly enabled in the FW is such way. I try to explain better. Enable the differential term of any PI in the FW means to use the code of PID insted of PI and to do this you have to change the name of the function that actually creates the PI. This is done by the MCBoot function inside the MCTasks.c. Let consider the speed PI that is created by this function: oPIDSpeed[M1] = (CPI)PI_NewObject(&PISpeedParamsM1); And, as you can read in the name of the function, it creates just a PI (not a PID). To create the PID is necessary to use another function that is PID_NewObject (pPIParams_t pPIParam, pPIDParams_t pPIDParam); You have to change the type of oPIDSpeed from CPI oPIDSpeed[NBR_OF_MOTORS]; to CPID_PI oPIDSpeed[NBR_OF_MOTORS]; Regarding the parameter structures required by PID_NewObject you can use the PISpeedParamsM1 as usual but you need to create also another structure that defines the differential part. This is defined in the PID_PIRegulatorClass.h as: typedef const struct { int16_t hDefKdGain; /*!< Default Kd gain, used to initialize Kd gain software variable */ uint16_t hKdDivisor; /*!< Kd gain divisor, used in conjuction with Kd gain allows obtaining fractional values. If FULL_MISRA_C_COMPLIANCY is not defined the divisor is implemented through algebrical right shifts to speed up PI execution. Only in this case this parameter specifies the number of right shifts to be executed */ uint16_t hKdDivisorPOW2; /*!< Kd gain divisor expressed as power of 2. E.g. if gain divisor is 512 the value must be 9 because 2^9 = 512 */ }PIDParams_t, *pPIDParams_t; That is not managed in the SystemNDriveParams.h. So you need to create it somewere, for instance in the begin of MCTasks.c after the #include ''SystemNDriveParams.h'' PIDParams_t PISpeedParamsM1 = { PID_SPEED_KD_DEFAULT, SP_KDDIV, (uint16_t)SP_KDDIV_LOG2 } And someting like this... So there is a little bit of work that is required to do to use also the differential term. Ciao Gigi |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2730 浏览 1 评论
3239 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1808 浏览 1 评论
3647 浏览 6 评论
6035 浏览 21 评论
1337浏览 4评论
197浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
442浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
273浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 22:54 , Processed in 1.875624 second(s), Total 75, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号