-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
softPwm --> ledcWrite #33
Comments
i just put the ledcWrite in the tuner.sample, as it runs every n'th time (testTime/SampleTime?). then, the tuner.tunings is ran after it completes. but i was doing just simple inflection point with a step output. In your question, the output is shown as it is outputspan * 0.1. Als, there is 0.5f in the tunePlotter. You could do: in the tuner.sample: Simply in arduino language: tuner.sample is the loop() and tuner.tunings is the setup() of your code after loop has been ran, so it kind of runs backwards so to speak, first loop then setup.. which is left for the new code with new tunings. `void Battery::runTune() {
|
Hi.
In my application I am using a ESP32 driving a thrystor using 8 bit PWM. According to the manufacturer the minimum PWM frequency should be 1kHz. Using softPwm, this would mean the windowSize should be < 1 (since millis is used). Since in the .cpp, time variables are uint32_t, the maximum frequency using softPwm would be 1kHz, right?
Then what I don't understand is what would happen with the following MAX31856 example:
`void loop() {
float optimumOutput = tuner.softPwm(relayPin, Input, Output, Setpoint, outputSpan, debounce);
switch (tuner.Run()) {
case tuner.sample: // active once per sample during test
if (!digitalRead(drdyPin)) Input = maxthermo.readThermocoupleTemperature();
tuner.plotter(Input, Output, Setpoint, 0.5f, 3); // output scale 0.5, plot every 3rd sample
break;
...`
because when I set outputSpan = 1 (to get the necesarry 1kHz frequency of the PWM) then the PID output will be limited to a max of 0.1.
Would using a function like ledcWrite, which allows frequency to be specified, help solve this issue?
The text was updated successfully, but these errors were encountered: