2011/3/16 Klemen Dovrtel <[email protected]>: > > > --- On Wed, 3/16/11, Viesturs Lācis <[email protected]> wrote: > >> From: Viesturs Lācis <[email protected]> >> Subject: Re: [Emc-users] pwm AD converter >> To: "Enhanced Machine Controller (EMC)" <[email protected]> >> Date: Wednesday, March 16, 2011, 9:51 AM >> 2011/3/16 Klemen Dovrtel <[email protected]>: >> > Hello everybody, >> > >> > I would like to measure some analog signals using emc >> (for PID control). I think the easiest way would be to >> measure the pwm signal. >> > >> > Is there a hal module/component which could i use or >> can assemble one from existing hal modules/components? >> > >> > I was thinking i could use two oneshot functions, one >> to trigger on rising edge and one to trigger on falling >> edge. What i need is a function to measure the time between >> those two events - is there a hal function for that? >> >> >> I am not sure, if I understand correctly, what is the goal >> You want to >> achieve and what signals do You want to measure, but I >> think that You >> can: >> 1) use voltage-to-frequency converter chip like this: >> http://www.national.com/mpf/LM/LM231.html#Overview >> or use already assembled Mesa's THCAD board >> Both if them take 0-10V on input and outputs frequency >> signal >> 2) use encoder module in HAL to treat the frequency signal >> and provide >> an input to PID loop. >> >> Viesturs >> >> > > Thank you, this is what i was looking for :) But i am still not sure how to > measure the pulse width with the encoder module. > > So i should use the stepgen module to generate pulses as fast as possible and > count them using encoder module. I should reset the encoder module on rising > edge of PWM signal and count pulses till the falling edge of PWM signal > occurs.
Why do You want to use stepgne to generate pulses and then count them with encoder module? That does not make any sense to me. I think that You are misunderstanding, what does software encoder module do. The frequency output from VFC chip is what You would feed to the encoder module. Take a look at page 78 (section 8.6.) in Integrator's manual. Viesturs ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
