Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Temperature controlling, easy way. It uses an improved PID algorithm to decrease overshoots and regulate based on continued inputs.
Add this line to your application's Gemfile:
gem 'pidom'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pidom
To start, create an instance of Pidom::PID. The PID algorithm can be configured with
custom minimum and maximum values for ease of integration with external control systems
(PWM-controlled heating elements, for example). Once created, run Pidom::PID#control
in your control loop, feeding it sensor data.
All thanks to
http://brettbeauregard.com/blog/category/pid/
Also:
https://controlguru.com/pid-control-and-derivative-on-measurement/
The algorithm being used is minimum interval and will not recalibrate until the time interval
has passed before recalibrating. This helps mitigate excess compensation and inconsistent
adjustment. The update interval is also configurable in Pidom with the interval
option.
When handling cooling-based temperature control, negative values are a pain for
translation. To assist with this, Pidom uses a directional control parameter. The two
possible states are :direct
and :reverse
. When using :reverse
, negative values
are inverted.
Pidom's PID is manually tuned with the tune
method, which takes a Kp, Ki, and Kd value. By
default, Pidom will set them to 1.0. Pidom::PID
also can take the kp, ki, and kd options
in the constructor call.
require 'pidom'
pidom = Pidom::PID.new(interval: 1000, minimum: 0, maximum: 1000, direction: :direct)
pidom.tune(9.0, 25.0, 6.0) # Set Kp, Ki, and Kd
pidom.setpoint = 100.0 # Set target temperature
while input = read_sensor() # Replace read_sensor with your external system
output = pidom.control(input)
# output is a value betwen minimum and maximum. This can be used for thresholds or
# PWM-based control
end
For more examples check out the examples directory.
This is a rewrite of 'temper-control' gem with PonM algorithm.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that pidom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.