My original hotwire controller design was my first real embedded systems project and had several shortcomings as a result. The goal of this "lite" project was to design and build the cheapest version of the original project while significantly improving its performance.
(The original project has some nice pictures of the project in action.)
- The power, LCD, and PID settings were never changed after finding the right values.
- The rotary encoder was a bit delicate when wearing gloves.
- The circuit was erroneously running at 244Hz PWM and 14Hz PID rates and took several seconds to settle.
| Cost (single) | Original Hotwire | Hotwire Lite |
|---|---|---|
| PCB | $5 (ALLPCB) | $5 (PCBWay) |
| Electrical | ~$38 | $5.18 |
| Mechanical | ~$20 | $0 |
| Total cost | ~$63 | $10.18 |
| Bulk cost (100) | ? | $3.71 |
| PCB assembly time | 1-1.5 hours | <20 minutes |
| Machining time | 2-3 hours | N/A |
| Manufacturing Ease | Original Hotwire | Hotwire Lite |
|---|---|---|
| # SMD | 33 | 19 |
| # PTH | 8 | 0 |
| Screws | Yes | No |
| Machining required | Yes | No |
| Performance | Original Hotwire | Hotwire Lite |
|---|---|---|
| Output accuracy @ 25W | -4.6% | 0.08% |
| Settling time | ~8 seconds | milliseconds |
| PWM frequency | 244Hz | 1024Hz |
| Control loop frequency | 14Hz | 1KHz |
| Calibration | No | Yes |
| Data output | No | Yes |
The PID controller needs to know the average current running through the wire to effectively control the power output. The output is really a square wave, so there needs to be some filtering to find the average. The original controller did this in hardware with an expensive and bulky RC filter network. The new circuit performs this in a clever manner. Instead of free running the ADC and measuring the entire signal, the ADC is trigged only on the rising edge of the PWM signal. Therefore, the ADC only ever measures the maximum current in the circuit. Multiplying this number by the duty cycle results in the average current. This operation is be performed much faster than the old circuit (1KHz vs. 14Hz).
Being the first circuit I ever made, the original controller was over-engineered a bit. It used expensive components with great specifications, even if the circuit didn't really need it. The new controller uses the right components, trading off unused performance for lower cost.
The circuit continuously streams its current and voltage measurements over UART at a 1MHz buad.
The format of the data is a comma-separated list formatted like so: voltage,current,power,duty_cycle.
The units are mV,mA,mW,%*1000.
The circuit can be calibrated over UART using a very basic, lightweight interface. The user just needs to send a three character command over the UART interface, which currently runs at 500k buad.
C00-C99: calibrate the voltage divider to account for resistor tolerance. C50 is for ideal resistors.
P00-P99: set the power output, where the two digit number is the output in watts (P15 = 15W output).
The resistor calibration is performed by measuring the true output voltage, reading the measured voltage over UART, and performing the following calculation:
resistor_divider = vcc_true / vcc_measured / 3
C_value = round(resistor_divider - 2.50, 2) * 100
calibration command = "C{C_value}"Alternatively, manipulate the C value until the controller is outputting the correct power to the desired accuracy.
vcc_true = 13.993 // the voltage as measured by the multimeter
vcc_measured = 13.881 // the voltage as output over UART
resistor_divider = 13.993 / 13.881 / 3 = 3.024
C_value = round(3.024 - 2.50, 2) * 100 = 52
calibration command: "C52"


