-
-
Notifications
You must be signed in to change notification settings - Fork 728
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
Pinecil v2 tune via PID #1827
Pinecil v2 tune via PID #1827
Conversation
Update BSP.cpp Update BSP.cpp
a9a190f
to
72e1a64
Compare
72e1a64
to
48fabbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@discip Still more to tune on this, but that will likely be 2.23 |
I',m speechless. Unfortunately not everything is covered by this as I've seen spikes of up to ~334°C (@ 320°C). |
I said I would get it eventually; life just got in the way. Finally trying to make back lost time. By speeding up the PID; I made the screen a little aggressive 🤣 So while I still stand by the idea of "dont filter out the real world" like some devices do, this makes a lot of sense. I've spotted the odd spike too, I need to look into them, I suspect its due to the a quirk with me skipping a cycle when the timer does weird things -- more debugging required to really know for certain. |
And if you use a median filter instead of a moving average? |
The type of filter in this instance wont really change things as the filter is really only going to average 1-2 readings at a time (and just saturate at the new reading between). The outliers mentioned above are real and are a quirk of supressing the adc cycle. I need to prevent the spike rather than filter it from view. |
moving average median filter |
I'm aware of how a median filter works, but its not the best solution as our data looks like:
As its called per gui redraw. I'll just focus on preventing the spike in the first place :) |
median filter sorted in ascending order and the middle is taken |
cfc134d
to
fc79154
Compare
@discip I've done a small tweak to hopefully reduce the spikes a little. @goga1978 |
Will do as soon as I'm back home. 😅 |
HI. The amplifier for the sting thermocouple. Connects to point A. Attention at SGM8557 - there is no protection of the entrance!!! Do not turn on without a sting!!! The output of the SGM8557 amplifier is connected to Tip_Sence. On the Tip_Sence pin there is a capacitor C22 with a capacity of 22000pf. So the first values in the interval between PWMs will be overestimated !!! |
HI. where is it set ? that only 4 temperature values will be recorded? |
how do I skip the first two values? And write down the following ? |
@goga1978 This is off topic to this PR, please use a suitable thread. The input to the op-amp is fine; the 100K resistor limits our current to 280uA max which is handled fine by the internal clamping diodes. As confirmed by manufacturer.
C22 is not a problem as we wait for the charge change before we start the ADC, and it helps keep readings stable while the ADC is charging its internal measurement cap. There is no requirement to discard readings. The delay is configured via the
In your IDE, if you look at references to the |
Ah, PineSAM is not affected by any GUI filtering I do. Bluetooth reads directly with no filters, so that its up to app developers how they want to handle that Dang on the spike still occuring. Ill spend a bit longer trying to reproduce them. |
Hi #define ADC_Filter_Smooth 1 /* This basically smooths over one PWM cycle / set of readings */ void switchToFastPWM(void) { // ~10Hz // Set divider to 10 ~= 10.5Hz tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 20); BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal); void switchToSlowPWM(void) { TIMER_SetCompValue(TIMER_CH0, TIMER_COMP_ID_2, totalPWM); // Set divider for ~ 5Hz uint32_t tmpVal = BL_RD_REG(TIMER_BASE, TIMER_TCDR); tmpVal = BL_SET_REG_BITS_VAL(tmpVal, TIMER_TCDR2, 20); BL_WR_REG(TIMER_BASE, TIMER_TCDR, tmpVal); I did so and it seems like the races were gone ))) |
I somehow assumed that to be the case. 😊
👍🏻 |
Basically, I've given up with the previous control scheme and have written a fairly trivial PID implementation and tuned it for my PinecilV2.
This includes:
#1824
#1688
What is the new behavior (if this is a feature change)?
Other information:
This still isnt perfect but for my testing is largely improved. Any testing would be highly appreciated. If you still get the large oscillations please let me know what tip + power supply is being used so I can attempt to replicate.