Adaptive Control Continued
The file W-VectorComparisons.xlsx compares the W vectors from previous runs of the adaptive control algorithm. Note that curve for W10a is different from the curves of W10b and W10c. Recall that W10a was the R100k_C10uf sampled at 500ms intervals.
W10b was the R100k_C50uf sampled at 500ms intervals and W10c was the R100k_C10uf sampled at 100ms intervals.
The attached code Acontrol2.js makes use the W10c vector data to preload the control algorithm. The program is setup to run continuously until the variable “stop” is set to a non-zero value. The variable “setpoint” can be changed as well. The console displays the values. The variable sample_interval should be changed to match the RC circuit.
@allObjects has mentioned in another thread that WebIDE has a graphing feature that can be turned on. If you are not familiar with it, access the WebIDE setups using the “gear” icon in the upper left and select testing. Try the tutorial.
For use with Acontrol2.js, the WebIDE testing settings are as follows:
Plots
,
out, A.outputY
SP, setpoint
inp, inp
At the bottom add
setpoint,setpoint,Number
Stop,stop,Number
In the properties
Interval 0.5
Make setpoint changes as it is running and observe
Try it with the 100k_C50uF low pass filter.
It doesn’t work as well with the 100k_C10uF low pass filter with both the code and the WebIDE intervals changed to 100ms. It works at first but the control seems to stop after a bit. Something about the interface between the two stops working.
Remaining questions:
What is the optimum length of the adaptive vectors X, Y and W ?
In the initial program the process was stepped from 0 to 1 and the inverse transfer function was acquired. What happens is the step was from 0 to 0.5 instead? Would it be better to do a series of steps up and down?
What happens with a second order low pass filter? (Two resistors and two capacitors)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Adaptive Control Continued
The file W-VectorComparisons.xlsx compares the W vectors from previous runs of the adaptive control algorithm. Note that curve for W10a is different from the curves of W10b and W10c. Recall that W10a was the R100k_C10uf sampled at 500ms intervals.
W10b was the R100k_C50uf sampled at 500ms intervals and W10c was the R100k_C10uf sampled at 100ms intervals.
The attached code Acontrol2.js makes use the W10c vector data to preload the control algorithm. The program is setup to run continuously until the variable “stop” is set to a non-zero value. The variable “setpoint” can be changed as well. The console displays the values. The variable sample_interval should be changed to match the RC circuit.
@allObjects has mentioned in another thread that WebIDE has a graphing feature that can be turned on. If you are not familiar with it, access the WebIDE setups using the “gear” icon in the upper left and select testing. Try the tutorial.
For use with Acontrol2.js, the WebIDE testing settings are as follows:
Plots
,
out, A.outputY
SP, setpoint
inp, inp
At the bottom add
setpoint,setpoint,Number
Stop,stop,Number
In the properties
Interval 0.5
Make setpoint changes as it is running and observe
Try it with the 100k_C50uF low pass filter.
It doesn’t work as well with the 100k_C10uF low pass filter with both the code and the WebIDE intervals changed to 100ms. It works at first but the control seems to stop after a bit. Something about the interface between the two stops working.
Remaining questions:
What is the optimum length of the adaptive vectors X, Y and W ?
In the initial program the process was stepped from 0 to 1 and the inverse transfer function was acquired. What happens is the step was from 0 to 0.5 instead? Would it be better to do a series of steps up and down?
What happens with a second order low pass filter? (Two resistors and two capacitors)
2 Attachments