Skip to content

Commit

Permalink
Merge branch 'release/v0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehaenger committed Nov 27, 2022
2 parents d9b4839 + f62cb9e commit f19f483
Show file tree
Hide file tree
Showing 37 changed files with 5,135 additions and 594 deletions.
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!--
## [Unreleased]
### Added
### Removed
- tbd
- something from [@someone](https://github.com/someone).
-->

## [0.5.0] - 2022-11-27

### Added

- Added [PID Tuner](https://pidtuner.com) output
- Added average temperatures for more stable temperature display/handling
- Added "Max. Temp" setting (which is required for PID Tuner steps)
- Added Changelog

### Changed

- Enlarged PID constant length from 3 to 4 int digits
- Improved some internal var names
- Optimized Thermocouple class and implemented average temperature
- Moved profile handling into a separate class
- Resturctured handling of objects via globals (instead of space wasting pointer/reference parameter)
- Changed initial PID-Tuner wait time and saved some resources

### Fixed

- Fixed possibliy wrong PID derivate calculation as discussed [here](https://github.com/r-downing/AutoPID/issues/4)


## [0.4.0] - 2022-11-08

### Added

- "Manual" or (open-end) "Reflow-Profile" Mode
- Reflow profiles for (low temp.) "Sn42/Bi57.6/Ag0.4" as well as (high temp.) "Sn96.5/Ag3.0/Cu0"

### Changed

- Moved most code into separate classes for higher flexibility and safer var/pointers
- Stripped down fonts, to get some more flash space

## 0.3.0 - 2022-10-26

### Added

- Built-in Setup
- Adjustabled PID constants
- BangON and BangOFF values
- Config storage into EEPROM

[unreleased]: https://github.com/Apehaenger/Another-HotPlate-Firmware/compare/v0.5.0...develop
[0.5.0]: https://github.com/Apehaenger/Another-HotPlate-Firmware/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/Apehaenger/Another-HotPlate-Firmware/releases/v0.4.0
80 changes: 52 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,58 @@ As we all have some kind of fetish, and mine seem to be that I tend to over-opti

## Features

- Built-in "Setup" within Hot-Plate user interface
### Setup

![Built-in Setup](assets/images/Setup-1.jpg)
Built-in "Setup" within Hot-Plate user interface

- "Manual" or (open-end) "Reflow-Profile" Mode, with built-in reflow profiles for low-temp. solder paste Sn42/Bi57.6/Ag0.4, as well as high-temp. Sn96.5/Ag3.0/Cu0. After (as well as during) the reflow profile time targets, the user may adapt the target temp. (every 10 seconds). At profile end, the last target temp remain active and the user has to stop the profile manually when everything reflowed correctly.
![Built-in Setup](assets/images/Setup-1.jpg)

![Reflow Profiles](assets/images/ReflowProfiles.jpg)
![Running Reflow Profile](assets/images/ReflowProfile-1.jpg)
### Reflow Profile

- PID constant settings (within built-in setup)
"Manual" or (open-end) "Reflow-Profile" Mode, with built-in reflow profiles for low-temp. solder paste Sn42/Bi57.6/Ag0.4, as well as high-temp. Sn96.5/Ag3.0/Cu0. After (as well as during) the reflow profile time targets, the user may adapt the target temp. (every 10 seconds). At profile end, the last target temp remain active and the user has to stop the profile manually when everything reflowed correctly.

![Setup PID constant Kp](assets/images/Setup-PID.jpg)
![Setup PID constant Kd](assets/images/Setup-PID-Kd.jpg)
![Setup PID constant Ki](assets/images/Setup-PID-Ki.jpg)
![Reflow Profiles](assets/images/ReflowProfiles.jpg)
![Reflow Profile Start](assets/images/ReflowProfile-Start.jpg)
![Running Reflow Profile](assets/images/ReflowProfile-1.jpg)

- BangON/BangOFF (quick start) settings and functionality. Mainly for bad/non-configuraed PID controller constants (a good configured PID controller normally does not need BangON/BangOFF, but PID controller constant determination is complicated and time consuming)
### [PID Tuner](https://pidtuner.com) support

![Setup BangON](assets/images/Setup-BangON.jpg)
![Setup BangOFF](assets/images/Setup-BangOFF.jpg)
Simply start an automatic [step response](https://en.wikipedia.org/wiki/Step_response) run, with a connected serial console.
Afterwards copy the resulting data into [PID Tuner](https://pidtuner.com) and (auto-)tune your PID constants.
BTW: This step response can also be used to determine the overshot of the tuned target temperatures which might be used (at least as indication) for the [BangON](#bangonbangoff) setting.

- SSR type (active-low/high) configurable within buit-in setup
![Setup BangON](assets/images/PIDTuner-Start.jpg)
![Setup BangOFF](assets/images/PIDTuner-Heat.jpg)
![Setup BangOFF](assets/images/PIDTuner-Settle.jpg)
![Setup BangOFF](assets/images/PIDTuner-Output-1.jpg)

![Setup SSR Type](assets/images/Setup-SSR.jpg)
### PID constants

- Save of settings to EEPROM possible within built-in setup
Either you know your PID constants, evaluate them the hard way "by hand" or use [PID Tuner support](#pid-tuner-support) for assistance in PID constant determination.

![Setup Save](assets/images/Setup-Save.jpg)
![Setup PID constant Kp](assets/images/Setup-PID-Kp.jpg)
![Setup PID constant Kd](assets/images/Setup-PID-Kd.jpg)
![Setup PID constant Ki](assets/images/Setup-PID-Ki.jpg)

### BangON/BangOff

Quick start/Overshoot reduction settings and functionality. Mainly for bad/non-configuraed PID controller constants.
A good configured PID controller normally does not need BangON/BangOFF, but PID controller constant determination is complicated and time consuming. See [PID Tuner support](#pid-tuner-support) for assistance in PID constant determination.

![Setup BangON](assets/images/Setup-BangON.jpg)
![Setup BangOFF](assets/images/Setup-BangOFF.jpg)

### SSR type

Active-low/high configurable within buit-in setup

![Setup SSR Type](assets/images/Setup-SSR.jpg)

### Save

Save of settings to EEPROM possible within built-in setup

![Setup Save](assets/images/Setup-Save.jpg)

## Requirements

Expand All @@ -63,16 +88,16 @@ Assembled DIY Hot Plate like described in "[Tim's Hot Plate](https://www.instruc

## Roadmap

- [ ] Step response output for easier PID constant determination by the help of [PID Tuner](https://pidtuner.com)
- [X] Step response output for easier PID constant determination by the help of [PID Tuner](https://pidtuner.com)
- [ ] Some kind of PID loop tuning/calibration
- [ ] Ramp-up determination to identify PTC time and TC delay (BangON calibration)
- [X] Ramp-up determination to identify ~~PTC time and TC delay~~ (BangON calibration)
- [ ] Progressive rotary switching for quicker +/- move
- [ ] C/F unit selection (if someone is interested in)
- [ ] Larger display so that I don't need my glasses (old man wish)

## Known Bugs/Issues

- I've the impression that the Ki constant of the (currently) used [AutoPID](https://r-downing.github.io/AutoPID/) doesn't behave as expected. Will revalidate later ...
- [X] I've the impression that the Ki constant of the (currently) used [AutoPID](https://r-downing.github.io/AutoPID/) doesn't behave as expected -> Now fixed

## Technology

Expand All @@ -81,37 +106,36 @@ The code structure is [PlatformIO/VSCode](https://platformio.org/) based (no Ard
## Installing

1. Upload .hex or .elf file WITHOUT HAVING AC-MAINS CONNECTED
2. Long-press (> 0.5s) to get into built-in setup
3. Choose "SSR Type"
4. Select your SSR type (Active-Low/High). In the case of [Tim's Hot Plate](https://www.instructables.com/Tims-Hot-Plate/) it will be "Active-Low"
5. Choose "Save & Quit"
6. Plug-in AC-Mains. Happy reflow soldering...

1. Long-press (> 0.5s) to get into built-in setup
1. Choose "SSR Type"
1. Select your SSR type (Active-Low/High). In the case of [Tim's Hot Plate](https://www.instructables.com/Tims-Hot-Plate/) it will be "Active-Low"
1. Choose "Save & Quit"
1. Plug-in AC-Mains. Happy reflow soldering...

## Usage

- Rotate knob for +/- or up/down
- Push knob to stop (or start profile if it's displayed on screen)
- Long-Push (> 0.5s) to get into built-in setup


## Built With

* [Tim's Hot Plate](https://www.instructables.com/Tims-Hot-Plate/) - Quite cool DIY reflow Hot Plate Project @ Instructables
* [U8g2](https://github.com/olikraus/u8g2) - Excellent and powerful Library for monochrome displays, version 2
* [MAX6675](https://github.com/adafruit/MAX6675-library) - Arduino library for interfacing with MAX6675 thermocouple amplifier
* [CRC32](https://github.com/bakercp/CRC32) - An Arduino library for calculating a CRC32 checksum
* [AutoPID](https://github.com/r-downing/AutoPID) - Fairly good documented (as well as feature rich and small) Arduino AutoPID library
* [PID Tuner](https://pidtuner.com) - Will help you to finde reasonable PID constants

## Contributing

Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## Versioning

<!-- FIXME -->
We use [SemVer](http://semver.org/) for versioning.

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/Apehaenger/Another-HotPlate-Firmware/tags).
For the versions available, please see [changelog](CHANGELOG.md) file or the [tags on this repository](https://github.com/Apehaenger/Another-HotPlate-Firmware/tags).

## Authors

Expand Down
28 changes: 28 additions & 0 deletions _remarks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Internal C/C++ remarks

## When to pass by value, by pointer or by reference

http://www.cplusplus.com/articles/z6vU7k9E/ says:

1. Pass by value when the function does not want to modify the parameter and the value is easy to copy (ints, doubles, char, bool, etc... simple types. std::string, std::vector, and all other STL containers are NOT simple types.)

2. Pass by const pointer when the value is expensive to copy AND the function does not want to modify the value pointed to AND NULL is a valid, expected value that the function handles.

3. Pass by non-const pointer when the value is expensive to copy AND the function wants to modify the value pointed to AND NULL is a valid, expected value that the function handles.

4. Pass by const reference when the value is expensive to copy AND the function does not want to modify the value referred to AND NULL would not be a valid value if a pointer was used instead.

5. Pass by non-cont reference when the value is expensive to copy AND the function wants to modify the value referred to AND NULL would not be a valid value if a pointer was used instead.

6. When writing template functions, there isn't a clear-cut answer because there are a few tradeoffs to consider that are beyond the scope of this discussion, but suffice it to say that most template functions take their parameters by value or (const) reference, however because iterator syntax is similar to that of pointers (asterisk to "dereference"), any template function that expects iterators as arguments will also by default accept pointers as well (and not check for NULL since the NULL iterator concept has a different syntax).

Whereas https://www.geeksforgeeks.org/passing-by-pointer-vs-passing-by-reference-in-c/ states:

- References are usually preferred over pointers whenever we don’t need “reseating”.
- Overall, Use references when you can, and pointers when you have to. But if we want to write C code that compiles with both C and a C++ compiler, you’ll have to restrict yourself to using pointers.

Also: Allen Holub's "Enough Rope to Shoot Yourself in the Foot" lists the following 2 rules:
```
120. Reference arguments should always be `const`
121. Never use references as outputs, use pointers
```
Loading

0 comments on commit f19f483

Please sign in to comment.