gfxgfx
 
Please login or register.

Login with username, password and session length
logo
 
gfx gfx
gfx
19855 Posts in 1278 Topics by 5183 Members - Latest Member: StarFish August 24, 2026, 07:53:13 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Breaktru Forum  |  eCigarette Forum  |  Modding  |  Topic: My project: Arduino VV/VW PWM + regulating true RMS voltage
gfx
gfxgfx
 

Author Topic: My project: Arduino VV/VW PWM + regulating true RMS voltage  (Read 12839 times)

0 Members and 1 Guest are viewing this topic.

Offline norcalreballer

  • Sr. Member
  • ****
  • Joined: Jul 2014
  • Location: USA
  • Posts: 63
  • Karma: +6/-0
  • Gender: Male
My project: Arduino VV/VW PWM + regulating true RMS voltage
« on: March 19, 2015, 05:45:14 PM »
Just getting this thread started.  Right now I'm using:

Arduino Pro Micro(final build will be Atmega328p on custom PCB.)
I set the frequency to 122hz to try to get away with no mosfet driver.  I'm using a 220ohm resistor between the PWM pin and the gate of the MOSFET.
INA169 - Adafruit 45a current sensor.  Uses a .001? shunt resistor and voltage divider to bring output below 3.3v.
128x64 SPI OLED Display setup to use hardware SPI
lm4040 3.3v
lm7805c - I have an LM317, but it's hosed.  PCB will sport a proper LDO.
IRLB3813 N channel MOSFET



Most people I see are actually sampling the wave directly and making calculations for that to control RMS voltage.  If you read a few months ago, I had the idea of sending a high signal to the gate just long enough to get a loaded battery voltage reading and current reading then pulsing afterwards.  This is taking into consideration that the load won't change and voltage shouldn't change much, if at all within a 3-4 second pull. Well, it worked!  Takes 35ms for everything to stabilize and get a good reading, but even with 3s input and a .3? build you can't even notice the 35ms high signal.  I got everything working and wanted to compare what the display says to what my scope says.

I'm very happy to say that the results are fantastic.  I can control RMS voltage within +/-50mv.  Take that, China!  Honestly, most of that is noise from this crappy scope.  You can see it when it should be at 0v says around 50mv all of the time.  This is a huge win for me, as I'm new to this.  Resistance matches up with what my Chinese ohmmeter says, but I'm going to setup a constant current source and really get some accurate numbers. 

This setup is very cool, because there's no need for filtering.  The INA169 handles voltage and current, so it's actually only 2 analog pins being used. I'll post a video a video soon showing the comparison for you guys very soon and add more info.







 





« Last Edit: March 19, 2015, 05:48:54 PM by norcalreballer »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +293/-1
  • Gender: Male
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #1 on: March 19, 2015, 07:24:30 PM »
Sounds great, congrats on your design.

Honestly, most of that is noise from this crappy scope.

DSOs have come down hugely in price the last ten years.  I bought one a couple years ago and features keep getting better for the same money, bigger screens, higher sample rates, more memory, etc.  I'm really temped to buy another one, got my eye on this one;

http://www.amazon.com/SDS7102-Digital-Oscilloscope-2-channel-interface/dp/B006G54K3G/


Offline norcalreballer

  • Sr. Member
  • ****
  • Joined: Jul 2014
  • Location: USA
  • Posts: 63
  • Karma: +6/-0
  • Gender: Male
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #2 on: March 19, 2015, 09:48:57 PM »
Man,  I wish I could justify a decent scope.

Offline iusedtoanalog

  • Full Member
  • ***
  • Joined: Jan 2012
  • Location: Pennsylvania
  • Posts: 28
  • Karma: +9/-0
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #3 on: March 20, 2015, 01:21:27 PM »
I have been keeping a watchful eye for this post from you. I remember reading the post you refered to and thinking that sounds like a great idea. It is great when you think something should work a certain way, and then it actually works just like you thought is should. I have wanted to start experimenting with the arduinos in a mod, but time is the resource I seem to have the least of lately... Keep up the good work, I can't wait to see what the final product is.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +293/-1
  • Gender: Male
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #4 on: March 20, 2015, 03:45:03 PM »
Man,  I wish I could justify a decent scope.

