9_PWM

                            PWM Expriment:

  Default:


   Carrier Waveform :  Triangular wave
   Carrier frequency : 1000HZ;
   Carrier Peak Value : ±1V
   Modulating Waveform :  Sine Wave
   Modulating Frequency : 200rad/s;
   Modulating Peak Value : 0.8V;

  We've already know that the PWM output is all unrectified Pulse Series. The output Frequency is identical as the Modulating Waveform does thus which is because PWM mostly used in the invertor. As for the carrier frequency, it determines the output pulse frequency, to say more specificly, is to determine the Period that matters the Inductor & Capacitor. So the output waveform fluctuation Value is about to change.
  And we can see clearly via next series of the expriment:

First Expriment ( Default Value ):

  According to the theory of the PWM, the two pulses are inverted simultanously while the Carrier & the Modulating Waveform intersect, and we can see this through the Scope.

Second Expriment ( Modulating Frequency 100rad/s; ) :

  The output Pulse' frequency changed while we changed the Modulating frequency, and because of the unchanged Carrier frequency, the output Pulse inverted less frequently. So this may creating problem if we lower the Modulating Frequency that the pulse gets so less that carry too much harmonics which may find difficult to filt.

Third Expriment ( Carrier frequency : 500HZ )

  Comparing with the defaut value, if we lower the Carrier frequency, the pulse gets inverted slower just like what we've mentioned above. So it can be important to choose the preferable Carrier frequency for which can reduce the harmonics in the output and reduce both the Inductor and Capacitor value since the interchange between the input and output is lower!

1_Layout:



2_SinFrenquency=200rad_Triangle_1000Hz:



3_SinFrenquency=100rad_Triangle_1000Hz:



4_SinFrenquency=200rad_Triangle_500Hz:





要提高电机的转速,可以通过调整PWM(脉冲宽度调制)的频率或占空比来实现。以下是具体的方法和注意事项: ### 1. **调整PWM频率** - **当前参数分析**: - `TIM9_PWM_Init(2000-1, 168-1)` 中的 `2000-1` 表示自动重装载值(ARR),`168-1` 表示预分频值(PSC)。 - PWM频率计算公式: \[ f_{PWM} = \frac{f_{TIM\_CLK}}{(PSC + 1) \times (ARR + 1)} \] 其中,\( f_{TIM\_CLK} \) 是定时器的时钟频率(通常为系统时钟,如84 MHz或168 MHz)。 - 假设 \( f_{TIM\_CLK} = 168 \text{ MHz} \),当前PWM频率为: \[ f_{PWM} = \frac{168 \text{ MHz}}{168 \times 2000} = 500 \text{ Hz} \] - **提高频率的方法**: - **减小ARR值**:降低 `2000-1`(如改为 `1000-1`),频率会提高到1 kHz。 - **调整PSC值**:如果时钟允许,可以减小 `168-1`(如改为 `84-1`),但需确保定时器时钟不超过其最大频率(通常为几百kHz到MHz)。 ### 2. **调整占空比** - 占空比决定电机的有效电压,从而影响转速。占空比越高,转速越快(但需在电机和驱动器的承受范围内)。 - 在代码中,占空比通常通过设置捕获比较寄存器(CCR)实现。例如: ```c TIM9->CCR1 = duty_cycle_value; // 设置占空比 ``` - **提高占空比**:增大 `CCR` 的值(最大为ARR值)。 ### 3. **硬件限制** - **电机额定电压**:确保PWM调整后的有效电压不超过电机额定值。 - **驱动器性能**:检查电机驱动器(如H桥)是否支持更高的PWM频率。 - **定时器最大频率**:避免将PWM频率设置过高,否则可能导致电机响应不足或定时器无法正常工作。 ### 4. **代码修改示例** - 提高PWM频率(如改为1 kHz): ```c TIM9_PWM_Init(1000-1, 168-1); // 频率提高到1 kHz ``` - 提高占空比(如设为75%): ```c TIM9->CCR1 = 750; // ARR=1000时,CCR=750表示75%占空比 ``` ### 5. **注意事项** - **频率与占空比的权衡**: - 过高频率可能导致电机发热或效率下降。 - 过低频率可能引起振动或噪声。 - **实时性**:如果通过动态调整占空比控制转速,需确保代码能及时更新CCR值(如在定时器中断或主循环中)。 ### 6. **调试建议** - 使用示波器或逻辑分析仪观察PWM信号,确认频率和占空比是否符合预期。 - 逐步调整参数,避免一次性修改过大导致电机失控。 ### 总结 - **提高转速的核心方法**: 1. **提高PWM频率**(通过减小ARR或PSC)。 2. **增大占空比**(通过调整CCR值)。 - **需结合硬件规格**(电机、驱动器、定时器能力)选择合适参数。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值