Posts Tagged ‘electronic’

Arduino PID motor speed controller – Extra fun bits (part 2/2)

Tuesday, September 13th, 2016

These are a few of the bits that I cut from the main video because it was too long, including running it at full speed and a comparison with a super-simple system! There’s a strobe light in this video, too.

You might want to watch part 1 if you haven’t already, so that this makes more sense.

[Watch in HD]

Arduino PID motor speed controller – Casual demo (part 1/2)

Monday, September 12th, 2016

I threw this together from an old toy’s motor, old printer’s iR sensor, pizza box and some other things, to try out the PID controller algorithm after discovering it on Wikipedia and seeing that there was pseudocode, meaning that I didn’t have to get a PhD in mathematics to be able to read the crazy-looking formulas that Wikipedia seems to be so fond of. There’s a strobe light in this video.

I had planned to screen-capture my program while recording but completely forgot to at the time, so please try to survive my camcorder pointing at my laptop screen…

[Watch in HD]

Here, the PID controller is trying to keep the motor at a precise speed (and get it there as quickly as possible). It doesn’t work well half the time because the L298 (H-bridge), responsible for switching power to the motor, doesn’t seem to like making the motor brake. That means it speeds up much more quickly than it slows down, which the algorithm doesn’t like (it’s designed for linear systems) – it basically ends up trying too hard to slow down, resulting in a big undershoot. I might be able to somewhat compensate for that in code.

I might try this with a Sabertooth motor speed controller (as used in my old singing motors project) in place of the L298, which can certainly force a motor to stop spinning, but the Sabertooth gives such a boost to the motor to get it up to speed that 90% of the PID’s job becomes redundant… Oh well, at least it’d be able to hit any given note without me having to calibrate it first like I did with the singing motors. By the way, that’s why this system measures speed in Hz – I originally intended for it to play music like a new kind of “singing motor”.

Originally, I planned to use a 3-pin computer fan instead of this motor, using the tachometer pin to measure the speed, but that required me to have a common ground for the motor and the tachometer, and I didn’t have the right components available (I only had N-channel MOSFETs, but I needed a P-channel MOSFET). So I ended up throwing my own motor assembly together and using an N-channel MOSFET only (could only turn power on/off, not brake), which the PID system didn’t like. I thought the L298 would fix that problem, since it’d allow the PID system to reverse power to the motor and brake it, but it turns out it’s too weak to have much of an effect after all… =/

Part 2/2 will show it running at full speed (with a more powerful PSU), show a much more naïve speed controller algorithm for the lulz, and just clear up a couple of details.

Random Old Rubbish (Part 2)

Monday, February 29th, 2016

The second and much-shorter part, as I clear out some random rubbish in my room. There are a few more old electronic devices, including a ~25-year-old LCD game, plus some paper stuff…

[Watch in HD]

This time, I didn’t throw away or dismantle everything in the video! I did thoroughly rearrange whatever remained afterwards, though.

Random Old Rubbish (Part 1)

Saturday, February 27th, 2016

I was cleaning out my room and found a load of random stuff (mostly toys), and some of it was interesting, so I decided to record it. Some of it’s around 14 years old. I didn’t intend for 50% of the video to be about Beyblades.

[Watch in HD]

Solar Panel Microphone (Experiment)

Sunday, January 31st, 2016

Here, I conneced a solar panel (via a transformer) to a sound interface as if it’s a microphone, to reveal the subtle pulsing and filckering of various light sources. If you don’t like 50 Hz, this video isn’t for you.

[Watch in HD]

Thankfully, the infrared light from my camcorder is apparently very clean (not pulsing), so I can use that to see things in the dark without affecting the sound.

The transformer is just designed to convert 230V AC to 12V DC, so its audio properties are not very good (it muffles things a lot). Ideally, I’d be using an audio transformer that’s designed to sound good, but this is all I had available. I am using it to remove the DC current that the solar panel makes, because I don’t fancy putting 17.5V into my Quad-Capture (sound interface)’s mic input. I originally tried to make a high-pass filter to remove the DC, using a capacitor and resistor, but it only worked until the capacitor became fully-charged, at which point the sound faded. It was much clearer-sounding than the transformer, but there was also a huge amount of background noise.

I want to revisit this idea in the future, especially to take it for a drive at night, listening to the street lights and car lights (since modern cars use PWM to dim the tail lights).

Inside a Sony HDR-SR12 Camcorder

Saturday, December 12th, 2015

Since my camcorder’s HDD is finally giving up (after about 5 years), I took the opportunity to open it up and take a look inside it – and, of course, I took a bunch of photos as I went along. I did not delve deep inside it because I intend to keep using it after replacing the HDD, and I didn’t trust myself to remember how to put it all back together, but hey, I thought some people might think that it looks cool.

