I am using PIC16f1787 as my main controller. I have a device which is battery operated. to ensure long battery life,I am planning to put the device in sleep mode. The main function of this device is to measure rms current and to set alarm if the measured current exceeds the pickup value.The alarm has to be reset by 3 mechanisms- a reset switch, a reset signal and auto reset time. The second function is to detect low battery volatge of the device and indicate the low volatge by an LED.
I am planning to wake the device by 2 timer interrupts.First timer interrupt of 1.25 msec to measure current only. Second timer interrupt of 10 msec to measure low battery voltage,to set alarm for current overload and to reset alarm.
Please help.
9 1519
I am planning to take 16 samples every 20 msec for measuring rms current.
Sounds like you can measure instantaneous current and are seeking advice on how to convert a series of these current readings into rms current. I'm not sure rms has any meaning for an aperiodic function. Have you looked at the current waveform to see if it is periodic?
As per my knowledge, I think current is always periodic. Yes I want to measure rms current. I will have to take 16 samples in every 20 msec,sum these squared samples,divide by number of samples and take a square root of entire total. My question is How to generate a 10 msec interrupt to generate delay of 1 hour?
Also would like to know How can I handle multiple time sliced tasks using a single timer interrupt?
You referred to a battery-operated device in your first post. Batteries are typically direct-current (dc) voltage and current. If current is ideal dc then it is a fixed value that never varies - in that case, all instantaneous current readings are identical and rms current equals instantaneous current. In a real-world battery, voltage and current will droop as the battery discharges; in that case, current is aperiodic and entire concept of rms becomes uncertain. Also in real-world, current load of a digital circuit varies at the nanosecond time scale - probably a meaningful rms there, but you won't see it if you sample at 1 msec.
I suggest you find out what the current waveform looks like. Ideally, your sampling regime should be influenced by the periodicity of the signal.
Computing rms from samples spread over 20 msec suggests that you expect the current waveform to have a frequency of 50 Hz.
You only need one timer interrupt at 1.25 msec. Every 8th interrupt marks 10 msec; every 2,880,000th interrupt marks 1 hour.
Implementing a multi-tasking operating system ("multiple time-sliced tasks") is nontrivial. That's a lot of functionality to ask of a PIC processor.
How fast can your hardware capture the instantaneous current? Some A/D chips take longer than 1.25 msec.
(Or at least they used to - my age may be showing.)
yes you are right.I am using internal adc of pic16f1787. It takes more than 1.25 msec .
Please provide some alternate solution.
If your A/D is too slow to measure the waveform in question, then you either need to get a faster A/D or you need to design some sort of rectifier circuit that derives a second waveform from the first -- where the second waveform is slow enough to be measured. Then you use the known relationship between the two waveforms to compute the rms of the first.
Do you have an electrical engineering background?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: IVer Erling Årva |
last post by:
Hi!
I am looking into making a database application and to limit the
client<->server traffic I want to handle all entry/amendment of the data in
the browser and save it all once the entry is...
|
by: Roman Mashak |
last post by:
Hello, All!
I started to implement simple command line interface (CLI), and wanna
know how to use table of fucntion calls. Could you please, recommend me some
link or give example directly in...
|
by: Slimo |
last post by:
Hello,
Can someone post a sample code for ASP.NET using WMI (retrieve harddisk
space, network card name,...) no matters I just need an example to see how
it works. I prefer code using VB. Thanks
|
by: Peter Kaufman |
last post by:
Hi,
Subject line says it all except VB.NET preferred, but C# would be okay
too.
Thanks a lot,
Peter
|
by: _iycrd |
last post by:
Specifically I need to wrap an older Win32 DLL in a managed class. I
had this running with VS2003's Managed Extensions, though it required
two separate classes.
With C++/CLI this was supposed...
|
by: Guru |
last post by:
Hi,
I have been trying for a long time now to incorporate Call back for GridView
so that I can page through the data without the whole page reloading.
I havent been successfull till now. Has...
|
by: Riyadh Hossain |
last post by:
I am developing USPS shipping API for my site. All the work is going on
testing phase. My site uses PHP/MySQL. Now I am working on USPS
tracking/confirm. I can send request and get responses from...
|
by: nirmalsingh |
last post by:
plz help me with sample code to create session variable in java script...
|
by: Will |
last post by:
- I know enough ASP and Access to be dangerous :)
- I need to put up a data base on our web server with 3 related tables.
- They will be accessed by a limited number of people.
- Each user will...
|
by: Vague |
last post by:
Hello There, I've recently been working on a large project, very database driven, in C# on windows systems, calling a MySQL database on a linux box.
The project is going very well. Except that...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |