Saturday, April 30, 2011

Controlling dc motor speed using pc


[]  Generate a sound wave of certain duration (in my case 10 seconds) with high frequency (say 20000 Hz) using my Scilab toolbox for tone generation.

[] Cut a wire from an old pc headphone including the TRS connector

[]  Connect one end of the dc motor with a diode and the other end of the diode with any wire out from the sound card.

[]  Connect the second wire with the motor

[]  Run the sound file with any media player and control the speed via volume control slider

Note: wave rectification is done by hardware (diode) and is not going to work when done by software
Note: when motor is connected without diode it is not going to rotate and it will behave as a speaker (you can hear songs from the motor!)

Friday, April 29, 2011

Graphical presentation of RGB 3d matrix

When I was using Image Processing and Design toolbox IDP 8.0 in Scilab environment I came over what's called "3d matrix". This 3d matrix is called RGB matrix also. Each pixel in any image requires to be defined 3 information: pixel row, pixel column, and the RGB values of this pixel. So, this matrix defines pixel location and color components. The size of this RGB matrix is M x N x 3 where M is image height in pixels, and N is image width in pixels.