15 May, 2016

Motor Controller

In my first post (which has been ages ago) i showed you my styrofoam cutter which used my variac and 2 motors. Now i wanted to build a controller for the big motor for a long time. And i finally took my first steps in that project.

What we have:
Motor with tachometer at the back (a little generator putting out 8 pulses(sinewave) per revolution)

What we need:
Circuit that interprets the signal from the tachometer and calculates RPM and adjusts power to the motor depending on wanted speed.

This circuit needs several parts:
Arduino nano (or any microcontroller)
Convert sinewave of pulses into a rectanglewave (0-5V)
Power supply with zero cross detection so we can do phase control
Something to control the motor with the arduino

Lets look at the power supply first:
For our circuit we need positive and negative voltage, a stable 5V supply and a signal for zero cross detection. luckily i disassembled some old wall adapters which had transformers in them. The one i chose puts out 16V peak to peak. Now i need a circuit:

And this is it. At the top we have mains AC (which is 230V @50Hz here) which goes through a transformer and is then processed. I basically used 2 half wave rectifiers and connected them in series so i get + and - 8V. I then used the +8V and put them into a 5V regulator to get my 5V. i also directed the signal from the transformer directly into an opamp which creates a rectangle wave. This is then put through a diode, so we dont get any negative voltage to the arduino and through a voltage divider to go from the 8V down to a little under 5V, which is enough for the arduino to properly detect the signal.

Now for the tachometer part:
This is also a part where we need the + and - 8V. The tachometer is here depicted as a motor, but it puts out a signal depending on the motors RPM. now i measured the signal and it already got to almost 20V at 5000 RPM. So as the Opamp has an almost infinite gain, i decided to just put a 10 Ohm resister between the pins, so the voltage the Opamp sees is still very low and there is no risk of damaging it. Then again the output is put trough a diode and a voltage divider to get it to a 0-5V range.

Now lets get to the more difficult part:
How to control the motor? My initial plan was to use a beefy mosfet. It was rated at 15A @ 500V which should be enough for the motor. This solution would not require a zero cross detection circuit, but i would have to rectify the mains voltage (which would be 340V DC) and then use pwm to change the motors power. problem here is, that i have to connect my GND from my 5V circuit to the GND of the 340V circuit to switch the mosfet. or i would have to build an extra circuit that is isolated by an optoisolator.
I had this in my head for a long time, till i came across solid state relays. These are basically a relay, but can switch much faster, and dont degrade as there are no mechanical parts. So i want ahead and changed the circuit to what it is now. i added the zero cross detection so i can do phase control with the relay. phase control is basically PWM but with a very low period dictated by the mains frequency. You switch on the power during the sine and switch off at zero cross. The reason you do it this way is, that the Triac (the thing that is switching inside the solid state relay) can not be switched off as long as there is current flowing. With AC it always switches off at zero cross, as there cant be any current flowing, So i built the circuit around the arduino and did my first testrun:
The powersupply worked
The tachometer worked
The code on the arduino worked
... But the relay....

I tested the relay before i used it (not with the big motor). It switched on and off as expected. But there was something i was not aware of at the time. The relay that i bought (Fotek SSR-40 DA) has builtin zero cross detection. Which means it only switches on at Zero cross. The reason for this is, that you dont get any current spikes in your line and no electromagnetic fields and what not. Now this was bad. The motor has a pretty high startup torque and jumps a bit when just switched on. Also its impossible with this to make lower RPM happen without a big load. So i began searching for an alternative. There are solid state relays without zero cross detection, but they are rare and therefore more expensive (ironic as they have less parts inside). So why buy a relay, when you can build one? Such a relay is basically an optoisolator, an LED, a triac and some resistors. And we dont necessarily need the LED.

So i bought a triac and some optoisolators on ebay. The optoisolators work fine, and it doesnt hurt too much when they are a bit off spec. But the triacs.... I ordered 2 BTA41800 which are rated for 800V and 41A RMS. The spec says it should have a resistance of maximum 10 milli Ohm. I tested one of them and it has a resistance of 200 milli Ohm (or even more, im still unsure). when testing it i put around 20W through it in a short circuit. 3.20 Volts at 5.10A(cant get more out of my lab power supply). This was DC power and the BTA is rated at 41 Amps RMS, so maybe thats also another factor. Now i dont know the forward voltage of the BTA, so maybe i got skewed readings. i will try again with a resistor attached to see if it really is the BTA having such a high resistance. For those that dont know why this is bad:

The higher the resistance, the more voltage is dropped over the device when current flow through it. The resulting powerloss is the dropped voltage times the current flowing through it. So if you want to pump 40 Amps through such a small device you need a damn low resistance, or else you will just melt the component cause of the heat generated at that point.

