Deadband | Arduino library to stabilize noisy analog inputs

 by   cellularmitosis C++ Version: Current License: MIT

kandi X-RAY | Deadband Summary

kandi X-RAY | Deadband Summary

Deadband is a C++ library typically used in Internet of Things (IoT), Arduino applications. Deadband has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

An Arduino library to stabilize noisy analog inputs by giving them deadband (sometimes called hysteresis). Installation: Drag the Deadband folder into $HOME/Documents/Arduino/libraries/, and then restart Arduino.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Deadband has a low active ecosystem.
              It has 3 star(s) with 0 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              Deadband has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of Deadband is current.

            kandi-Quality Quality

              Deadband has 0 bugs and 0 code smells.

            kandi-Security Security

              Deadband has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Deadband code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Deadband is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Deadband releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Deadband
            Get all kandi verified functions for this library.

            Deadband Key Features

            No Key Features are available at this moment for Deadband.

            Deadband Examples and Code Snippets

            No Code Snippets are available at this moment for Deadband.

            Community Discussions

            QUESTION

            How to loop through complex JSON in Python 3.x
            Asked 2022-Jan-03 at 20:49

            Currently, I'm building a dashboard for my home where I get temperature values from the Honeywell API. I'm trying to loop through a complex JSON that I got from the API to get all the device current temperatures.

            Since I'm quite new to Python I have no clue how to get this sorted. Here is an example response:

            ...

            ANSWER

            Answered 2022-Jan-03 at 20:35

            Looks like you've got a list containing one big dictionary. That dictionary has a devices key-value pair, where the value is a list of dictionaries, one for each device. If data is your JSON structure, you can iterate through the device-dictionaries in the following way:

            Source https://stackoverflow.com/questions/70571005

            QUESTION

            How to adjust the parameters to achieve which MV has more action?
            Asked 2021-Nov-14 at 13:05

            I use Q1 and Q2 to control T1, so as to realize the simulation scenario of multi-controls. I want to adjust the parameters to achieve which MV has more action, as shown in the figure. I found that I couldn’t achieve the effect I wanted by adjusting the cost of the MV, can anyone give me some suggestions? thanks!

            Here is my code:

            ...

            ANSWER

            Answered 2021-Nov-14 at 13:05

            There are a many ways to preferentially select one MV over another with additional resources on the course website with Control Objectives and Control Tuning.

            • COST (minimize or maximize use of MV)
            • DCOST (change penalty)
            • DMAX (move change constraint)
            • TIER (for strong decoupling)

            For this particular problem, it appears that the two MVs (Manipulated Variables) Q1 and Q2 values should be a ratio and there is only one CV (Controlled Variable). An easy way to accomplish this is to add another equation such as:

            Source https://stackoverflow.com/questions/69922735

            QUESTION

            MEAS of MV when fstatus=1
            Asked 2021-Sep-03 at 18:20

            everyone and Professor John

            We are using gekko to do MPC on tclab simulation model. We try to emulate the situation that on site the actuator deviates from MV calculated by gekko because of the problems of actuator.

            If the deviation is in the fixed pattern, for example a quite big constant deviation happens for a long time and may come back then work well for a long time. We can deal with it by extra logic to detect deviation and add the deviation value to the mv calculated by gekko.

            one day, I noticed that there could be meas for MV when fstatus = 1. So I gave it a try. I hope gekko could deal with the deviation by itself. for example, if mv from gekko is 10 and the measurement is 5 and the pattern continues, gekko may spit out a higher MV value than 10, for example 15 and measurement is 10.

            In the simulation, when I set MV's fstatus=1, the MV's curve becomes to :

            q1a is the q1 with manual deviation. In the above pic, q1a == q1. It looks like gekko takes one more step thinking about the MV's effect.

            In the below pic, there are two times range, one with "q1a == q1+20" and the other with "q1a == q1 -20". q1a's value is fed to tclab and mv(q1)'s meas.

            I do not understand why the q1 calculated by gekko is going up or going down when meas deviates despite the t1 is going far away from sp.

            Edit: Example Code

            See the screen shot below from "normal" HMI. The sluggish MV disappeared, so it maybe caused by bug in my code. But the up-going or down-going could still be seen. See my code below:

            ...

            ANSWER

            Answered 2021-Sep-03 at 18:20

            Is the FSTATUS also ON for the CVs such as t1.FSTATUS=1? If you update the measurement such as:

            Source https://stackoverflow.com/questions/69026508

            QUESTION

            OPC DA Client - Unable to assign item.Value to VBA variable
            Asked 2021-May-26 at 15:23

            Below is an OPC Client written in VBA. It is using the OPC Foundation DA libraries. I am able to get the current value of the item (I can read it in locals window), but it is not assigning the value to myValue = theItem.Value Hovering over theItem.Value during a break shows the value as well.

            Any thoughts?

            ...

            ANSWER

            Answered 2021-May-26 at 15:23

            After review/trouble shooting.

            The OPCItem object provides methods to read the current value of the item in the server and write a new value to the item. I have included these facilities into this dialog. The read method provided on an OPCItem object performs a synchronous read from the server and can be configured to read either from cache or from the device. To read from cache both the group and item should be active, but synchronous read operations directly from the device do not depend on the active state of either the group or item.

            Adding the following code allowed me to assign to variable.

            Source https://stackoverflow.com/questions/67697377

            QUESTION

            How to add time delay in state space model
            Asked 2021-Mar-18 at 15:27

            I recently try to control my TCLab Arduino through a state space model. I refer to State Space Models and transform a first order linear system (without time delay) into state space form, the control effect is pretty good. Now I want to use first order plus dead time model to control the lab, but I don't know how to transform FOPDT model into state space form. How to add time delay in state space model?

            Here is the code:

            ...

            ANSWER

            Answered 2021-Mar-18 at 15:27

            Use the delay function in Gekko to add time delay. Here is an example. To add it to a state space model you can either delay the input mv or output cv. Here is the state space model with the delay on the output.

            Source https://stackoverflow.com/questions/66690029

            QUESTION

            Why the delay parameter affects the prediction curve?
            Asked 2021-Feb-23 at 15:17

            I put the result of Gekko's calculation into the queue, after a delay, write the first value of the queue to TCLab Arduino. I use this method to simulate a factory large time delay system, then I optimize Gekko parameters to achieve better control effect. When I add a delay=1 in the model, I got a pretty good prediction curve:

            The final control effect is also pretty good:

            But when I set delay=80, no other parameters are modified, the prediction curve is not ideal:

            The final control effect is also bad:

            Why the delay parameter affects the prediction curve? I think the reference trajectory should also shift with time delay. How could I solve this problem?

            Here is the code:

            ...

            ANSWER

            Answered 2021-Feb-23 at 15:17

            The controller is working as intended. The problem is a well-known issue with model mismatch and delay. Classical control methods are to use a Smith Predictor to compensate for the delay. With MPC, the delay is built into the model, similar to the function of the Smith Predictor. If you change the model to:

            Source https://stackoverflow.com/questions/66326361

            QUESTION

            How to avoid the actuator curve oscillation of large time delay system?
            Asked 2021-Jan-13 at 05:04

            I put the result of Gekko's calculation into the queue, after 80s, write the first value of the queue to TCLab Arduino. I use this method to simulate a factory large time delay system, then I optimize Gekko parameters to achieve better control effect. When I add a delay in the model, I got a oscillative curve:

            I adjust the DCOST and DMAX, then I got a better curve. But this is not an ideal curve.

            I think the ideal curve is like this curve.

            Here is the code.

            ...

            ANSWER

            Answered 2021-Jan-13 at 05:04

            If an MPC application is giving unexpected results, it can typically be diagnosed by showing the unbiased and biased model predictions and the reference trajectory. Here are a couple things that you should consider with you model.

            1. Change the equation to be in deviation variable form. The steady state point for temperature is TC1=TC1_ss and Q1d=0. The updated equation is:

            Source https://stackoverflow.com/questions/65664812

            QUESTION

            How to solve overshoot by tuning parameters with gekko?
            Asked 2020-Dec-19 at 12:36

            GEKKO is optimization software for mixed-integer and differential algebraic equations. It is coupled with large-scale solvers for linear, quadratic, nonlinear, and mixed integer programming (LP, QP, NLP, MILP, MINLP). I use gekko to control my TCLab Arduino, but when I give a disturbance, no matter how I adjust the parameters, there will be a overshoot temperature. How can I solve this problem?

            Here is my code:

            ...

            ANSWER

            Answered 2020-Dec-19 at 12:36

            When you add the disturbance (such as turn on the other heater), the apparent system gain increases because the temperature rises higher than anticipated by the controller. That means you start to go left on the mismatch plot (leads to worst control performance).

            This is Figure 14 in Hedengren, J. D., Eaton, A. N., Overview of Estimation Methods for Industrial Dynamic Systems, Optimization and Engineering, Springer, Vol 18 (1), 2017, pp. 155-178, DOI: 10.1007/s11081-015-9295-9.

            One of the reasons for the overshoot is because of model mismatch. Here are a few ways to deal with this:

            1. Increase your model gain K (maybe to 1) or decrease your model tau (maybe to 120) so that the controller becomes less aggressive. You may also want to re-identify your model so that it better reflects your TCLab system dynamics. Here is a tutorial on getting a first order or second order model. A higher order ARX model also works well for the TCLab.
            2. Change the reference trajectory to be less aggressive with TC.TAU=50 and include the reference trajectory on the plot so that you can observe what the controller is planning. I also like to include the unbiased model on the plot to show how the model is performing.
            3. Check out this Control Tuning page for help with other MV and CV tuning options. The Jupyter notebook widget can help give you an intuitive understanding of those options.

            Source https://stackoverflow.com/questions/65368005

            QUESTION

            Study live alerts resets initialized variables, but on historical data it works well
            Asked 2020-Jan-10 at 20:52

            Aiming to get alerts, only possible in Studies, I've created a Study from a Strategy where I purposely don't use pyramiding. Alerts are set to execute Once Per Bar Close.

            Because Studies don't have pyramiding options, I've programmed in the Study a similar functionality to avoid pyramiding as follows:

            1. Initialize boolean variables Last_is_long and Last_is_short to store whether the last move was a long or a short
            2. Check the boolean as part of the complete longCondition and as part of the complete shortCondition
            3. I make an alertcondition() based on such complete conditions, which include the booleans, thus

            Something like:

            ...

            ANSWER

            Answered 2020-Jan-09 at 22:17

            Your code logic seems sound and alerts work fine here. Perhaps you could try validating your states at your end using debugging code like the one included here:

            Source https://stackoverflow.com/questions/59672244

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Deadband

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/cellularmitosis/Deadband.git

          • CLI

            gh repo clone cellularmitosis/Deadband

          • sshUrl

            git@github.com:cellularmitosis/Deadband.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link