Implementation of a Fuzzy Logic-Based Embedded System for Engine RPM Control (Speed Control)
Introduction implements an embedded system for the Engine RPM control based on a development board developed around an Arduino Mega board fuzzy logic system as controller offers an easy understanding of the main concepts regarding embedded systems
System implementation Block diagram
DC-Motor: Gear ratio: 30:1 Free run speed at 6V: 1000RPM Free run current at 6V: 120mA Stall current at 6V: 1600mA
Hall Effect Sensor B [What is Hall Effect and How Hall Effect Sensors Work, https://www.youtube.com/watch?v=wpaa3qeoyii] The Hall effect: the production of a voltage difference (the Hall voltage) across an electrical conductor: transverse to an electric current in the conductor an applied magnetic field perpendicular to the current.
Hall Effect Sensor cont. [https://howtomechatronics.com/how -it-works/electrical-engineering/halleffect-hall-effect-sensors-work/]
Quadrature Encoder: Six pole magnetic disk +PCB Dual Channel 12 counts/revolution 2.8V -18V Output signal of the encoder
Motor Driver: L298 - Dual Full Bridge Driver (H bridge) Middle class 2 Motors Sensors power supply
Motor Driver: L298 - Dual Full Bridge Driver (H bridge) Middle class 2 Motors Sensors power supply How the RPM can be controlled?
Arduino Mega Pinout LCD screen
The Arduino Mega board is the brain of the entire system. It is primarily responsible for the update of the digital control signal u, at every time instance. The actual RPM, RPM k is read and the actual RPM error (err k ) and change of RPM error (cerr k ) are updated, as follows: err k = RPM k RPM ref cerr k = err k err k 1 where err k 1 is the RPM error in the previous time instance. The star of the entire system is the fuzzy logic controller, whose role is to infer the best modification in the control signal, in every time instance. The digital version of the actual control signal is updated using the relation: u k = u k 1 + Δu k
To obtain the actual RPM: RPM computation a method based on a fixed time interval (time window) to count the revolutions of the main motor shaft. a counter is triggered at the initial time t i and it counts the pulses received from the Hall effect sensor up to the final increment t f. The RPM is computed using the relation : C f - final value of the counter C i - initial value of the counter C r = 12 counts per revolution G r = 30, the gear ratio (30:1) t f, t i are measured in seconds RPM = 1000 60 C f C i t f t i 1 C r 1 G r
RPM computation C f - final value of the counter C i - initial value of the counter RPM = 1000 60 C f C i 1 1 C r = 12 counts per revolution t f t i C r G r G r = 30, the gear ratio (30:1) t f, t i are measured in milliseconds
first-order Takagi-Sugeno two inputs errfls and cerrfls one output ΔuFls The Fuzzy Logic Controller Fuzzy sets for the inputs Fuzzy sets for the output
Block diagram of the fuzzy logic controller errfls cerrfls Neg Zero Pos Neg N N Z Zero N Z P Pos Z P P Rule base of the fuzzy logic system
The defuzzification method, used to transform the partial output fuzzy sets resulted from the inference process into a crisp value is the weighted average method.
output Control surface of the fuzzy logic controller Err cerr
Control Circuit RPM ref + _ RPM err 1 z _ + cerr s e s c -1-1 +1 +1 errfls cerrfls Fuzzy logic system ΔuFls s u Δu - + 0 1 z 255 u Motor Driver u a DC Motor
System setup
Experimental results RPM from 0 to 1000 rise time = 8.8 s; max. positive error = 5 rpm ; max. negative error = 5rpm; RPM from 1000 to 500 fall time = 6.75 s; max. positive error = 6 rpm ; max. negative error = 9rpm; RPM from 500 to 750 rise time = 4.75 s; max. positive error = 8 rpm ; max. negative error = 6rpm; RPM from 750 to 0 fall time = 6.5 s;
Decreasing the time response To drastically decrease the time response of the control system, the control strategy should be slightly modified. Because the control characteristic of the DC motor driven by the H-Bridge is almost liner, when a large variation of the motor speed is required (larger than 60 rpm), the control signal is not determined by the fuzzy logic system, but it is estimated by a simple linear interpolation, that acts as a course adjustment of the control signal. Then, the fuzzy logic system regains its role for the fine adjustment of the speed.
Tracking mode operation: RPM tracks the temperature variation
Duty Cycle 23% Low Speed 55% Medium Speed 90% High Speed