Digital RMS Amperemeter for Laser Cutters

by Vulcaman in Circuits > Lasers

4001 Views, 16 Favorites, 0 Comments

Digital RMS Amperemeter for Laser Cutters

#1.png
#2.jpg
IMG_20210116_110849.jpg
IMG_20210116_110859.jpg
IMG_20210116_110929.jpg

Hi,

in this Instructable I want to show you, how you can build your own Digital RMS Amperemeter for your Laser Tube.

While working with my Co2-Laser for a while now, I wanted to knew all the parameters about the Laser Tube. However the most common setup to measure the Current of the Lasertube is to use an analog Amperemeter like this one:

It wasn't my favorite at all, so I have put it in my switch cabinet, but because the knowlegde of the current is so important I have startet to design my own Digital Amperemeter.

Features of the Amperemeter:

  • TRUE RMS Measurement of the Current
  • 0-30 mA Range with a Resolution of 0.1 mA
  • TFT-Display
  • One Digital Input for safety control
  • 24 V Input Voltage
  • Cost: +-20€

Video of the Amperemeter in Action at 9 mA RMS:

If you like my Instructable, please vote for me in the PCB-Contest

Visit my Instagram

Visit my Website

Theory

Here I want to show you how my Amperemeter basicly works

The equivilant circuit:

The common China-Laser setup is to use an High-Voltage Powersupply, which will force the Laser to start the beam. Then the current of the Laser-Tube flows through the Lowside back to the PSU.

To Measure the Current I have put a Shunt-Resistor in the Low-Side Path, so I could calculate the current with Ohm's Law:

But sadly the Shunt Voltage isn't really constant so I will need to calculate the Root-Mean-Square (RMS) Value to calculate the effective Current.

The Real Current:

I have measured the real Current of the Tube at 30% with my Oscilloscope and as you can see the Waveform looks like an expontial fall at 5 kHz:

The Idea is to sample the Voltage at discrete Timesteps way faster than 5 kHz with a Microcontroller and calculate the RMS-Value from these discrete values.

For this purpose I have used a STM32F103. To sample the Values, I have configurated the 12bit-ADC in DMA Mode. I will sample 1000 Values at once, then I will calculate the Root-Mean-Square of all these Values.

And as you can see I will come pretty close to the RMS-Value of the Current:

The Circuit

The Circuit of the Amperemeter is relative simple. The main cuircuit is just an Non-inverting Amplifier + some level shifters. I have used a TLV2376 Op-Amp from Texas Instruments.

Electronic Parts:

QuantityDescriptionLink
1x1k 0805 Resistor
-
1x4,3k 0805 Resistor
-
4x
10k 0805 Resistor
-
1x
100nF 0805 Capacitor
-
1x
PC817 SMD Optocoupler
-
1x
DSUN MP1584 Step Down Modul
Aliexpress
1x
STM32 "Blue Bill"
Aliexpress
2x
AO3400 N-Channel MOSFETs
Aliexpress
1x
2512 1Ohm Resistor
-
1x
6x7 100uF Polarized Capacitor
-
1x
TLV2376 OpAmp
-
2x
2Pin Terminal Block

The PCB

For this project I designed my own PCB. Because I could only bought 10 PCBs at once, you can buy the remaining PCBs for a cheap price at Vulcaman.de

Source Files

Here you will finde the Schematic and the Board-Files for the PCB. The PCB is designed in KiCad

You can download all the Files below

Downloads

Solder the SMD-Components

IMG_20210115_173131.jpg
IMG_20210115_173155.jpg

Now its time to start soldering. As always, start with the SMD-Components

Solder the THT-Components

IMG_20210115_173451.jpg
IMG_20210115_173501.jpg
IMG_20210115_174438.jpg

Then attach all the THT-Components

Adjust the DCDC-Converter to 5V

IMG_20210115_175630.jpg
IMG_20210115_175702.jpg

Once you have soldered all the components expected the STM32, connect the 24 V Power Supply to the PCB and adjust the 5V-Rail to 5 V.

Programm the Nextion Display

Nextion.png

For the GUI I am using a 2.4" Nextion Display. You can find all the source files below

Downloads

Programm the STM32 "BluePill"

The STM32 is programmed with STM32CubeIDE with CubeMX

You can download all the sourcefiles at the bottom of this step

Overview of the Programm

The main program consits of the calculation of the root mean square:

float rms(uint32_t *v, int n)
{
int i;
uint64_t sum = 0;
for(i = 0; i < n; i++)
sum += v[i] * v[i];
sum2 = sum;
return (sqrt(sum / 1000.)*3.3/4096.)*46.25/2.;
}

The values for the RMS-Calculations are coming from the ADC in DMA Mode

HAL_ADC_Start_DMA(&hadc1,ADC_DMA_Values,1000);
HAL_Delay(100);
HAL_ADC_Stop_DMA(&hadc1);
RMS = rms(ADC_DMA_Values, 1000);

Downloads

Install the Amperemeter

IMG_20210116_105844.jpg

Finally place the Amperemeter to your switch-cabinet, connect the wire from the Lasertube and you are done.

If you have any questions, feel free to ask me :-)