Prev: PSO toolbox for latest Matlab versions
Next: Attempted to access indexEnd(1); index out of bounds because numel(indexEnd)=0.
From: Will Cross on 19 May 2010 13:29 I am trying to use xPC Target as a rapid control prototyping solution for electric motor control. Specifically I am trying to use NI hardware for PWM generation, analog inputs, and reading an incremental encoder. The blocks for the encoder look fine, but I forsee problems with both PWM generation and the analog inputs. First, I need to be able to generate complementary PWM signals (while one signal is high, a corresponding signal needs to be low). I don't see how I can do this using the PWM generation blocks. They only ask for #ticks high and #ticks low. If one signal goes high first, I need its corresponding signal to go low first. Does anyone know how to set this up using the PWM generation blocks? Also, I need to synchronize the PWM signal with the ADC to measure currents in the middle of a PWM event. Does anyone know how to trigger the ADC from the PWM (or at least syncronize them somehow)? Ideally, I'd like to set up the counter module to generate centerline PWM and trigger the ADC (and the base controller task) at the peak of the up-down counter. Are there ways to configure the counter module itself? I don't see any access for this with the xPC target blocks. Thanks, Will |