--- On Wed, 3/16/11, Viesturs Lācis <viesturs.la...@gmail.com> wrote:

> From: Viesturs Lācis <viesturs.la...@gmail.com>
> Subject: Re: [Emc-users] pwm AD converter
> To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net>
> Cc: "Klemen Dovrtel" <klemen_dovr...@yahoo.com>
> Date: Wednesday, March 16, 2011, 11:33 AM
> 2011/3/16 Klemen Dovrtel <klemen_dovr...@yahoo.com>:
> >
> >
> > --- On Wed, 3/16/11, Viesturs Lācis <viesturs.la...@gmail.com>
> wrote:
> >
> >> From: Viesturs Lācis <viesturs.la...@gmail.com>
> >> Subject: Re: [Emc-users] pwm AD converter
> >> To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net>
> >> Date: Wednesday, March 16, 2011, 9:51 AM
> >> 2011/3/16 Klemen Dovrtel <klemen_dovr...@yahoo.com>:
> >> > 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
> 

Thank you for you reply,

Ok, but the encoder just counts the number of pulses (rawcounts variable) and 
that is it. I also need to know how long did encoder count to calculate the 
pulse width or frequency.

So my idea was to count the pulses of known frequency (generated by stepgen 
module) and count them with the encoder (to get the time duration), and at the 
same time monitor the PWM signal that i want to measure. My idea was to count 
the number of pulses of known duration between the rising and falling edge of 
PWM signal.

How did you think i could get/measure the PWM signal pulse width?

Regards
Klemen



      

------------------------------------------------------------------------------
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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to