Project: My voice coil winder

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Hey Guys, It's been long time. Was away for a while.

But I have been working on this every now and then since I have to find a way to get the coils working.

Since handling with the hand while winding creates problems I have been adding ways to make this automatic some how.
and since the lazer machine was away on repair, I have to use my hand and all to cut the plastic and all.

Below are the upgrades to show you what I have been up to.

I will make it brief with pictures.

First of all I have added a way to guide the coil while it is being wounded. Below shows the guide motor and railing with limit sw.

The Motor and it's rail is taken from CD mach and is driven by low Voltage with direction reversal via a erlay


This one show where the tacho sensor assy is mounted and it's details.



The tacho produce perfect 5V pulses.

Below i s another pic of a temporary control panel and here you can see the Drum motor gear upgrades. The Drum motor RPM is variable from a round 50 rpm to 150 rpm through the VR control



Below is the control PCB



and this one shows the coil guide mounts and how coil tension is provided.



Last but not least, New Glue I found around and will try to test them one by one.

 
Last edited:

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Even though the motors are control via relays, I am using a PIC to switch the direction and Pulse the Guide Assy with respect to tacho input.

The PIC (12F629 ) will scan the two switch and INT is used as tacho sensing.

Since Ya all know I am knew to programming, I have been struggling with the codes.

My problem lies here. I have wrote a small code to scan the switch and toggle the relay driver when respective switch is activated.
The Motor Control Voltage is driven using a LM723 for the drum and a L1117 St regulator for the Guide.

The RPM is measured using a tacho meter I recently bought of ebay and 50rpm is more that enough to wind a voice coil under a minute.

In the PCB Picture you cannot see the PIC since it was added after the PIC.

The code is written in steps, so to say the ISR is not yet implemented.

;******************************************************************************
; *
; Filename: Coil Winder Control.asm *
; Date: 1 Sep 2010 *
; File Version: V1.0 *
; *
; Author: Rifaa-ath Razei *
; Company: *
; *
; *
;******************************************************************************

;------------------------------------------------------------------------------
; PROCESSOR DECLARATION
;------------------------------------------------------------------------------

LIST P=12F629 ; list directive to define processor
#INCLUDE <P12F629.INC> ; processor specific variable definitions

;------------------------------------------------------------------------------
; GP0 - output control to Drum Direction Ctrl
; GP1 - output control to Guide Direction Ctrl
; GP2 - Tacho Intput, interrupt on change enabled
; GP3 - Drum Dir ctrl switch In
; GP4 - Guide Dir ctrl switch In
; GP5 - Guide Drive Pulse Out
;------------------------------------------------------------------------------

__CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT

;------------------------------------------------------------------------------
; VARIABLE DEFINITIONS
;------------------------------------------------------------------------------

INT_VAR UDATA_SHR 0x20

d1 RES 1
d2 RES 1



;------------------------------------------------------------------------------

DATAEE CODE 0x2100
DE "Coil Winder Control"
DE "V 1.0"
DE "Vialogic Pvt Ltd"

#define Bank0 BCF STATUS,RP0
#define Bank1 BSF STATUS,RP0
#define GD GPIO,5 ; Guide Motor drive pulse out
#define DSw GPIO,4 ; Drum Motor reverse switch
#define GSw GPIO,3 ; Guide Motor reverse switch
#define DDr GPIO,0 ; Drum drive ctrl
#define GDr GPIO,1 ; Guide drive ctrl
#define Tach GPIO,2 ; Tacho Input


;------------------------------------------------------------------------------
; RESET VECTOR

RESET_VECTOR ORG 0x0000 ; processor reset vector
GOTO MAIN ; go to beginning of program

; INTERRUPT VECTOR

INT_VECTOR
ORG 0x0004 ; interrupt vector location
; MOVWF W_TEMP ; save off current W register contents
; MOVF STATUS,w ; move status register into W register
; MOVWF STATUS_TEMP ; save off contents of STATUS register

; ISR


; MOVF STATUS_TEMP,w ; retrieve copy of STATUS register
; MOVWF STATUS ; restore pre-isr STATUS register contents
; SWAPF W_TEMP,f
; SWAPF W_TEMP,w ; restore pre-isr W register contents
; RETFIE ; return from interrupt

;Oscillator Caliberation

errorlevel -302
Bank1 ; set file register bank to 1
call 0x3FF ; retrieve factory calibration value
movwf OSCCAL ; update register with factory cal value
Bank0 ; set file register bank to 0
errorlevel +302

;-------------------------------------------------------------------------------
; MAIN ROUTINE

MAIN
clrf GPIO ; Clear Outputs
movlw 07h ; Disable-
movwf CMCON ; comparator
Bank1
movlw b'011100' ; IO Pin Dir
movwf TRISIO
Bank0
movfw b'000000' ; Load Value to Clear all outputs
movwf GPIO ; Send to port

; Reading switches

SWtest
btfss DSw ; Tests for Sw press
goto DSwOn ; If pressed, goto toggle Drum drive
btfss GSw ; Tests for Sw press
goto GSwOn ; If pressed, goto toggle Guide drive
goto SWtest ; If no action, ontinue scanning

DSwOn
call Debounce ; Sw debouncing
btfss DSw ; Test for Sw release
goto DSwOn
movf DDr ; Read Drum drive value to W reg
xorlw b'000001' ; toggle Drum drive
movwf GPIO ; Write to port
goto SWtest ; Back to Sw scanning

GSwOn
call Debounce ; Sw debouncing
btfss GSw ; Test for Sw release
goto GSwOn
movf GDr ; Read Guide drive value to W reg
xorlw b'000010' ; toggle Guide drive
movwf GPIO ; Write to port
goto SWtest ; Back to Sw scanning

Debounce
;1993 cycles ; Sw deboune delay is set to 2ms @ 4MHz
movlw 0x8E
movwf d1
movlw 0x02
movwf d2
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto Delay_0

;3 cycles
goto $+1
nop

;4 cycles (including call)
return


END
The code works somewhat. Meaning the Drum motor is reversed as the Dsw is pressed. The output toggles perfectly but the Gsw is not working at all. I really do not know why this should happen, since GSw is same as DSw.

The GSw won't toggle at all.
I tried with another PIC too.

At first it was toggling but with some kinda problem. When I measured the DC voltage (with drive circuit not connected)

I can measure 0V and 5V but the meter shows switch bounce effect yet the DDr out toggles perfectly without any errors.Further more when I have the GSw pressed the voltage at GDr ( Guide drive out) shows 2.5V :eek:.

This should not be, the Drum output stays at it's state when I held down the DSw and toggles upon release but not the guide drive.

So I checked the code and saw a simple typing mistake in the GswOn routine. This happened because I copy pasted the drum routine.

So I corrected the mistakes and tried and now the guide does not toggle.
Only the drum toggles even with the drivers connected.

I cannot seem to understand why this should happen.

I like some one to point out my errors.

And Later ISR will come once after I can reverse guide direction works.

PS. Guide limits are used in the guide regulators and is not a concern for the code.
Besides I would like to control the guide at my will. I have to use glue you know :D.

From the code you can see the PIN cnfig.

GP5 will be connected to a logic fet and this will be used to on off the contrl voltage to the guide. On Off timing will be done via ISR. With one pulse the guide will travel a mm or so depending on the guide drive pulse length.

Two motors are also switched on via foot switch pedal which I haven't shown. the foot switch switches the power to the motors, this way I have both hands free. By foot I can stop and start the winding at any given time.

So guys please, can you point the error in my ASM file.

Thank you
 
Last edited:

Markd77

Joined Sep 7, 2009
2,806
You might be getting confused by declaring things like movlw b'011100'. It's clearer to show all 8 bits ie. movlw b'00011100'
I think that TRISIO 5 is an output but maybe should be an input.
Impressive machine!
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
How can that can be an issue when the two MSB is not used. They would be declared as don't care condition.
TRISIO 5 is out put and is used to drive the guide pulses.

12F629 have GPIO <0:5> total of 6 ports.
I am using 3 inputs and 3 outputs.
 

Markd77

Joined Sep 7, 2009
2,806
Sorry, that's not it. I couldn't figure out if GPIO<5> was supposed to be an output.
There's a couple of these MOVFs - the compiler default is oddly to copy the file to itself.
You can either use the secret instruction movfw or just put ,W on the end.

movf DDr ; Read Drum drive value to W reg
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Hey Mark
Thanks for the input.

the drum reverses as indented. It's the Guide out that do not respond.
The Guide and Drum commands are identical and is intended to do the same thing.
Being this the case I do not understand why the Guide Routine is not working.

GPIO 5 is an out..note the b'011100'. the MSB zero is the GP5 Trisio command, isn't it not?

Mark don't be too concerned about GP 5. it is yet to implent and I might ask you how the ISR routine goes as I have never done this and I could nt find a proper tut on line either.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
OK.
The machine is working as expected :D. Not bad huh!
Specially when I am writing my own codes.

Will post a pic of a new technique that I thought of on holding the coil to the kapton. This time if it slips from kapton. I am thru with this thing.
Bought some new wires too. Seem to run out of them pretty soon. :rolleyes:
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918


Final touch
Coil holds in place at even 100°C., Nothing smoked .
But takes a day to dry up, more than I anticipated.

Oh well.
I guess this will be done after a long time.

I hope this was worth it. :confused:
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
It's time to end this thread.

So I will just show you the works.

2 Coils are done and tested at 100°C. Next is the spider.
Below shows the general idea




Here is the first stage of assembly.
Gaps are filled with epoxy. The spider and coil are glued after calculating the coil depth


 

bertus

Joined Apr 5, 2008
22,270
Hello R!f@@,

Congratulations with the result.
That looks professional.
Could you already try them out on how they sound now?

Bertus
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Hello R!f@@,

Congratulations with the result.
That looks professional.
Could you already try them out on how they sound now?

Bertus
Thanks
It thumps better than I expected.
Of course I cannot drive to it's Max Vas, in open air. too much cone excursion.
Max can be tested when in the cabinet.
 

retched

Joined Dec 5, 2009
5,207
Looks VERY good Rifaa. Your an artist.

You needed a part that required a tool.

So, you built the tool and then made the part. Very impressive.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Not without the help of the fine members of AAC.
I am great full and proud to be a part of ya'll.
 
Top