Construcción de un Motor Lineal

Salvador Macías Hernández

Página hecha el Sábado 13 de Agosto del 2006

 

 

Como última petición, de los sinodales, a mi presentación de tesis. Se va a construir un pequeño motor lineal. El objetivo de este prototipo, es el de probar que se pueden coordinar dos o más módulos de la línea transportadora inteligente para llevar un pallet de un punto a otro. La mejor forma de demostrar esto, es construyendo un motor lineal y dividir en dos dicho motor, para que se vea la coordinación de dos microcontroladores para un solo fin, además de resolver el problema de comunicación entre ellos.

 

Para la elaboración de dicho motor, se utilizó electroimanes con un núcleo en forma de E, de los mismos que se utiliza para los transformadores, así como se muestra en la siguiente figura:




Se juntaron los núcleos formando una línea recta, haciendo la estructura dentada del estator del motor lineal.






 

 

Enseguida se ponen los embobinados:


 

Ahora hay que acoplar a cada bobina, el relevador de estado sólido que se diseñó para este caso, y es el siguiente:

Para efecto de simulación se substituyó la bobina por una resistencia de 8 ohms. Ya que queremos que pase por ella una corriente de 4 amperes y que se sature el transistor.

 

    

 

El motor lineal con sus relevadores quedo como se muestra en las siguient fotografía:


 

 

El motor estará comandado por dos microcontroladores que conmutarán las bobinas del estator para que el deslizor se mueva. Cada microcontrolador controlará 4 bobinas, y el primer microcontrolador controlará además, la conmutación del deslizor. La etapa de potencia de éste, es un Puente H como el que hemos visto anteriormente.

 

En nuestra primera aproximación, hemos controlado la primera mitad de este motor. Esto incluye la coordinación de las primeras cuatro bobinas y la conmutación del deslizor. Se dejó fuera la comunicación serial, ya que el objetivo de esta aproximación  es el de obtener la secuencia de activación de bobinas, además de probar la etapa de potencia y ajustar el tiempo de conmutación. El programa que se utilizó fue el siguiente:




;-------------------------------------------------------------
; Programa para controlar el motor lineal
; Las bobinas están controladas por el puerto P1
; El contador de evento será R1
;-------------------------------------------------------------

BOBINA1 equ P1.7
BOBINA2 equ P1.6
BOBINA3 equ P1.5
BOBINA4 equ P1.4

DESLIZOR1 equ P1.0
DESLIZOR2 equ P1.1

org 00h
  jmp INICIO

INICIO:
  mov P1,#00000000b
  mov R1,#00h
  sjmp PROGRAMA_PRINCIPAL 

PROGRAMA_PRINCIPAL:
  call DECODIFICA_EVENTO
  call ESPERA1_seg
  inc R1
  cjne R1,#0Fh,PROGRAMA_PRINCIPAL

PIERDE_TIEMPO:
  sjmp PIERDE_TIEMPO

ESPERA1_seg:
  mov R5,#15    ;Aquí se ajusta la velocidad del motor
  ESPERA1_seg_Ciclo:
    call ESPERA_5mS
    djnz R5, ESPERA1_seg_Ciclo
  ret

DECODIFICA_EVENTO:
  DECODIFICA_EVENTO_00h:
  cjne R1,#00h,DECODIFICA_EVENTO_01h ;Avanza a 1.5 Bobinas
  mov P1,#00h
  setb BOBINA1
  setb BOBINA2
  setb DESLIZOR2
  jmp DECODIFICA_EVENTO_SALIR 
  DECODIFICA_EVENTO_01h:
    cjne R1,#01h,DECODIFICA_EVENTO_02h ;Avanza a la 2a bobina 
    clr BOBINA1
    setb BOBINA2
    clr DESLIZOR2
    setb DESLIZOR1
    jmp DECODIFICA_EVENTO_SALIR
  DECODIFICA_EVENTO_02h:
    cjne R1,#02h,DECODIFICA_EVENTO_03h ;Avanza a la 2.5 bobinas
    setb BOBINA3
    clr DESLIZOR1
    setb DESLIZOR2 
    jmp DECODIFICA_EVENTO_SALIR

  DECODIFICA_EVENTO_03h: 
    cjne R1,#03h,DECODIFICA_EVENTO_04h ;Avanza a la 3a bobina
    clr BOBINA2
    clr DESLIZOR2
    setb DESLIZOR1
    jmp DECODIFICA_EVENTO_SALIR
  DECODIFICA_EVENTO_04h:
    cjne R1,#04h,DECODIFICA_EVENTO_05h ;Avanza a 3.5 bobinas
    setb BOBINA4
    clr DESLIZOR1
    setb DESLIZOR2
    jmp DECODIFICA_EVENTO_SALIR
  DECODIFICA_EVENTO_05h:
    cjne R1,#05h,DECODIFICA_EVENTO_06h ;Avanza a la 4a bobina
    clr BOBINA3
    clr DESLIZOR2
    setb DESLIZOR1
    jmp DECODIFICA_EVENTO_SALIR
  DECODIFICA_EVENTO_06h:
    cjne R1,#06h,DECODIFICA_EVENTO_07h ;Detenemos la inhercia
    jmp DECODIFICA_EVENTO_SALIR
  DECODIFICA_EVENTO_0Eh:
    cjne R1,#0Eh,DECODIFICA_EVENTO_SALIR ;Apagamos TODO
    mov P1,#00h
    sjmp DECODIFICA_EVENTO_SALIR
  DECODIFICA_EVENTO_SALIR:
    ret

