Optimum BF20L Motor Brush Problems

As I wrote in my previous posts, the brushes of the motor are gone, and I need to get a pair or more soon. So, I decided to remove the motor in the mean time. Here are some pictures of the motor and the mill during the disassembling process.

Motor Off Top

Top of the mill after I removed the motor and cleaned the grease with break pad cleaner.

Motor Gear Lid

I took off the lid along with the motor. Since one of the bolts holding the motor is a stupid worn out Phillips head bolt (yes, they had done it during installation), I will have to remove it using different methods.

Motor Cap Off

The cap came off easily after removing two long bolts from the sides of the back cap.

Commutator Dirty

The commutator was this dirty before I cleaned it.

Commutator Clean

After sanding the commutator with 800 grit sandpaper.

I hope to get the brushes before this weekend either myself, or through a friend. Until then, I’m stuck with nothing much to do.

8 x 8 Laser Matrix for Fun – Part I

As I decided to replace the metal brackets for the motor mount, and didn’t have the proper parts, I worked on another project last week. I got some 1.5 mm stainless steel sheet today, though. I also got a new dial indicator, since Pamir knocked over and broke the one I got last night (It’s ok, it wasn’t no Mitutoyo anyway. I could have also turned the base magnet on to avoid it).

Stainless Steel

1.5 mm thick stainless steel sheet with 50 mm x 1000 mm size.

Stainless Close

Stainless steel sheet cut to length and marked for the cuts. I sharpened the edge that won’t be used to test the material’s use as a blade. The results are tempting..

Indicator Robot

My new dial indicator (supposedly made in Japan, but too cheap to be), by my first sci-fi book in English, given to me by my father when I was about 12 or 13.

We were at the shop again with Pamir, yesterday. I had center drilled and drilled 64 6 mm holes in a 80 mm x 80 mm, 10 mm thick aluminum piece for this project last week (I need to turn this mill into a big CNC soon!), which includes many lasers. We had tried to cut this frame with the MF70 CNC, and failed.

Drilling 64

Testing for size after drilling the first column. Nice fit.

64 Complete

64 holes drilled and countersunk using my new Noga Rotodrive NG1200.

I plan on epoxying the lasers ‘ adjustable lens parts to the frame , so I can change the laser diode parts easily, if they ever get fried. I got the lasers real cheap from a friend’s store.

Laser Close

5 mW laser with adjustable focus.

I was going to mill the sides of the frame square and even, but it was getting late, so I milled only one side, using drill bits to hold the side parallel to the holes.

Align with Bits

Aligning the holes with the edges using two 6 mm drill bits. 10 mm 2-flute end mill can easily cut 0.5 mm at one pass.

Since the lens parts of the lasers are 5.4 mm long, and the frame I have made is 10 mm thick, I decided to face mill the block down yesterday, using my 50 mm face mill. Since it has its own Morse tapered cone, I had to remove the one I use with my drill chuck. Well, it was stuck. We hammered a long rod in it (thinner than the drawbar, hitting the bottom of the cone’s top hole with inner threads) from the top for a good while, and sprayed it with WD40, but it would not budge. We called it a day, and stopped working on stuff.

Today, after coming back from the hardware bazaar, I sprayed the cone with lighter gas for a couple of seconds to cool and shrink it quickly, and hammered the loosened drawbar a couple of time, and it finally came off!

Chuck Collet Face

Finally the Morse taper (holding the Röhm drill chuck) cone is out and laying along with the face mill, and the ER 25 collet chuck.

However, my mill is no longer functional until next week, since I found (again, after coming back from the hardware bazaar, on the other side of Istanbul. I could get them from there) today that the brushes of the mill’s motor were no more (it was real jumpy and weird yesterday, and I thought the motor control board was messed up). It had been jumpy for the past couple of months, as well, but it was never this unbearable. This afternoon it was not working at all, so I opened the plastic top, and saw black dust on the back of the motor. When I unscrewed the brushes, I realized that one was no more, and the other was really worn out and broken in half. I got this mill about 3 years ago, and checked the brushes only once. I guess I should check them every year or something.

Drawbar Out

Drawbar pulled out and laying beside the finished and broken brushes. The top of the motor is all black thanks to pulverized carbon.

Carbon Dust

Pulverized carbon all over the motor’s back.

Here’s the board I made a while ago, by the PIC development board I got in quantity. That board is for driving high power 7-segment LED’s. The sites listed below were useful for creating this driver and testing it all with a BusPirate V3. I also added some ideas and corrections of my own to the ones presented on these sites.

(I altered the circuit here to suit my needs)

(I got a comment here, which contributes to the text)

(This site was useful for a quick setup)

For BusPirate V3:

Set speed: 4. 1MHz (MAX7219 can handle up to 10MHz)
Clock polarity: 1. Idle low *default
Output clock edge: 2. Active to idle *default
Input sample phase: 1. Middle *default
CS: 2. /CS *default
Select output type: 2. Normal (H=3.3V, L=GND)

I also made a small PIC library for easy ASCII text handling (different from the ones above) with the 7-segment LED’s and the MAX 7219. I’ll have to write more code to be able to drive a 8 x 8 matrix in strange ways.

LED Boards

PIC development board with 18F252 (8 MHz Crystal) by the high power 7-segment LED driver board, which I won’t use for this project. The terminals on the right will be used on the new laser driver board.

Board and Displays

Driver board with the big 7-segment LED displays.

Many Lasers

I don’t know how many I got here, Ersin said a few more than 64.

I (copy) designed and made a card a while ago, to build a huge clock for my workshop, then I left it aside for later, since I still need to fix the displays mounted in their box. All I need to do is to finish the wiring from the displays to the control card and cleanup some black good from one display. Here’s the PCB prints in PSD and BMP format (PSD, BMP Top, BMP Bottom), in case you need to make one.


Coding on MPLAB using Hitech PIC C compiler. PICKİt2’s own software is more stable than MPLAB with my clone PicKit2. Yes, I still do PIC programming on Windows.


Testing the MAX7219 with BusPirate V3. This was the first time I really needed that tool.


Brightness adjusted right. These are the small displays.

I may just cut the side brackets for the boat’s motor mount tomorrow. No more milling work for a week :(

NTN – 600 Hull Rigging – Part XX

Last Friday, my Teflon grease has arrived, and I finally installed the motor and greased the shaft. It has good viscosity, sticks good and runs smooth.

Teflon Grease Syringe

TF2 red Teflon water proof grease for bicycles. This grease has very good viscosity for the flex shaft.

Syringe in Tube

Pumping some grease in the tube. The syringe has an extended plunger that pushes into the long conical tip, but no needle.

I thought I had bent the motor shaft on Thursday (zero morale night), while I was trying to adjust the angle. So, Friday, I went downstairs to attempt to fix that. First, I used my dial indicator to check for the off-set. I checked the can and the shaft, and they both had a 0.06 mm maximum error, which, I think, is OK. However, the coupler had an about 0.12 mm error, which creates an annoying vibration. I’ll have to fix that with a collette or something.

Flexshaft Offset Vertical

The motor is clearly offset from the center. I will have to remake a front plate and 2 side rails from those heavier brackets.

Flexshaft Close

Everything looks fine from here.

So, I’ll have to make better and adjustable rails from some thicker angle brackets, and fix the coupling issue somehow tonight. I’ll also have to modify the front plate to be able to align the motor more easily.

Commodore 64 MOS6581 SID Based Synth / Sequencer

Here’s another Instructable from a long time ago. It was also featured there and brought me some months of free pro membership. I’m just putting a copy here again. Another lazy day, all pictures in one gallery. Right click and view image on FF, for real size.


This is an old project of mine from about 5 years ago. I was 8 when my father bought me a C=64 30 years ago, and I still remember how thrilled I was to play with it (I’m still a gamer and a hardware hacker thanks to it), and the main thing for me in most games was the epic music. So after many years, I decided to make a little synth based on the famous MOS6581. I lost my patience when it came to creating the patches (instruments made from using separate oscillators at different settings and times).

So this is a basic module you can experiment with, it allows you to play with the raw register values (but there’s also the code for using it as a programmable 16 step sequencer, or a MIDI controlled synth).

2000px-MOS6581The circuit consists of a MOS6581 (from old C=64s, the ones I got from e-bay had faulty oscillators, but I got a refund), a PIC18F452 (the brain), 2 shift registers (to be able to communicate with the SID serially, using the 8 data and 5 address lines), a 4×16 character LCD for display, a MAX232 for serial communication with a PC (never really used it for a purpose other than bootloading the firmware), an optocoupler for the MIDI input, a LM386 for direct audio output, linear regulator IC’s, some connectors, switches, and pots.

The schematic and a screenshot of the PCB is also among the pictures. The circuit was designed on Proteus Isis, then transferred to Proteus Ares for the PCB design. The code and the schematic are self explanatory. If you have any questions, please ask.

Later on, I had the PCB printed in China, got a metal box for the whole thing, and assembled them all together. I even designed a tee and had it printed at a print shop.

At the end of the post, you’ll find the schematic files, the PCB in PSD format in case you don’t use Proteus and just want to print it out, and the code that was written on MPLAB IDE using the Hitech PICC18 compiler. Different C files are used for different modes of the system (sequencer, raw data, MIDI, etc.). This instructable probably needs further improvement. I’ll deal with it when I have more time :) I also attached the datasheet for MOS6581. Here’s a couple of videos of the system in action.

MOS6581 DatasheetCommodore_logo
Circuit Schematics and PCB’s
Hitech PIC C Code
Header Files for PIC C Code
PCB Print in PSD Format


PC Interfacing a GameBoy Camera

This is an Instructable I wrote a while ago. It was featured there and brought me some months of free pro membership. I’m just putting a copy here, since I got my own blog now. Some schematics here  (the PIC Mother Card) are very old and crappy. I didn’t know much about PCB design then. I’m lazy ass when it comes to web stuff, so I put all the pictures in one gallery. Right click and view image on FF, for real size.


Here’s another past project of mine from a couple of years ago. At that time I was looking for a low-res camera for simple robotics image processing, and all I had experience with was PIC (12, 16, and 18) micro-controllers. So I didn’t really get to work on the images real time (not enough RAM or speed, and I could not find any suitable SRAM around at that time). I think I’ll revisit this project later on using my new TI Stellaris Board.

The system consists of a GameBoy Camera (Mitsubishi M64282FP Image Sensor with hardware image processing), an ADC0820 high-speed ADC to convert analog pixel values to digital (the sensor outputs pixels as 2.0V p-p analog values), a LM385-2V5 2.5V micro-power voltage reference IC, a PIC18F4620 for processing the digital values to send them later on to a PC via the serial port (or USB with a RS-232 – USB converter).

GBCam_GUIThe PC part of the project is a program (uses OpenGL to display the received image, the height of the pixels change according to brightness to have a fake 3D effect = Depth Mapping) written on Borland C++  Builder. I also still have the simple test programs written in Processing (brightness tracking, etc.). All will be attached.

Since the code and the schematics are self explanatory, and the datasheet for the MCU and the image sensor are rather informative, I’m not going to get into much theory here (as always, questions are answered). Here’s the flowchart of the system, which explains what’s going on.  Ignore the USART part (old version), registers are set up from the MCU :) And an animated GIF image showing brightness tracking done with this camera in Processing.

The first thing to do before you start is to create a suitable connector for the camera (after opening the cartridge structured box with a tri-wing screwdriver and disconnecting / removing the camera from the main structure). I attached a picture of the pinout, so many people used this image, so I don’t know who to give the credit (here’s one http://www.seattlerobotics.org/encoder/200205/gbcam.html). I used an IDC-10 connector to connect it to my old PIC board (from another project).

GBCam_flowchartIn the next step we’ll be looking at the schematics and how the system actually functions.

This is the card connected to my old PIC board. Since I had one laying around, I just made an expansion card to it for this project.
PORTC of the PIC is used for communicating with the camera, PORTD is dedicated to the 8-bit ADC output, and PORTB is used for the ADC’s CS and servos, which I didn’t really manage to control at that time (I tried observing pixel values on the fly, finding the brightest first pixel’s coordinates with a small formula, and adjusting the servo angles in accordance). Servos just went crazy, and I lost patience :|

The LED’s are for displaying board power and frame capture. The schematics are a bit tangled since I didn’t care much about pin labeling then (to quickly create the PCB), so please have patience. I’m not going to attach the PIC board schematic and PCB files (but please pay attention to the pictures for pin orientation), since it’s basically a 40-pin PIC board with a crystal, and all the ports are connected to IDC-10 connectors.

The pin-out of the M6428FN connector in the schematic is as follows, so you can make a simpler adapter / connector for the camera as you see in the picture:

1- GND
2- Vout to ADC (Image data in analog)
3- Bit-bang XCK for SIN, RESET, LOAD, and START (and 10 KHz PWM with 50% DC to get the pixel values), also triggers ADC conversion for each pixel value (74HC14 inverts this signal for the ADC to start the conversion), after a successful read, ADC sends and interrupt to the PIC, and the PIC sends the digital value to its USART, which finally goes to our PC.
4- LOAD signal to camera (Parameter Register Set Enable)
5- START signal to camera (Start Image Sensing)
6- VCC (all the analog and digital power)
7- SIN signal to write the regs on the camera (Parameter Data Input)
8- RESET signal to camera (Reset Parameter Registers)
9- READ (Image) signal from camera
10- GND

For more info on these pins, please refer to the image sensor datasheet attached on the next steps. You’ll understand the schematics better when you read the comments in the code files.

Finally I added pictures of the project in the prototype stage and its final look in a box with a USB 5-pin CP2102 module serial converter (good for getting rid of MAX232 interfaces needed for PC serial ports) and a crappy LED board for the unused port on the PIC card. The cam image was low quality due to breadboard noise, and when I moved the system to a PCB with huge ground planes, the quality went up to 6-bits from 4-bits. Attached are the Hitech PICC18 firmware, Borland VC++ code and executable (plus sample movie you can play by selecting the last frame as you open a movie on the executable, use the mouse buttons to zoom in and out, the rest should be easy to understand), schematics and PCB files in Proteus Isis / Ares, PCB in PSD format, Processing test codes, and the necessary datasheets. Here’s also a video of mine (720p) to show you the PC side of the project in action with one of my own tracks as background music. Happy soldering to all ;)

M64382FP Datasheet
ADC0820 Datasheet
Circuit Schematics and PCB’s
Hitech PIC C Code
PCB Print in PSD Format
Processing Code
Horus 23 PC Code

Religion ofO Marvel! a garden amidst the flames.
My heart has become capable of every form:
it is a pasture for gazelles and a convent for Christian monks,
and a temple for idols and the pilgrim’s Kaa’ba,
and the tables of the Torah and the book of the Quran.
I follow the religion of Love: whatever way Love’s camels take,
that is my religion and my faith.

ibn al-`Arabi, Tarjuman al-Ashwaq, in The Mystics of Islam, translated
by Reynold A Nicholson

Blog Site Problems Fixed

This site has been on and off for the past couple of months. It was because I had problems getting my host (actually a Linux VPS in NY I use for other purposes) and my domain (from another provider, who used to be my host, as well) work together. All my fault, I was lazy and careless, and I was looking for the problems in the wrong places. I think it’s all fixed now. Hopefully I’ll get more visitors soon.

Kagero Pet


NTN – 600 Hull Rigging – Part XIX

Today, I finally mounted the motor and the receiver. It took me a while to mount the motor, since the work area was rather narrow. However, the boat is almost ready to go.

All Cross Antenna

Almost complete.

I also decided to use the antenna on the receiver, instead of the one I mounted on the transom extension (I’ll use it with a 433 MHz RF Modem). So I drilled a 5 mm hole on the starboard side, close to the transom, and epoxied an SMA ferrule in it. The antenna tube fits snuggly in it, so I joined them with some Bison Poly Max Crystal.

Fnl Antenna Mount

I used an SMA connector ferrule for the antenna mount.

The cables and the hoses run hassle free, the COG is still good, and the prop and the flex shaft turn smoothly, and the spot for the receiver is nice.

Receiver Cables Servo

The receiver was mounted on the transom using sticky backed Velcros.

I also enlarged the holes of the rudder mount piece with my new 3 mm 3 flute milling cutter (I got a bunch of new 2 flute milling cutters, along with some countersinks). Now the rudder can be adjusted to be square with the water line (removing the mounting bracket would be real hard, since the transom extension is narrow and now also populated).

3 mm 2 Flute

My new 2 flute milling cutters rock!

Rudder Mount Angle Shine

The angle of the rudder mount could be adjusted after the holes were enlarged.

So, what’s next?

  • Still waiting for my Teflon grease for the grease tube.
  • Use the 3-blade CNC prop instead of working on the beryllium copper prop to balance it. Enlarge its hole and drive dog slots.
  • Secure the hatch.
  • Repair cosmetic faults to an extent.
  • Test the hull for leaks, balance, water cooling problems, etc. before the maiden voyage.
  • Add turn fins to the hull.


Click on the prop for some helpful tips on how to modify your props for better performance.

NTN – 600 Hull Rigging – Part XVIII

Today, Pamir was at the shop with me. I removed the stinger from the transom, and the epoxy was looking good. So I drilled the holes for the stinger, using the stinger as the guide for the bottom holes. I drilled the the single top hole after marking it with pencil graphite rubbed around the hole in the stinger, and pressed hard against the masking tape on epoxy.

Epoxy Holes

The stinger drive was removed and the holes were drilled nicely. The wrinkles are due to two layers of stretch film, which were not stretched perfectly. That area will be covered with liquid gasket anyway.

After that, we spread some liquid gasket on the epoxy, and bolted the stinger on. Excess liquid gasket squirted out, we wiped it off and waited until it was almost cured.

Gasket Bolted Stinger

Gasket applied while the hot glue mold was still intact for a firmer hold. Pamir watches.

Finally, I removed the hardened hot glue mold, which was actually a pain in the ass. Clear hot glue never really sticks to smooth surfaces, but it was bonded to the transom and the epoxy in it. It took me a while to remove all the stuff, and it still needs some cleaning up.

PVC Mold Off

After the liquid gasket is applied and the hot glue mold is torn off.

Epoxy Transpar

Close shot of the clear epoxy hack. That transom will need a paint job.

The transom really needs some paint job, and the tip of the bow needs some epoxy, since I clumsily dropped the boat from the bench tonight. Thanks to the magnet on it, it caught the metal cabinet under the bench, and hit its nose only.

I will probably work on the rudder tomorrow.