HI Gabbar,PWM外围设备可以触发ADC每周期一次,或者每周期几次(可以在PWM初始TIG值中设置一个矢量,每个周期具有一个以上的TIG)。用户的责任是确保ADC采样时间和转换与您设置的TRAIs相适应。在某个芯片上可用的后缩放器在每N个PWM周期中对ADC进行一次采样,在块集上没有实现。解决办法是在每个周期进行ADC转换,然后只使用n个采样。注意转换过程完全由外围设备处理,不使用任何CPU负载(不需要中断),因此没有影响。从ADC块允许设置时间步触发。默认情况下,定时器被设置为触发最快的Simulink时间步长。当存在ADC块时,该定时器触发ADC转换,然后转换结束触发时间步长。您可以选择在该ADC块(默认)完成的所有转换结束的时间步长,或者当ADC块被配置为获取多于一个样本(当使用并行采样和保持时,2个或4个样本)时,也可以选择在每个转换之后触发时间步长。ADC COVERSEN可以使用像PWM TIG这样的“自定义”触发器。在任何情况下,当您不使用默认参数时,必须确保系统是一致的:如果Simulink离散时间步长(最快的一个)是25US,并且如果使用PWM来触发ADC,则ADC转换结束时间步长:T。RIG必须每25U进行一次适应SIMULINK模型的时间步长,这些先进的选项允许处理PMSM双分流器(在每个PWM周期中取一个采样)或单个分流器(每个PWM周期内取的两个采样)电机控制算法。
以上来自于百度翻译
以下为原文
Hi Gabbar,
The PWM peripheral can trigger the ADC once per period, or several times per period (you can set a vector in the PWM initial trig value to have more than one trig per period). It is user responsibility to ensure that ADC sample time & conversion cope with the trigs you set.
The postscaler available on some chip to trig the ADC once every N PWM period is not implemented on the blockset. The workaround would be to make the ADC conversion at each period, then use only one sample out of N. Note that that conversion process is entirely handled by peripherals, not using any CPU load (no interrupt required) thus has no impact.
From the ADC block allows to set the time step triggering. By default, a timer is set to trig the fastest Simulink time step. When an ADC block is present, that timer trig the ADC conversion then end of conversion trig the time step. You could select to trig the time step at end of all conversion done by that ADC block (default) or you could also select to trig the time step after each conversion when the ADC block is configured to take more than one sample ( 2 or 4 samples when the parallel sample & hold is used).
ADC conversion could use a “custom” trigger like the PWM trig.
In any case, when you are not using default parameters, you must ensure that the system is coherent: if the Simulink discrete time step (fastest one) is 25us and if you use PWM to trig ADC, then ADC end of conversion trig the time step: the trig must take place every 25us to fit with Simulink model time step period.
These advanced options allows to handle PMSM dual shunt (one sample taken at each PWM period) or single shunt (two sample taken at each PWM period) motor control algorithm for example.
HI Gabbar,PWM外围设备可以触发ADC每周期一次,或者每周期几次(可以在PWM初始TIG值中设置一个矢量,每个周期具有一个以上的TIG)。用户的责任是确保ADC采样时间和转换与您设置的TRAIs相适应。在某个芯片上可用的后缩放器在每N个PWM周期中对ADC进行一次采样,在块集上没有实现。解决办法是在每个周期进行ADC转换,然后只使用n个采样。注意转换过程完全由外围设备处理,不使用任何CPU负载(不需要中断),因此没有影响。从ADC块允许设置时间步触发。默认情况下,定时器被设置为触发最快的Simulink时间步长。当存在ADC块时,该定时器触发ADC转换,然后转换结束触发时间步长。您可以选择在该ADC块(默认)完成的所有转换结束的时间步长,或者当ADC块被配置为获取多于一个样本(当使用并行采样和保持时,2个或4个样本)时,也可以选择在每个转换之后触发时间步长。ADC COVERSEN可以使用像PWM TIG这样的“自定义”触发器。在任何情况下,当您不使用默认参数时,必须确保系统是一致的:如果Simulink离散时间步长(最快的一个)是25US,并且如果使用PWM来触发ADC,则ADC转换结束时间步长:T。RIG必须每25U进行一次适应SIMULINK模型的时间步长,这些先进的选项允许处理PMSM双分流器(在每个PWM周期中取一个采样)或单个分流器(每个PWM周期内取的两个采样)电机控制算法。
以上来自于百度翻译
以下为原文
Hi Gabbar,
The PWM peripheral can trigger the ADC once per period, or several times per period (you can set a vector in the PWM initial trig value to have more than one trig per period). It is user responsibility to ensure that ADC sample time & conversion cope with the trigs you set.
The postscaler available on some chip to trig the ADC once every N PWM period is not implemented on the blockset. The workaround would be to make the ADC conversion at each period, then use only one sample out of N. Note that that conversion process is entirely handled by peripherals, not using any CPU load (no interrupt required) thus has no impact.
From the ADC block allows to set the time step triggering. By default, a timer is set to trig the fastest Simulink time step. When an ADC block is present, that timer trig the ADC conversion then end of conversion trig the time step. You could select to trig the time step at end of all conversion done by that ADC block (default) or you could also select to trig the time step after each conversion when the ADC block is configured to take more than one sample ( 2 or 4 samples when the parallel sample & hold is used).
ADC conversion could use a “custom” trigger like the PWM trig.
In any case, when you are not using default parameters, you must ensure that the system is coherent: if the Simulink discrete time step (fastest one) is 25us and if you use PWM to trig ADC, then ADC end of conversion trig the time step: the trig must take place every 25us to fit with Simulink model time step period.
These advanced options allows to handle PMSM dual shunt (one sample taken at each PWM period) or single shunt (two sample taken at each PWM period) motor control algorithm for example.
举报