I didn’t make a video, because it was such close-up photography that I had to use a macro lens most of the time, and lighting was such an issue that I had to have my camera’s aperture fully-open. This means that the depth of field was extremely shallow, which would’ve been extremely annoying in a video (95% out-of-focus), and, to top it off, the lens doesn’t even have any image stabilisation, so it would’ve been motion-blurred, too. A YouTube video would’ve been cool, but for now, please enjoy the photos!

24 more photos are below the page break!
(more…)

Inside a Cassette Deck & Dolby Noise Reduction Demo

Sunday, May 10th, 2015

A quick look inside a Yamaha KX-393 cassette deck from the 90s, and demo of Dolby noise reduction. That damn tape counter gives away all the times I cut out my failure to speak properly. =P

Headphones are recommended for the noise reduction demo.

[Watch in HD]

The waveforms displayed while Dolby is selected are simulations – versions of the original audio processed by a compressor/expander. In reality, Dolby mostly only affects the treble (as you can hear), since that’s where most of the tape hiss is, so you wouldn’t get big low-frequency waves, but hey, it’s easier to visualise this way.

My usual video editor did not feel like working, so I made this entire thing in Avisynth – it’s like coding, but for video. Please kill me now. Well, I used VirtualDub for the cropping out of all the dead air, my failures to speak, and misinformation which I said by mistake. On the plus side, I learned a lot of stuff by editing this way (such as how badly Avisynth is designed regarding modifying audio). Also, I didn’t have to screen-capture anything to get those waveforms – they’re being made in realtime by the Waveform plugin, which is processing audio from different Dolby simulations which are also being made in realtime by SoxFilter‘s “compand” function.

This video didn’t turn out as well as I would’ve liked – from the poor view of the mechanism to the incomplete demonstration of the functions and different tape types, and the fact that the only time I could record this (free of disturbances and noise) was a 45-minute slot was when I was half-asleep. So, if people are interested, I might re-visit this.

With all the old technologies on my blog/YouTube channel such as a dot matrix printer, FM MIDI synth, SC-88Pro, and now a cassette recorder, perhaps I should rename this place to “SomethingRetro”. There’s an old VCR here just waiting to be opened, too…

Dojikko Gets Side Sensors

Monday, April 20th, 2015

I’ve given her another 2 ultraound sensors on either side, so that she can see how well lined-up she is to walls on either side of her. This is to try to keep her heading directly towards a wall, so that the head ultrasound sensor will get the best reflections possible (assuming that her environment uses lots of right-angles).

[Watch in HD]

The Arduino fires all 3 ultrasound sensors and listens for their echoes at the same time in order to “see” at the highest frame rate possible (typically 20-50 FPS), but this causes issues with echoes from one sensor bouncing around and returning to a different sensor. Although the code avoids any clearly-bad echoes like this (e.g. 2 echoes on the same sensor), it’s far from perfect, and she often thinks that she’s crashed into something (an object is very close to the head) when she hasn’t. I think there’s also a strange bug in the function that times the echo delays, or something strange is going on with hardware interrupts, because the function sometimes returns 0 for a sensor which clearly has an object in range, and at the same time, the sound of the tone playing on the speaker (using the built-in tone() function) becomes distorted so that it doesn’t even sound like a square wave anymore. I’ve never experienced that before, and I have no idea what’s wrong there. Oh well, she looks cool aligning herself half of the time.

Fun game to play: See how many inconsistencies there are in this video. It’s a combination of videos recorded 7 months apart.

DIY Printer P7: Printing for the first time!

Monday, April 13th, 2015

It actually works! Well, its first ever print-out could certainly do with some improvements, but to be honest, I’m happy it’s even intelligible at all! Part 7 in my super-basic, Arduino-controlled printer project.

[Watch in HD]

It should be better when I at least have a stable and level tray for the paper (or whatever) to sit on. I have an idea for an alternative to a heavy sheet of steel, which you should be able to see in the next video. Perhaps the PSU fan will have arrived by then, too… <_<

Also, enjoy the in-sync 50 FPS if you can! That pen flicks back and forth at stupid speeds, so a high frame rate is actually useful here.

DIY Printer P6: A servo joins the party!

Friday, April 10th, 2015

Time for some real progress this time! The sixth part in this series where I make a super-basic printer with an Arduino.

[Watch in HD]

It’s pretty much ready to print – just a little hot glue and a sheet of paper and it’s all set! But unfortunately, this video is already ~8 minutes long, so that’ll have to wait.

After trying out solenoids and ruling out floppy drive motors because of speed, I looked at servos as a way of moving the pen up and down. I settled on Hitec’s second-fastest micro servo, which is digital (means it’s not limited to 50 Hz update intervals) and has metal gears (means it won’t destroy itself quickly). It’s designed for use in R/C helicopters, so I’m hoping this will handle the fast motions over a small range of travel, with a light load, well. I’m certainly impressed by it so far.