Vermes
Advanced Member level 4
The system was to generate the PWM output (f=1kHz), with a filling dependent on the measurements. A discrete PID controller was implemented in the Atmega16 uC.
About the measuring circuits. The system was to measure three values:
- current in the range 0...100A
- voltage in the range -1V...+1V
- temperature in the range 0...100 degrees Celsius
- current of +/- 200mA
- voltage of +/- 10mV
- temperature +/- 1 degree Celsius
The current measurement was realized by a shunt from LEM, part number LA-100P. Output from pin M was shorted to the mass by a resistor 10ohm and potentiometer 100ohm, giving an adjustable RM resistor value recommended by the manufacturer from 10 to 110ohm. Output from pin M was also connected to the amplifier LM358.
Voltage
Measured voltage (Vm) is added to the reference voltage source (Vref=1,24V) through the resistors voltage adder. Such a “summed up” voltage is fed to the amplifier LM358 in order to make voltage calibration possible. Vref of the Atmega is internal 2,56V.
Temperature
Thermocouple type K and a dedicated thermocouple amplifier AD595Q were applied. It gives quite accurately 10mV/degree Celsius. About 1V is gained at the output for 100 degrees Celsius, so the signal is even amplified approximately 2,5 times to use the full resolution of the 5Atmega ADC.
Control input
Analog control input in range of 0...2,5V allowing the 'rigid' set the PWM fill. The voltage protection and a place for RC filter at each track.
The device can be used as:
- meter of the above-mentioned values
- alarm of the exceed limit value of the measurand
- meter of the power supplied to the unit for temperature
Link to original thread (useful attachment) – Mikroprocesorowy układ sterowania mocy