Update on testing the triac:
I added a piece of an old heating element that i got a from a hairdryer to the circuit. with that i could pump >60W through it. 30V at ~2.3A. strangely the dropped voltage stayed(stood?) constant at 850mV. i tested with 13V at 950mA (amp values due to resistance of heating element) and got the same voltagedrop. does this mean the resistance gets lower with higher voltage? again this was done using DC voltage. Guess my knowledge just isnt enough to really understand triacs. I will just go for it and use the triac with the motor. If it blows up in my face i have to rethink again.







25 June, 2015

Workshop

Yay i did it! I finally got my own electronics workshop.
In this pic it looks a bit lonely and sterile, but its actually pretty cool to work with it. So lets come to its features:
On the left you see a big old CRT screen. Thats because the LCD i wanted to use is broken. So luckily i convinced my parents to not throw away this monitor back then (yes i never throw stuff away that still works, or sell it, because i know i will need it one day).

Behind the screen is the computer. Its a pretty old one. Only has a single core Celeron with 2.66 GHz. With Windows 8.1 it kind of works, but the browser has a hard time rendering websites if the cpu is used by something else... like my oscilloscope :D.

Yes thats right. I have an USB oscilloscope! It sits on the first shelf a bit right to the monitor (on some aluminium foil for shielding from the monitor. Actually that doesnt do anything but safe is safe :P). It cost me 100€ and can measure up to 250 KHz (well 250k samples a second). The special thing about it is, that it has 8 channels. So if i have to measure many things at once, im on the safe side. The downside of this is that the 8 channels are multiplexed, meaning that i only get half the accuracy when i use 2 Channels, and only a third when i use 3.

Next feature: The laboratory power supply sitting right next to the screen (red display). It can supply 0 to 32.3V at 0 to 5.1 Amps (actually 30V at 5A but they added some buffer to make sure it reaches the specified values). Well it can't give you a stable 30V at 5 A (it just cant do 150W output). It only cost 50 € so its okay (Good PSUs are expensive!). If i need Amps i can just get one of my old PC PSUs which then burn up the hood :P.

Lets get to the less technical stuff. Before i made this workshop, there was just the shelf on the bottom with all my crap on it. This was horrible to work with and i got backpain, because its too low to work on it when standing. So i got myself a nice Beechwood plate (250x50x18mm). I put 2 coatings of varnish on it, but i doubt it will hold up very long :P as you see im doing some heavy stuff on there. To raise the height of the working surface i used some 8x8cm pieces of wood that i glued together and screwed onto the plate.