Well justifying one isn't hard if you plan to keep doing electronics projects, though it's not always easy to part with the money for one.  Relative to other expenses for hobby supplies and equipment, it's not all that much.  One additional benefit to DSOs is they typically have data screens you can display so it can act as a second digital voltmeter for DC stuff.  They can provide quite a bit more information than analog scopes. 

Also, the 100mHz scopes are the more expensive ones.  You don't need that much bandwidth unless you want to look at RF signals or very high speed digitial signals.  Most of the time a 20Mhz or 50Mhz scope will do and those are a lot cheaper than the 100MHz scope I linked to.

Offline wa9w00d

  • Super Member
  • *****
  • Joined: Oct 2014
  • Location: Georgia
  • Posts: 132
  • Karma: +32/-1
  • Gender: Male
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #5 on: March 20, 2015, 09:02:19 PM »
This is gonna be a bit of a jack, but I want to ask Craig what, if any, of the sampling scope adapters (the kind that use the PC screen via a USB input) he would recommend?

I've been thinking of going there.  I have an old cheap (quality wise) analog CRT scope.  Would I gain much with such a unit?

And Norcal, I have been following with interest.  Best of luck  ;cheers;

Thanks,
Wayne

Offline norcalreballer

  • Sr. Member
  • ****
  • Joined: Jul 2014
  • Location: USA
  • Posts: 63
  • Karma: +6/-0
  • Gender: Male
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #6 on: March 20, 2015, 11:30:26 PM »
I ordered one of those cheapo hantek 6602be jobbers..  Noisy,  but for my purposes it works fine.  All I need it for is to double check my work on this project.  It works ok for that.  :)

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +293/-1
  • Gender: Male
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #7 on: March 23, 2015, 08:02:56 PM »
This is gonna be a bit of a jack, but I want to ask Craig what, if any, of the sampling scope adapters (the kind that use the PC screen via a USB input) he would recommend?

There are some "scope on a PC" units that can work okay, but generally they're limited in bandwidth and you're limited by the USB interface in terms of the update rate.  The update rate is actually somewhat critical since it's not unusual to be interested in waveform changes that can occur faster than an update rate you would get with a USB interface.  If you really can't afford two or three hundred dollars for an inexpensive DSO it's better than nothing.  Be picky though, the cheap ones are pretty worthless.

Personally I wouldn't spend the money on one of those "scope on a PC" jobs.  The good ones aren't all that much cheaper than an inexpensive 20MHz DSO which would be hugely better.  If you really want a PC interface pretty much all of the DSOs offer a USB connection that supports a display on your PC monitor along with a remote control panel.  Even so I've used the PC interface for my DSO and it it's handy for saving off waveform images but that's about all it's good for.

Offline wa9w00d

  • Super Member
  • *****
  • Joined: Oct 2014
  • Location: Georgia
  • Posts: 132
  • Karma: +32/-1
  • Gender: Male
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #8 on: March 23, 2015, 08:16:56 PM »
Thanks for the input, guys.

And I had done a bit more digging, and I see where your coming from, Craig.  My budget says no to anything at the moment anyway, so I'll save for a real DSO scope at a future date.  Till then the old analog CRT will have to suffice.

Wayne

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +293/-1
  • Gender: Male
Re: My project: Arduino VV/VW PWM + regulating true RMS voltage
« Reply #9 on: March 23, 2015, 08:37:25 PM »
I used an analog scope for years, remember that inexpensive DSOs are a fairly recent development.  If you can't afford a new scope right now, see if you can get a better analog scope off eBay or something.  They sell for next to nothing now since DSOs have come down so much in price.  A good used analog scope will do you quite well until you can spring for something better.

Breaktru Forum  |  eCigarette Forum  |  Modding  |  Topic: My project: Arduino VV/VW PWM + regulating true RMS voltage
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!