This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP430I2021
Is it possible to modify the EMDC library to suit my particular needs? For example, i would like to design a meter with a maximum range of 6000A. The IRMS register is in uA, which cannot represent more than 4294A (32bit unsigned). Do you offer source code or have any idea how to trick the library into giving me mA?
Part Number: MSP430I2021
The technology guide seems to be very light. Are there more detailed guides available? I have generated code using the energy measurement design center with the intent of adding some application code. I would like to act on the IRMS current data each time it is available. From the guide, this should be roughly every 80ms. I have added code to toggle an LED to the EM_processForegroundData() routine, but it only seems to hit that code roughly every 7s. Am i incorrectly understanding how this code works?
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to S.L:
Thanks for your interest in using EMDC.
S.LIs it possible to modify the EMDC library to suit my particular needs? For example, i would like to design a meter with a maximum range of 6000A. The IRMS register is in uA, which cannot represent more than 4294A (32bit unsigned). Do you offer source code or have any idea how to trick the library into giving me mA?
Basically, this should be possible. It's more a matter of translating between what's actually being measured (e.g. 6000A) versus what EMDC thinks is being measured (e.g. 60A).
The trick here would be to configure EMDC to have a maximum RMS current of 60A in the current sensor configuration window (while tweaking the parameters to match the max sensor output voltage (if it's RMS, you'll need to convert to peak) at 6000A) and calibrating at a lower current such as 6A (which would actually be 600A). Notice there's a factor of 100 here between both the max RMS current and calibration current. This effectively shifts the RMS current resolution from uA to 0.1mA. On the host side, you'll just need to multiply the RMS current value (and perhaps others such as Active Power, etc.) sent from MSP430 running the EMDC-generated code by 100 to achieve this. I hope this makes sense. If it doesn't, let me know and we can break it up into smaller details to clear things up.
In reply to James Evans:
Thank you James. I will give it a shot. Are you able to help with my other question above regarding timing of the processes?
S.LFrom the guide, this should be roughly every 80ms. I have added code to toggle an LED to the EM_processForegroundData() routine, but it only seems to hit that code roughly every 7s. Am i incorrectly understanding how this code works?
Were you doing this without the high voltage inputs? I suspect that's what's causing the delay. If you don't want to connect to the board when it's connected to high voltage, one way of debugging that we have found to be effective is using a target socket board with two AC sinusoidal wave form generators with frequency and amplitudes equal to what your voltage and current sensor output voltages would be at specific voltages and currents respectively. This works as long as those inputs are less than the max Full-scale range (FSR) defined in the datasheet for the PGA gain selected (which gets automatically selected by EMDC based on your max sensor voltage in the GUI).
I hope that helps.
Ah. That makes sense. For my application, i would like to only meter current. Is it possible to hard-code the sampling interval or switch the timing to be based on current instead of voltage? Or do i need to use a different architecture?
If no zero crossings are detected on the voltage inputs, then the updates are done every two seconds. This way, you could also measure DC voltages which don't have zero crossings. You could change this update frequency in the code to shorten this time. Look for the line of code that's similar to this in the 'hal_adc.c' file.
else if (gEmSWResult.phaseMetrologyPing[EM_PH_A_IDX]->sampleCount > (2*EM_SAMPLING_FREQ_HZ))
If the sampling frequency is 4kHz, then 4k samples "EM_SAMPLING_FREQ_HZ" equals 1 second. Multiplying this by 2 means the results are updated every 2 seconds. I hope this makes sense.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.