need some work related type help...

Status
Not open for further replies.

jrz126

Active Member
I need a way to determine the % on time for a PWM signal. I believe it runs at a constant 100Hz.
I'm working on designing this simulator for a locomotive computer (Brightstar). Right now I'm working on the Traction Alternator and Exciter. The Brightstar puts out a PWM signal which drives the exciter to generate the field that causes the traction alt. to start generating.

The loco computer is connected to a unix based system (Nighthawk). which handles all of the I/O. Now the problem lies in reading this signal in my plant model for my exciter.

Looking at the schematic, I think I can tap into the PWM signal at an optoisolator (+5V-0V). (I have no idea what kind of waveform it is or the frequency (I think its 100hz)). I would then need a way to convert the % on time into an analog voltage which I would then connect to an analog input on the nighthawk.
 
How much accuracy do you need? How much ripple (uncertainty) can you tolerate? How fast does you need to track changes (i.e., how much lag can you tolerate, or what sort of bandwidth do you need)? What is the input resistance of your data acquisition system?
A lowpass filter will give you a voltage proportional to duty cycle, but all the above questions come into play before it can be properly designed.
 
I'm not really sure about the accuracy....I'd say accurate within .5% (the 'percent on' that read in, say the percent on is 23%, 22.5-23.5% would be tolerated).

I'm not really sure about the lag or bandwidth, but I believe the hardware model that handles reading these values runs every 30 mS if that helps.

and I'll have to get back to you on the Rin.
 
With 100Hz pwm, there will be substantial lag (and low tracking bandwidth) if you want to do this with analog methods. With digital sampling and processing, it could be a lot faster.
 
I just talked to some people and they said that there was an idea to use high speed digital sampling, and over sample it to find this duty cycle.
They also said that they can control the output to be within .0031% of a percent. Thats in the software though, so there are probably some inaccuracies in the hardware.

What kind of sampling rate is needed for this 100Hz signal? (it's definitly 100hz, i was unsure before)
 
200 samples per cycle (20kHz) will give you 0.5% resolution - and that's digital sampling. You just have to count 20kHz pulses while the pwm is high, then count them when low, and divide the number of pulses during the high time by the total per period. No A/D conversion required. You would probably want to use a frequency higher than 20kHz, but you get the idea.
You could do some averaging over several cycles to reduce the cycle-to-cycle jitter, if there is any.
Why am I telling you all this? This is a topic for one of the microcontroller guys. Nigel - somebody - , bail me out!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…