Measure Pulse or Voltage ..which is best
Hello,
·· I have a machine that drives a solenoid with a mosfet. I want to read the pulse with a SX48 and know what % Duty cycle the solenoid is. I know the voltage going to the solenoid is around 14 VDC would it be easier to read the voltage with a D/A converter or can I read the Pulse with say the PulseIn command somehow. Any ideas on how to start would be great. I was thinking I would have to know the pulse 0-1-0 and the 1-0-1 pulse widths and then add them together to get the % of the PWM going to the solenoid or am I on the wrong track?
Thanks
·· I have a machine that drives a solenoid with a mosfet. I want to read the pulse with a SX48 and know what % Duty cycle the solenoid is. I know the voltage going to the solenoid is around 14 VDC would it be easier to read the voltage with a D/A converter or can I read the Pulse with say the PulseIn command somehow. Any ideas on how to start would be great. I was thinking I would have to know the pulse 0-1-0 and the 1-0-1 pulse widths and then add them together to get the % of the PWM going to the solenoid or am I on the wrong track?
Thanks
Comments
You might be able to use the gate signal to interface with your sx, then you don't need to worry about 14volt conversion to 5.
Chances are the gate of the mosfet is being driven with regular 5v logic, if so, your in luck.
And you can use the pulse in command, depending on what the duration of your pulses are. Pulse in will timeout after only a few seconds i think because the sx has a limited amount of counter space.
If your solenoid timing is long for both on and off, you can use other sx commands to do that timing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Meh. Nothing here, move along.
Post Edited (BPM) : 6/5/2009 8:52:31 AM GMT
Use can use two seperate PULSIN commands to read the HIGH time and the LOW time.
Or if the frequency off-time is constant, you could just use COUNT.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
Post Edited (Bean (Hitt Consulting)) : 6/5/2009 2:59:12 PM GMT
BRM it looks like about 12v on the gate of the mosfet using my scope. but its not easy to hook·a wire to as the output of the mosfet.
I meant to say, if the frequency is constant you only need to measure one level of the pulse.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·