db 'Salvador Macías Hernández'
db ' - Programa para MtLin001 ver 002'



;*************************************************************
;* Tiempo.LIB *
;* Subrutinas de tiempo para un cristal de 11.0592Mhz *
;*************************************************************
; Aquí van las subrutinas de tiempo





A continuación mostramos los videos del dispositivo funcionando :













Estos videos fueron tomados con la cámara del celular.

 

Los programas utilizados para para que se moviera completamente el deslizor del motor lineal, utilizando los dos microcontroladores son los siguientes:

 


Programa del MicroControlador 1


;-------------------------------------------------------------
; Programa para controlar el motor lineal
; Las bobinas están controladas por el puerto P1
; El contador de evento será R1
;-------------------------------------------------------------

BOBINA1 equ P1.7
BOBINA2 equ P1.6
BOBINA3 equ P1.5
BOBINA4 equ P1.4

DESLIZOR1 equ P1.0
DESLIZOR2 equ P1.1

org 00h
jmp INICIO

org 23h
jmp INTERRUPCION_SERIAL

INTERRUPCION_SERIAL:
clr RI
call DECODIFICA_EVENTO
call ESPERA1_seg
inc R1
mov SBUF,R1
reti

INICIO:
mov P1,#00000000b
mov R1,#00h
call INICIALIZA_9600_8_1SP_11Mhz
setb EA
setb ES
mov SBUF,R1
sjmp PROGRAMA_PRINCIPAL 

PROGRAMA_PRINCIPAL:
cjne R1,#06h,PROGRAMA_PRINCIPAL

PIERDE_TIEMPO:
sjmp PIERDE_TIEMPO

ESPERA1_seg:
mov R5,#20
ESPERA1_seg_Ciclo:
call ESPERA_5mS
djnz R5, ESPERA1_seg_Ciclo
ret

DECODIFICA_EVENTO:
DECODIFICA_EVENTO_00h:
cjne R1,#00h,DECODIFICA_EVENTO_01h ;Avanza a 1.5 Bobinas
mov P1,#00h
setb BOBINA1
setb BOBINA2
setb DESLIZOR2
jmp DECODIFICA_EVENTO_SALIR 
DECODIFICA_EVENTO_01h:
cjne R1,#01h,DECODIFICA_EVENTO_02h ;Avanza a la 2a bobina 
clr BOBINA1
setb BOBINA2
clr DESLIZOR2
setb DESLIZOR1
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_02h:
cjne R1,#02h,DECODIFICA_EVENTO_03h ;Avanza a la 2.5 bobinas
setb BOBINA3
clr DESLIZOR1
setb DESLIZOR2 
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_03h: 
cjne R1,#03h,DECODIFICA_EVENTO_04h ;Avanza a la 3a bobina
clr BOBINA2
clr DESLIZOR2
setb DESLIZOR1
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_04h:
cjne R1,#04h,DECODIFICA_EVENTO_05h ;Avanza a 3.5 bobinas
setb BOBINA4
clr DESLIZOR1
setb DESLIZOR2
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_05h:
cjne R1,#05h,DECODIFICA_EVENTO_06h ;Avanza a la 4a bobina
clr BOBINA3
clr DESLIZOR2
setb DESLIZOR1
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_06h:
cjne R1,#06h,DECODIFICA_EVENTO_07h ;Avanza a la 4.5 bobina
clr DESLIZOR1
setb DESLIZOR2
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_07h:
cjne R1,#07h,DECODIFICA_EVENTO_08h ;Avanza a la 5a bobina
clr BOBINA4
clr DESLIZOR2
setb DESLIZOR1
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_08h:
cjne R1,#08h,DECODIFICA_EVENTO_09h ;Avanza a la 5.5 bobina
clr DESLIZOR1
setb DESLIZOR2
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_09h:
cjne R1,#09h,DECODIFICA_EVENTO_0Ah ;Avanza a la 6a bobina
clr DESLIZOR2
setb DESLIZOR1
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Ah:
cjne R1,#0Ah,DECODIFICA_EVENTO_0Bh ;Avanza a la 6.5 bobina
clr DESLIZOR1
setb DESLIZOR2
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Bh:
cjne R1,#0Bh,DECODIFICA_EVENTO_0Ch ;Avanza a la 7a bobina
clr DESLIZOR2
setb DESLIZOR1
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Ch:
cjne R1,#0Ch,DECODIFICA_EVENTO_0Dh ;Avanza a la 7.5 bobina
clr DESLIZOR1
setb DESLIZOR2
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Dh:
cjne R1,#0Dh,DECODIFICA_EVENTO_0Eh ;Avanza a la 8a bobina
clr DESLIZOR2
setb DESLIZOR1
jmp DECODIFICA_EVENTO_SALIR


