MACHINE LEARNING APPLIED TO
CONTROL SYSTEMS
F. E. T. LIBERATO SALZANO VIEIRA DA CUNHA
ELECTRONICS TECHNICAL COURSE
DIEGO MACHADO E GABRIEL GOSMANN
ADVISOR: ANDERSON JEAN DE FARIAS
#8 PORTO ALEGRE ML MEETUP
Who are we
Electronics students at Fundação Liberato Technical
School under internship;
- Diego Machado
dmachado.nasc@gmail.com
- Gabriel Gosmann
gabriel.gosmann@gmail.com
github.com/Gosmann/machine_learning
Major doubt between Electrical Engineering and
Computer Engineering;
- home workspace / electronics lab
Introduction to the concept
- MIT OpenCourseWare
Computer Science: Artificial Intelligence.
12a: Neural Nets by Patrick Winston
“Then 2 years later Geoffrey Hinton, from the University of
Toronto stunned the world with some neural net work he
had done”.
Introduction to the concept
Introduction to the concept
2016 201720132012 2017
Introduction to the concept
Introduction to the concept
- Deep Neural Networks features:
- Can be applied to a wide range of problem domains;
- Able to solve very complex problems;
- An uncommon application of deep neural networks;
- Interesting things can happen if a powerful tool is applied to different areas problems.
Origin of the idea for TC
- The first idea was developing an autonomous cooling tower system able to work
regardless of changes in:
- temperature;
- pH;
- conductivity;
- turbidity;
- toughness;
- and and many other parameters;
- Automation Professor as Advisor: Anderson Jean de Farias;
Origin of the idea for TC
- temperature
- pH
- conductivity
- turbidity
- toughness
- valve state
- pump flow
just a code illustration
Origin of the idea for TC
- Definitely would be a multivariable control
system;
- Interest on the concept of AI;
- Changed the project to:
“how to apply deep neural networks to control
multivariable systems?”
Introduction to artificial neural networks
- Artificial Neural Network: computational model of the biological brain;
- Simple way to solve complex problems;
- Function approximation: saída = f(entradas, pesos, função de transferência)
Source: Tafner (1998).
Introduction to artificial neural networks
- Neural network: net of interlinked neurons;
- Deep Neural Network: one or more hidden layers;
- Able to recognize very complex patterns;
Source: Magri (1998).
Backpropagation
- Training the neural network to match the dataset:
- How to adjust the weights so that the output matches the dataset?
- Gradient descent: Steepest path;
- Cost functions: error = (ANN output – dataset output)².
Genetic Algorithm
- Mathematical functions optimization algorithm:
- Based on natural selection.
- Changes synaptic weights randomly;
- Ex.: peso sináptico novo = peso sináptico antigo X valor aleatório.
- Generation: group of different ANN;
- Crossover: develop new generations from the best previous;
- Mutation: apply random values to synaptic weights.
Genetic Algorithm
Source: Gómez (2001).
Machine Learning?
- The ANN is able to generalize the pattern;
- “Inductive reasoning is the derivation of general principles from specific observations”;
error (%)
iterations
Machine Learning?
- Demands external interpretations;
- Confusion between mind and computing - mind theory;
- Application of this very useful tool.
Introduction to control systems
- “Interconnection of components that cause parameter correction”
- SISO: single in, single out
- Temperature control - ON/OFF
Source: Eurotherm.
Introduction to control systems
- “Interconnection of components that cause parameter correction”
- SISO: single in, single out
- only one input parameter has to be taken in consideration control the output;
- temperature control - PID
Source: West Control Solutions.
Introduction to control systems
- “Interconnection of components that cause parameter correction”
- MISO: multiple in, single out:
- more than one input interferes on the control of one output;
- control of numerous chemical process;
Introduction to control systems
- MIMO: multiple in, multiple out
- Input:
- Angles: x, y, z;
- Acceleration: vectorial sum;
- Output:
- Position of the aileron;
- Position of the rudder;
Source: Advanced Control Systems – University of Melbourne.
Introduction to control systems
- Practical application:
- More than one simultaneous controller;
- Mathematical modeling;
- Hard multivariable calculus:
- Transfer function equations of all
variables;
- Hard coefficient tuning;
- “There is a function that describes the
mathematical model of the system”
Source: Advanced Control Systems – University of Melbourne.
Introduction to control systems
- Analog to the development of computer vision
Source: TUTORIAL DE VERÃO DEEP LEARNING (2017)
Method
- Part 1: Observation:
- Obtain the data;
Method
- Part 2: Training:
- Backpropagation and genetic algorithms;
Method
- Part 3: Application;
- Automated system;
The current source
- Electronics circuit that delivers a constant amount of current regardless of the load;
- The aim is making the current constant despite of variations in:
- Temperature (ºC);
- Supply voltage (V);
- Load changes (Ω);
The current source
Resources
- digital potentiometer: MAX5481
- analog to digital converter: MCP3428;
- raspberry Pi 3B;
- raspbian Jessie Linux;
- python 2.7;
- pyBrain;
- pigpio;
Resources
- digital potentiometer: MAX5481
- interface SPI;
- 10 bits, 1024 posições;
- saída de alta impedância;
Source: MAXIM INTEGRATED (2010)
Resources
- analog to digital converter: MCP3428
- 4 canais diferenciais;
- ganho programável;
- interface I²C;
- 16 bits, 15 SPS;
Source: MICROCHIP (2009)
The current source
- changes in temperature:
Source: MARQUES (2002)
The current source
- changes in supply voltage:
- V
B
depends on VH and on the position of the
potentiometer;
- VCC = 20V → VH = 5,08V → 5,08V > VW > 0V
- VCC = 8V → VH = 2,03V → 2,03V > VW > 0V
The current source
- changes on the load:
- indirectly leads to changes in temperature due
to difference in power dissipation:
- RL = 10Ω → 613mW
- RL = 60Ω → 113mW
- gradual and slow change;
The current source
- training from correct examples;
- gather data from an empiric dataset:
- supply voltage: 8V, 12V, 16V, 20V;
- load: 10Ω, 33Ω, 43Ω, 50Ω, 60Ω;
- temperature: 20ºC, 30ºC, 90ºC.
The current source
- training from correct examples;
- application of the developed method: alternating between backpropagation and genetic algorithm.
GENERATION
The current source
- practical application;
- input variables:
- VCC
(V): supply voltage;
- VBE
(V): temperature;
- VCE
(V): load;
- the input will be calculated and applied to the transistor’s base.
The current source
- We isolated the variables to favor comprehension:
- Fixed potentiometer:
- Change in current due to supply voltage;
- Change in current due to temperature;
- Change in current due to load.
- With neural network actuation:
- Change in current due to supply voltage;
- Change in current due to temperature;
- Change in current due to load.
Results
Results
Results
Results
Results
Results
Demo time
conclusions
Questions?
Thanks for your attention.
Diego Machado - dmachado.nasc@gmail.com
Gabriel Gosmann - gabriel.gosmann@gmail.com

