inverter

code for an inverter controler
git clone git://git.yotsev.xyz/inverter.git
Log | Files | Refs | README | LICENSE

README.md (1440B)


      1 ## About
      2 
      3 This is a program for the Arduino Nano that generates control signals
      4 with power width modulation (pwm) for a simple inverter circuit.
      5 
      6 ## Installation
      7 
      8 Connect an Arduino nano with a USB cable and run
      9 
     10     make upload
     11 
     12 from the project directory.
     13 
     14 The project was created on Arch Linux with `Arduino.mk`. If you run it
     15 under a different operating system, you should change the paths in the
     16 Makefile. It uses half the baude rate because the nano I'm using has an
     17 older bootloader.
     18 
     19 ## Usage
     20 
     21 The builtin LED will flash while the board is calculating the time
     22 intervals of the pwm for the specified frequency.
     23 
     24 Here's a diagram of the circuit:
     25 
     26       ____________
     27      |   |        |
     28      |   p1       n1
     29      +   |        |
     30     bat  |--load--|
     31      -   |        |
     32      |   p2       n2
     33      |___|________|
     34 
     35 I didn't have four transistors of the same type.
     36 
     37 ## Specifics
     38 
     39 The code uses floats because on ATMEGA based boards doubles are the
     40 same as floats. I wanted to make that explicit. If your board supports
     41 doubles, you can change the base case in Converge() to get more
     42 accuracy. The limited accuracy of floats also restricts the resolution
     43 or how many distinct intervals can be calculated in a cycle. The higher
     44 the resolution, the smoother the modulation becomes. The default
     45 resolution is 220 roots in a cycles (219 intervals) and the maximum
     46 resolution that doesn't brake everything (on my nano) is 227.
     47 
     48 ## License
     49 
     50 GPLv2