DECODIFICA_EVENTO_0Eh:
cjne R1,#0Eh,DECODIFICA_EVENTO_SALIR ;Apagamos TODO
mov P1,#00h
clr EA
sjmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_SALIR:
ret

db 'Salvador Macías Hernández'
db ' - Programa para MtLin002a ver 002'






Programa del MicroControlador 2



;-------------------------------------------------------------
; Programa para controlar el motor lineal
; Las bobinas están controladas por el puerto P1
; El contador de evento será R1
;-------------------------------------------------------------

BOBINA5 equ P1.7
BOBINA6 equ P1.6
BOBINA7 equ P1.5
BOBINA8 equ P1.4

DESLIZOR1 equ P1.0
DESLIZOR2 equ P1.1

org 00h
jmp INICIO

org 23h
jmp INTERRUPCION_SERIAL

INTERRUPCION_SERIAL:
clr RI
mov R1,SBUF
call DECODIFICA_EVENTO
reti

INICIO:
mov P1,#00000000b
mov R1,#00h
call INICIALIZA_9600_8_1SP_11Mhz
setb EA
setb ES
sjmp PROGRAMA_PRINCIPAL 

PROGRAMA_PRINCIPAL:
cjne R1,#06h,PROGRAMA_PRINCIPAL

PIERDE_TIEMPO:
sjmp PIERDE_TIEMPO

ESPERA1_seg:
mov R5,#20
ESPERA1_seg_Ciclo:
call ESPERA_5mS
djnz R5, ESPERA1_seg_Ciclo
ret

DECODIFICA_EVENTO:
DECODIFICA_EVENTO_06h:
cjne R1,#06h,DECODIFICA_EVENTO_07h ;Avanza a 4.5 Bobinas
setb BOBINA5
jmp DECODIFICA_EVENTO_SALIR 
DECODIFICA_EVENTO_07h:
cjne R1,#07h,DECODIFICA_EVENTO_08h ;Avanza a la 5a bobina 
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_08h:
cjne R1,#08h,DECODIFICA_EVENTO_09h ;Avanza a la 5.5a bobinas
setb BOBINA6 
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_09h:
cjne R1,#09h,DECODIFICA_EVENTO_0Ah ;Avanza a la 6a bobinas
clr BOBINA5 
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Ah:
cjne R1,#0Ah,DECODIFICA_EVENTO_0Bh ;Avanza a la 6.5a bobinas
setb BOBINA7 
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Bh:
cjne R1,#0Bh,DECODIFICA_EVENTO_0Ch ;Avanza a la 7a bobinas
clr BOBINA6 
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Ch:
cjne R1,#0Ch,DECODIFICA_EVENTO_0Dh ;Avanza a la 7.5a bobinas
setb BOBINA8 
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Dh:
cjne R1,#0Dh,DECODIFICA_EVENTO_0Eh ;Avanza a la 7.5a bobinas
clr BOBINA7 
jmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_0Eh:
cjne R1,#0Eh,DECODIFICA_EVENTO_SALIR ;Apagamos TODO
mov P1,#00h
clr EA
sjmp DECODIFICA_EVENTO_SALIR
DECODIFICA_EVENTO_SALIR:
ret

db 'Salvador Macías Hernández'
db ' - Programa para MtLin002b ver 002'



   

Para ver los videos del motor lineal funcionando con los dos microcontroladores y su respectiva comunicación, hay que bajar los siguientes archivos:






Autor: Maestro en Ciencias
Salvador Macías Hernández
Salvador@MaciasHernandez.com
http://salvador.maciashernandez.com