Machine Learning applied to control systems

  • 1.
    MACHINE LEARNING APPLIEDTO CONTROL SYSTEMS F. E. T. LIBERATO SALZANO VIEIRA DA CUNHA ELECTRONICS TECHNICAL COURSE DIEGO MACHADO E GABRIEL GOSMANN ADVISOR: ANDERSON JEAN DE FARIAS #8 PORTO ALEGRE ML MEETUP
  • 2.
    Who are we Electronicsstudents at Fundação Liberato Technical School under internship; - Diego Machado dmachado.nasc@gmail.com - Gabriel Gosmann gabriel.gosmann@gmail.com github.com/Gosmann/machine_learning Major doubt between Electrical Engineering and Computer Engineering; - home workspace / electronics lab
  • 3.
    Introduction to theconcept - MIT OpenCourseWare Computer Science: Artificial Intelligence. 12a: Neural Nets by Patrick Winston “Then 2 years later Geoffrey Hinton, from the University of Toronto stunned the world with some neural net work he had done”.
  • 4.
  • 5.
    Introduction to theconcept 2016 201720132012 2017
  • 6.
  • 7.
    Introduction to theconcept - Deep Neural Networks features: - Can be applied to a wide range of problem domains; - Able to solve very complex problems; - An uncommon application of deep neural networks; - Interesting things can happen if a powerful tool is applied to different areas problems.
  • 8.
    Origin of theidea for TC - The first idea was developing an autonomous cooling tower system able to work regardless of changes in: - temperature; - pH; - conductivity; - turbidity; - toughness; - and and many other parameters; - Automation Professor as Advisor: Anderson Jean de Farias;
  • 9.
    Origin of theidea for TC - temperature - pH - conductivity - turbidity - toughness - valve state - pump flow just a code illustration
  • 10.
    Origin of theidea for TC - Definitely would be a multivariable control system; - Interest on the concept of AI; - Changed the project to: “how to apply deep neural networks to control multivariable systems?”
  • 11.
    Introduction to artificialneural networks - Artificial Neural Network: computational model of the biological brain; - Simple way to solve complex problems; - Function approximation: saída = f(entradas, pesos, função de transferência) Source: Tafner (1998).
  • 12.
    Introduction to artificialneural networks - Neural network: net of interlinked neurons; - Deep Neural Network: one or more hidden layers; - Able to recognize very complex patterns; Source: Magri (1998).
  • 13.
    Backpropagation - Training theneural network to match the dataset: - How to adjust the weights so that the output matches the dataset? - Gradient descent: Steepest path; - Cost functions: error = (ANN output – dataset output)².
  • 14.
    Genetic Algorithm - Mathematicalfunctions optimization algorithm: - Based on natural selection. - Changes synaptic weights randomly; - Ex.: peso sináptico novo = peso sináptico antigo X valor aleatório. - Generation: group of different ANN; - Crossover: develop new generations from the best previous; - Mutation: apply random values to synaptic weights.
  • 15.
  • 16.
    Machine Learning? - TheANN is able to generalize the pattern; - “Inductive reasoning is the derivation of general principles from specific observations”; error (%) iterations
  • 17.
    Machine Learning? - Demandsexternal interpretations; - Confusion between mind and computing - mind theory; - Application of this very useful tool.
  • 18.
    Introduction to controlsystems - “Interconnection of components that cause parameter correction” - SISO: single in, single out - Temperature control - ON/OFF Source: Eurotherm.
  • 19.
    Introduction to controlsystems - “Interconnection of components that cause parameter correction” - SISO: single in, single out - only one input parameter has to be taken in consideration control the output; - temperature control - PID Source: West Control Solutions.
  • 20.
    Introduction to controlsystems - “Interconnection of components that cause parameter correction” - MISO: multiple in, single out: - more than one input interferes on the control of one output; - control of numerous chemical process;
  • 21.
    Introduction to controlsystems - MIMO: multiple in, multiple out - Input: - Angles: x, y, z; - Acceleration: vectorial sum; - Output: - Position of the aileron; - Position of the rudder; Source: Advanced Control Systems – University of Melbourne.
  • 22.
    Introduction to controlsystems - Practical application: - More than one simultaneous controller; - Mathematical modeling; - Hard multivariable calculus: - Transfer function equations of all variables; - Hard coefficient tuning; - “There is a function that describes the mathematical model of the system” Source: Advanced Control Systems – University of Melbourne.
  • 23.
    Introduction to controlsystems - Analog to the development of computer vision Source: TUTORIAL DE VERÃO DEEP LEARNING (2017)
  • 24.
    Method - Part 1:Observation: - Obtain the data;
  • 25.
    Method - Part 2:Training: - Backpropagation and genetic algorithms;
  • 26.
    Method - Part 3:Application; - Automated system;
  • 27.
    The current source -Electronics circuit that delivers a constant amount of current regardless of the load; - The aim is making the current constant despite of variations in: - Temperature (ºC); - Supply voltage (V); - Load changes (Ω);
  • 28.
  • 29.
    Resources - digital potentiometer:MAX5481 - analog to digital converter: MCP3428; - raspberry Pi 3B; - raspbian Jessie Linux; - python 2.7; - pyBrain; - pigpio;
  • 30.
    Resources - digital potentiometer:MAX5481 - interface SPI; - 10 bits, 1024 posições; - saída de alta impedância; Source: MAXIM INTEGRATED (2010)
  • 31.
    Resources - analog todigital converter: MCP3428 - 4 canais diferenciais; - ganho programável; - interface I²C; - 16 bits, 15 SPS; Source: MICROCHIP (2009)
  • 32.
    The current source -changes in temperature: Source: MARQUES (2002)
  • 33.
    The current source -changes in supply voltage: - V B depends on VH and on the position of the potentiometer; - VCC = 20V → VH = 5,08V → 5,08V > VW > 0V - VCC = 8V → VH = 2,03V → 2,03V > VW > 0V
  • 34.
    The current source -changes on the load: - indirectly leads to changes in temperature due to difference in power dissipation: - RL = 10Ω → 613mW - RL = 60Ω → 113mW - gradual and slow change;
  • 35.
    The current source -training from correct examples; - gather data from an empiric dataset: - supply voltage: 8V, 12V, 16V, 20V; - load: 10Ω, 33Ω, 43Ω, 50Ω, 60Ω; - temperature: 20ºC, 30ºC, 90ºC.
  • 36.
    The current source -training from correct examples; - application of the developed method: alternating between backpropagation and genetic algorithm. GENERATION
  • 37.
    The current source -practical application; - input variables: - VCC (V): supply voltage; - VBE (V): temperature; - VCE (V): load; - the input will be calculated and applied to the transistor’s base.
  • 38.
    The current source -We isolated the variables to favor comprehension: - Fixed potentiometer: - Change in current due to supply voltage; - Change in current due to temperature; - Change in current due to load. - With neural network actuation: - Change in current due to supply voltage; - Change in current due to temperature; - Change in current due to load.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
    Questions? Thanks for yourattention. Diego Machado - dmachado.nasc@gmail.com Gabriel Gosmann - gabriel.gosmann@gmail.com