Now for the shelves. Those are 2,80m long and 20cm deep. I can store all my crap on there that i dont need at the moment. If that is full i can still put stuff under the working surface :D. Oh i forgot to mention the outlets. we (my dad and i) placed 3 double outlets on the wall. the outlets can be controlled by a switch on the right (which you can't see in the pic). So when i build a tesla coil and it goes crazy i can use the switch to restore safety :P.

Thats it for the workshop. i can now do some nice electric stuff. I will probably post more entries on my progress. Next up is a controller for the big motor that you see there.

15 May, 2015

New Amplifier

A few weeks ago my old stereo that i had running every day for hours for over 10 years finally said goodbye. Its probably just a fuse, but it popped during normal usage, so i think its finally time to replace it (i already had to replace the big caps, because they were completely dead). The problem is, stereos cost money, and i dont like to spend too much at once. I got the old one from a fleamarket for 10 bucks, including 2 ceramic speaker boxes! It was an incredibly good deal. Sadly i managed to kill the woofer of one of those boxes (the voice coil detached from the cone). I tried reattaching it, and almost got it working... until i didnt detach it during a soundtest and the coil came loose again =/.

So for the last few weeks i had no audio, except my earbuds, and a smaller speaker that i directly attached to my soundcard. Luckily a friend found a very old amplifier in his attic and gave it to me. Its a 10W/15W 4-Channel amplifier. Of course thats not comparable to the old Stereo with its 250W each channel, but i set it up today and it works :D

As its an old amp, it uses old connections. my stereo hat cinch as inputs and and these clamps for the speaker cables. This one instead has 5 pole connectors for input and those old speaker connectors with the big, flat contanct in the middle. I had several of these speaker connectors in the basement, but i was lacking something that could connect my computer to a 5 pin connector.

For years i only had a mono connection to my stereo, because i had no cable with 3 leads available at the time i got it. But i found a 5 lead cable in the basement that i can use. Now i also had an old 5 pin connector cable around, that i got from a microphone for a big tape recorder. The microphone was essentially a little speaker. This connector had a little transformer inside the plug, which is probably there to protect the microphone from the high voltage from the tape recorder it came with. Also this microphone was mono, but had 4 leads in its cable. So i detached the transformer and resoldered the 4 pin wire to the connector. I used 1 lead for ground (pin 2), 2 pins for stereo play (pins 3 and 5) and one pin for mono record (pin 1). I didnt attach the last lead to my computer, because that made no sense. I just soldered it to the plug because i didnt want it to fly around. Then i soldered the cable of the plug to the 5 lead cable and the 5 lead cable to my stereo cinch cable that i had from my stereo, which i uses to connect my computer to the aux input (i now have 2 free leads in the 5 lead cable, for other uses).

My stereo had a contact switch that switched on a relay to power the stereo, but the old amp has some rotational switch for that. As i plan to use this amp for some time, i dont want to put too much stress on this switch (i switch it on and off at least once a day), so i attached an old lightswitch to the mains cable and put the amps switch in the on position.

I plugged everything together and it works :D

I now only have to put the new cable in the cable duct and everything is finished

28 April, 2015

Planning how to use the styrofoam cutter

Of course i didnt build the styrofoam cutter just for fun. we want to put styrofoam under our pool as isolation. But our pool is round. I could now go outside and lay out the platters and draw on them where to cut them, or i could use modern technology for this. Of course I used the latter :P

First i opened GIMP and created a new picture measuring 400x400 pixels (pool is 3.66m in diameter and we want a bit of overhang). I then drew a circle spanning the full width of the picture and placed rectangles to cover it. My styrofoam sheets are 0.5m x 1m in size so i used rectangles measuring 50x100 pixels. The result is this:






With this pattern i can propably save 4 or 5 of my 32 styrofoam sheets. Now i have to layout this onto my sheets. And here is the layout:





On the left the white stuff are leftovers. As you see i can save 2 sheets. But i managed to put one piece twice in a sheet, so i save a third one on the other half (wohoo 5 sheets saved!). The whole thing is symmetrical so i have to cut out each piece twice. Thats what im going to do the next days :D

little update: today i cut all the styrofoam sheets and of course i fucked it up and did not save the 5th sheet -.-. But otherwise it worked like a charm :D

27 April, 2015

MacGyvered styrofoam cutter

Welp its time for my first blogpost.

We are getting a new pool because the old one broke and we wanted to enhance everything (one of those with the one air filled thing on top that floats and hold itself up).

Our old pool cooled down every night to 16°C or maybe less(20°C during day), and only kept temperature during the hottest days in summer, so we decided to put some styrofoam under it. Sadly styrofoam does not come in 4m big circles, so i have to do it myself. There were two options: Cut it with a knife and get it everywhere, or build my own styrofoam cutter.

I always love to tinker with dangerous things, so of course i wanted to build my own cutter. a quick and dirty method would be to weld a knife into a piece of metal so it sticks through, and then heat it from the underside with a gasflame, but first, i suck at welding, and second we dont have a gas outlet (i would have to do that by myself too and thats where my parents would kill me). so i have to find another way.

I like electricity so i tried to follow the example of other styrofoam cutters and wanted to use a heated wire. I have a cheapo lab PSU that i wanted to use first, but it couldnt get the wire hot enough. So i wondered how could i get more power but still be able to control it?

Good thing i always keep all the things because i will need them 10 years later. I have an old 12V motor that can also act as a generator, as it has permanent magnets. So i wanted to use this as a Generator to supply the wire with enough power. Now i have to drive it with something. I salvaged a 230V universal motor from our old broken washing machine (circuit board went up in smoke for some reason, also salvaged the solenoid valves and the little waterpump that were in there). To drive this motor i also got myself a noice 1000W variac. I also mounted it on a piece of wood so i can clamp it to a table because that motor can cause some karnage.

So now i have to connect both motors. First i thought about a beltdrive, because i also kept the belt from the washing machine, but the other motor doesnt has any grooves on its rotor, so the belt would slip of or i had to position both motors in a specific way. And again i could use something that i got a few years back.

For the old pool we purchased a longer hose for the pump because i wanted to use a car cooler to heat the water with a fire, but we didnt want to position this close to the pool. So i cut up a 20cm long piece of it. The hose fits over the rotors of both motors with a gap. To make it fit tighter i cut up an old bike tire tube and pulled some over the rotors until the hose fit tightly. I then secured it on both rotors with hose clamps.

So i also mounted the smaller motor on a piece of wood so i could secure it too (yes i did this after i connected both motors because im stupid and lazy). I clamped both motors to the table and hooked the big one up to my variac. I then put my piece of wire in a hacksaw and connected both sides to cables that lead to the 12V generator.

AAAANNNND We're done. I then let the motor run at about 115V. As the generator was under load it ofc didnt spin that fast, and the hose also did its part to slow things down (its a pretty rigid one). But the wire got hot enough to cut through styrofoam like butter :D.

Now i only have to layout the styrofoam sheets so they cover a circle and then start cutting :D

pics:

The variac with attached outlet:




Big motor with its wiring:

Small motor attached to big motor with hose:
Hacksaw with wire and cables:
Motors and variac in one pic: