This week I played with a few different processors and make a touch-screen interface for my punch press.
The touchscreen isn't quite as nice as a touchscreen you'd find on a smartphone (for one, it's not multi-touch) but it's remarkably capable given how inexpensive it is. The Pi is hooked up to the wifi so this setup also allows me to control the machine remotely from anywhere.
The code is here
This week I also decided I'd spend some time to learn about the PSoC family of microprocessors. I struggled a bit at first with their super cheap $4 kit. I kept getting a "Flash row is not valid for the selected array" error. From my reading online it seems the bootloader got in some strange state that can only be fixed with an external programmer. Not having that, I decided to check-out the slightly more kit-ed out prototyping kit: the PSoC pioneer. This one worked perfectly out of the box and I was up and running.
I got comfortable with modifying the example projects like reading capacitive slider to control LED's and added serial output:
I then wanted to put some of its internal FPGA architecture to the test by having it decode my quadrature encoder in hardware rather than software. It took me a little while to figure out how to switch the quadrature decoder to 32-bit but once I did, it worked great.
The "programming" was almost too easy. The image above plus a tiny 6-line main.c code and the quadrature decoding was working perfectly and outputing the data over serial.
Overall, I found the PSoC quite impressive. I'm not sure it'll replace my day-to-day microcontroller programming but it certainly has features that make it indispensible for high-bandwidth control of motors and things like that. My one big complaint is that, while there's lots of documentation, not all of it is helpful and there isn't yet an active forum community. It's sometimes hard to tweaze out what, I, the programmer is responsible for implementing, versus what it does automatically.
I also spent some time this week thinking about the power electronics for the desktop wire-edm I'm making.
I talked with Jean-Francois and he was really helpful in figuring out a good place to start.
This is the basic idea of the circuit I'm going for: (pay no attention to the component values)
I'll use a roughly 60V, 10A power supply to charge a capacitor (or bank of capacitors) and then discharge that capacitor into the part/wire. I'll measure the energy of the discharge using a voltage divider and a comparator to determine when to turn off the pulse.
I think the PSoC might actually be perfect for this application. I can use the internal hardware logic gates and comparators to ensure my FET's aren't open at the sime time and easily do 500kHz pulse frequency.
I've started picking out candidate FET's:
supply side FET: 100V, 23A continuous, 76A pulse
wire side FET: 100V, 40A continuous, 140A pulse
My next step will be to test this circuit with low power electronics and make sure it does roughly what I want it to do.