Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:26 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Windmills : Working out Watt Hours

Author Message
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 11:39pm 13 Sep 2006
Copy link to clipboard 
Print this post

I want to add a Watt Hours display to the PicLog software. But not sure which way i should go about this.
I know if the windmill made 10 watts for 1 hour ( or 5 watts for 2 hours ), it made 10 watt hours, how should I calculate a watt hour figure for something that varies so much. If the PicLog recorded every 60 seconds, and the values jumped around between 0 to 25 watts, how would I work out watt hours for that hour, or day?

Would I add all the recordings for the day, then divide that by the number of recordings in the loggin period ( 3600 for a full day ) then multiply that by 60 to get our full hour?

I think I'm off the track a bit here.

Glenn Edited by Gizmo 2006-09-15
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
RossW
Guru

Joined: 25/02/2006
Location: Australia
Posts: 495
Posted: 04:20am 14 Sep 2006
Copy link to clipboard 
Print this post

Glenn, watts are an instantaneous measure, expressed conveniently in units like watt-hour, kilowatt-hour etc, but absolutely just as reasonable in watt-seconds.

I built a controller some years ago that did exactly that - measured instantaneous power every second and accumulated to provide:
total watt-hours in
total watt-hours out
nett watt-hours (in-out)

If you add the watts every second, then divide the answer by 3600 (seconds in an hour) you get watt-hours.

If you only take a measurement every minute, you're going to be moderately inaccurate - but it might be good enough for the purposes. The more samples you take, the closer you will be to the actual value. (I believe some of the NiMH "smart packs" have an 8 MIPS processor and sample power in and out at least 1000 times a second)

Oh, and if you are logging every minute, there are only 1,440 minutes in a day (86,400 seconds), not 3600. (That's how many seconds in an hour)

RossWEdited by RossW 2006-09-15
 
Xcat
Newbie

Joined: 13/07/2006
Location: Australia
Posts: 6
Posted: 11:24am 14 Sep 2006
Copy link to clipboard 
Print this post

Gizmo, I haven't looked at your PICLOG so I will just write in terms of algorithms. I am presuming you are calculating watts by sampling voltage and current and multiplying the corresponding samples. After that establishing the quantum of watt-hours simply becomes an integration exercise. In the digital world there is a trade-off between accuracy and sampling frequency. The main issue that affects this trade-off is inertia of the system being sampled. Basically this is the rate of change of the system output. If the rate of change is low then the sampling frequency can be lengthened without the risk of missing a change in the output.
In your example you have set the sampling frequency at 60 seconds. This may be too long (gut feel) for a windmill in gusty conditions. My feeling is that 15 seconds may be nearer the mark for inertia of such a system.
So in pseudo code, try this:
Inner loop (sample frequency 15 seconds)
get volts (from ADC channel)
get amps (from ADC channel)
watts = volts * amps * 15
add to watt-hour accumulator
hour timer flag set? go to outer loop
wait for the next 15 second tick (or do something else by returning from interupt service routine
Go to Inner loop
outer loop (executed once per hour)
reset hour timer flag
reset seconds time flag
store watt-hour accumulator in log_array{1} +1
store time_stamp in log_array{2} +1 (assumes presence of real time clock)
increment log_array index counter
inner loop time flag set? go to inner loop
wait until inner loop need to start or do something else

This should end up with an array log of watt hours that you can download or spit out to something else as needed. Using a real-time clock to trigger a couple of interrupt service routines will leave a good chunk of computing power to do other things in the meantime.
HTH


Xcat
Brisbane QZ
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 11:44am 14 Sep 2006
Copy link to clipboard 
Print this post

Thanks for that guys, I now know exactly what I need to do.

I will post an update on the Piclog this weekend with the updated software.

Thanks again.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024