Author Topic: testing governor, voltage regulator: video of meter  (Read 13649 times)

veggie

  • Keep Calm and Start the Lister !
  • Hero Member
  • *****
  • Posts: 843
    • View Profile
Re: testing governor, voltage regulator: video of meter
« Reply #30 on: April 26, 2017, 03:03:46 PM »

I built my own voltage / frequency sensing circuit for the unit I use on my setup. This time I'm going to try a simpler path - so others can more easily copy it - ordered a couple of these to try out.

http://www.ebay.com.au/itm/2mA-Active-Module-Single-Phase-Voltage-Sensor-AC-Voltage-Transformer-For-Arduino-/311683408404?hash=item4891c76214:g:j3QAAOSwV0RXvA5s

Samo

Samo, Glort,

Help me understand what this module does.
Am I correct in saying that it can sense AC voltage (120 VAC in my case) and convert it to a 0-5 VDC signal that the Arduino can read ?
If so, I can see where that would be useful for several different applications.

Veggie
- 6/1 GM90 Listeroid - Delco 33si Alternator
- Changfa R175 - Lease/Neville Alternator
- JiangDong R165 Air cooled - 2 kw
- Changfa S195 (Waiting for a project)

BruceM

  • Hero Member
  • *****
  • Posts: 3054
    • View Profile
Re: testing governor, voltage regulator: video of meter
« Reply #31 on: April 26, 2017, 04:11:44 PM »
Guys, the AC voltage sense module Samo found is just a transformer with an op amp voltage follower; it does NOT do RMS voltage conversion for you, you only get to sample the varying AC voltage with the Arduino.  RMS voltage calculation isn't terribly hard but if you need the answer fast and in real time with some precision, you will want to use a timer, and an interrupt routine.  I just did this for a DIY sine inverter project.  My RMS code is intentionally not interrupt driven; my main timer1 routine does very critical interrupt driven timing for the inverter so can't have any other interrupt events going. The RMS voltage routine samples a half wave when signaled by the timer routine that the start of the wave is beginning. The routine watches the timer counter in a tight loop to wait for 2 ticks of the timer to know when to sample the A/D.  After the 65 half wave (8.88 msec) samples, adding each sample squared to a sum, the result is divided by 65 and the square root taken.  That is the RMS voltage.  In my case, I rectified the AC from a small transformer, and scaled it so that the voltage peak is about 3.75V for sampling by the 10 bit, 5V A/D so that I get better resolution.  I believe the unit Samo found centers the AC on 2.5V, so you'd have to subtract 512 from each sample before squaring and adding to the sum of the squares.

I don't think real time RMS calculation is really in the domain of novice programmers. Fortunately there are a couple other alternatives.

There are IC's that do analog RMS voltage conversion for you, though they are a bit spendy (I think about $10).  They are slow, you only get the answer delayed by about 100 milliseconds, but are very accurate and the output is a continuous DC voltage representing the average AC voltage of the last 0.1 seconds. I've used one, and they can be handy.

The difficulty in real time RMS voltage calculation or cost of the analog conversion chip (and delay) is why most AVR's don't bother.  They rectify the AC, scale it with a resistor divider, slightly average it with a very small capacitor, and call it the DC representation of the AC voltage.  The RMS voltage of a true sine wave is thus computed from the peak voltage (peak/1.4=RMS). The averaging cap is especially needed with an ST head to filter off the spikes on the waveform peaks. It works acceptably for most sine-ish waveforms.  It's what my own AVR does, because it has no processor and I needed a fast simple answer to allow fast correction for Lister flicker reduction.  



« Last Edit: April 26, 2017, 04:25:35 PM by BruceM »

Samo

  • Full Member
  • ***
  • Posts: 176
    • View Profile
Re: testing governor, voltage regulator: video of meter
« Reply #32 on: April 26, 2017, 09:55:09 PM »
Correct Bruce,

Though the truth is in this case I'm not really interested in the voltage representation from these devices because my AVR is doing a great job, voltage is stable regardless of the engine speed (within reason). Which is what I was trying to point out to Tys and was concerned his AVR was defective.

My primary use for these devices is to build a PID controller. I have a single phase synchronous AC alternator so engine speed directly equates to the AC Hertz value. I want a stable 50 Hz, so in this case I'm calculating the Hz value and intend to use these devices as a means to count AC waveforms to adjust engine speed and maintain 50 Hz AC power. 

I also use a current transformer to measure the alternator load, and use changes in load to "pre-position" the speed adjustment for better response.

Additionally given these devices do provide a representative AC voltage, I can get the Arduino to adjust automatically adjust to different voltage/hz combinations. 120v at 60hz or 240v at 50hz. At the moment my system assumes 240v and 50hz and so it's a code change for a 120v setup.

Originally I built my own circuits on vero board but that's not ideal and was looking for an easier more modular way to build a PID controller. So if you do want rock solid Listeroid engine speed for power generation this type of controller will do that.




Lister CS 12/2 & JKSON 10/1 Listeroid

Samo

  • Full Member
  • ***
  • Posts: 176
    • View Profile
Re: testing governor, voltage regulator: video of meter
« Reply #33 on: April 26, 2017, 10:04:46 PM »

Samo, Glort,

Help me understand what this module does.
Am I correct in saying that it can sense AC voltage (120 VAC in my case) and convert it to a 0-5 VDC signal that the Arduino can read ?
If so, I can see where that would be useful for several different applications.

Veggie


Correct it should do that, I'm also expecting I can sniff an AC waveform or pulse from the circuit board somewhere to use in the Hertz calculation. One of the other things this device does is isolate the High Voltage bits from the low voltage bits. You don't want to get that wrong!

 
Lister CS 12/2 & JKSON 10/1 Listeroid

BruceM

  • Hero Member
  • *****
  • Posts: 3054
    • View Profile
Re: testing governor, voltage regulator: video of meter
« Reply #34 on: April 27, 2017, 04:01:47 AM »
I know you're totally on top of things, Samo, and do professional level work. Didn't mean to imply otherwise and I thought that little transformer might be worth buying the sensor board to steal it from so I also appreciate the link.

 It was Glort asking about AC to DC conversion that prompted my exposition on RMS calculation. He's a newbie to Arduino and programming. The Arduino AC sensor board does not give him a DC level representative of the AC voltage which I think was what he was looking for.  It only gives him a transformer isolated low voltage version of the waveform, centered on 2.5 volts.  A bit more software is required than just reading the A/D and scaling the result to find AC volts.  Not trivial for non-programmers. 

The analog circuit to do it (non-true RMS) is pretty simple and should be sufficient in most cases.  The sensor board transformer could be used for it. One way or another, transformer isolation is a good idea to completely isolate high voltages from the low voltage DC side of things, as Samo rightly states.

Plenty of simple circuits for zero cross detection that provide a digital input signal; the signal can be used for timer control so that hardly any processor time is needed.  Fun stuff.