Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IronOS
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Archive
IronOS
Commits
5b882c81
Commit
5b882c81
authored
6 years ago
by
Ben V. Brown
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://github.com/Ralim/ts100
parents
d5beab76
4b539f09
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
workspace/TS100/src/main.cpp
+54
-48
54 additions, 48 deletions
workspace/TS100/src/main.cpp
workspace/TS100/src/power.cpp
+3
-1
3 additions, 1 deletion
workspace/TS100/src/power.cpp
with
57 additions
and
49 deletions
workspace/TS100/src/main.cpp
+
54
−
48
View file @
5b882c81
...
...
@@ -803,7 +803,8 @@ void startGUITask(void const *argument __unused) {
#ifdef MODEL_TS80
//Here we re-check for tip presence
if
(
idealQCVoltage
<
90
)
idealQCVoltage
=
calculateMaxVoltage
(
systemSettings
.
cutoutSetting
);
idealQCVoltage
=
calculateMaxVoltage
(
systemSettings
.
cutoutSetting
);
seekQC
(
idealQCVoltage
,
systemSettings
.
voltageDiv
);
#endif
gui_solderingMode
(
0
);
// enter soldering mode
...
...
@@ -943,7 +944,8 @@ void startPIDTask(void const *argument __unused) {
// to be unstable. Use a rolling average to dampen it.
// We overshoot by roughly 1/2 of 1 degree Fahrenheit.
// This helps stabilize the display.
int32_t
tError
=
currentlyActiveTemperatureTarget
-
rawTemp
+
rawC
/
4
;
int32_t
tError
=
currentlyActiveTemperatureTarget
-
rawTemp
+
rawC
/
4
;
tError
=
tError
>
INT16_MAX
?
INT16_MAX
:
tError
;
tError
=
tError
<
INT16_MIN
?
INT16_MIN
:
tError
;
tempError
.
update
(
tError
);
...
...
@@ -954,17 +956,21 @@ void startPIDTask(void const *argument __unused) {
// P term - total power needed to hit target temp next cycle.
// thermal mass = 1690 milliJ/*C for my tip.
// = Watts*Seconds to raise Temp from room temp to +100*C, divided by 100*C.
// divided by 20 to let I term dominate near set point.
// I should retune this, but don't want to do it until
// the feed-forward temp adjustment is in place.
// we divide milliWattsNeeded by 20 to let the I term dominate near the set point.
// This is necessary because of the temp noise and thermal lag in the system.
// Once we have feed-forward temp estimation we should be able to better tune this.
#ifdef MODEL_TS100
const
uint16_t
mass
=
1690
/
20
;
const
uint16_t
mass
=
1690
/
20
;
// divide here so division is compile-time.
#endif
#ifdef MODEL_TS80
const
uint16_t
mass
=
1690
/
50
;
#endif
int32_t
milliWattsNeeded
=
tempToMilliWatts
(
tempError
.
average
(),
mass
,
rawC
);
int32_t
milliWattsNeeded
=
tempToMilliWatts
(
tempError
.
average
(),
mass
,
rawC
);
// note that milliWattsNeeded is sometimes negative, this counters overshoot
// from I term's inertia.
milliWattsOut
+=
milliWattsNeeded
;
// I term - energy needed to compensate for heat loss.
...
...
This diff is collapsed.
Click to expand it.
workspace/TS100/src/power.cpp
+
3
−
1
View file @
5b882c81
...
...
@@ -17,6 +17,8 @@ history<uint16_t, oscillationPeriod> milliWattHistory = {{0}, 0, 0};
int32_t
tempToMilliWatts
(
int32_t
rawTemp
,
uint16_t
mass
,
uint8_t
rawC
)
{
// mass is in milliJ/*C, rawC is raw per degree C
// returns milliWatts needed to raise/lower a mass by rawTemp
// degrees in one cycle.
int32_t
milliJoules
=
mass
*
rawTemp
/
rawC
;
return
milliJoules
*
hz
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment