Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2024, 12:52:22 00:52


Login with username, password and session length


Pages: [1]
Print
Author Topic: The Control With Dc Motor by Using PWM  (Read 11597 times)
0 Members and 1 Guest are viewing this topic.
virous
Guest
« on: September 25, 2007, 11:54:37 23:54 »

Hi...
Alwas we find ourself need to control with speed for Dc motor .
We have to change the average value of voltage by activiting
Pulse Width midulation.
When we want to change its direction we must use a H-bridge
and I make it by using BC-139 transistor that carry 1 A.
 
Logged
fernandodiaz
Junior Member
**
Offline Offline

Posts: 73

Thank You
-Given: 1
-Receive: 18


« Reply #1 on: September 26, 2007, 04:01:23 04:01 »

Hi you can find
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011782


http://www.electronics-project-design.com/DCservoMotor.html
http://www.freeweb.hu/t-t/elokep/pic/download/an718a.pdf

good option is http://www.geckodrive.com/
Logged
pl4tonas
Active Member
***
Offline Offline

Posts: 145

Thank You
-Given: 318
-Receive: 195



« Reply #2 on: September 26, 2007, 08:52:05 08:52 »

The BC139 cannot witstand 1A.  I sugest to use a ZTX1149A (or simillar) (ZTX1149A, ZTX790A for PNP and ZTX1051A, ZTX1049A for NPN) which can handle 3A and also has a low Vce saturation (Low collector emmiter saturation voltage).  That means low heat losses.
Logged
iphone
Active Member
***
Offline Offline

Posts: 168

Thank You
-Given: 115
-Receive: 10


« Reply #3 on: October 02, 2007, 06:12:27 06:12 »

virous,

Any hex file for the schematic ?
Logged
fernandodiaz
Junior Member
**
Offline Offline

Posts: 73

Thank You
-Given: 1
-Receive: 18


« Reply #4 on: February 01, 2008, 01:05:00 01:05 »

Hiere one little contribution using proton plus dc servo control PID
simulation with proteus samples open file AN696 dsn  for make simulation
with IC  L6203
using encoder motor speed 2500 rpm
efective mass                  .00001
torque load                       37 
 for best results  usin processor PC dual core or quad core more real time simulations....
for slow controls temperature using timer interrupt update PID or time delay









Device = 18F452    ' espacio de CWRITE & CREAD 0 32768 0 FFFE      18f4620
XTAL = 20          ' USA 993 BYTES DE MEMORIA   EE
CONFIG_START
OSC      = xt     ' HSPLL CAMBIAR XTAL SPEED
PWRT     = On     ' Power Up Timer Enabled
WDT      = OFF     ' Watchdog Timer Disabled
WDTPS    = 128    ' Watchdog Postscaler: 128 MAX(18F452) 1:256  '8192  16384 32768
LVP      = OFF    ' Low Voltage ICSP Disabled
Debug    = OFF    ' Background Debugger Disabled
 
  '  BODEN    = OFF
  '  IESO    = On    ' Int/Ext Oscillator Switch Over Disabled
  '  BOREN   = OFF    ' Brownout Reset Disabled
  '  MCLRE   = On     ' External MCLR enabled
  '  STVREN  = On     ' Stack Overflow Reset Enabled
   ' PBADEN  = OFF    ' Port B ADC functions Disabled
CP0      = OFF    ' Code Protection Block 0 Disabled
CP1      = OFF    ' Code Protection Block 1 Disabled
CPB      = OFF    ' Boot Block Code Protection Disabled
CPD      = OFF    ' Data EEPROM Code Protection Disabled
WRT0     = OFF    ' Write Protection Block 0 Disabled
WRT1     = OFF    ' Write Protection Block 1Disabled
WRTB     = OFF    ' Boot Block Write Protection Disabled
WRTC     = OFF    ' Configuration Register Write Protection Disabled
WRTD     = OFF    ' Data EEPROM Write Protection Disabled
EBTR0    = OFF    ' Table Read Protection Block 0 Disabled
EBTR1    = OFF    ' Table Read Protection Block 1 Disabled
EBTRB    = OFF    ' Boot Block Table Read Protection Disabled
CONFIG_END
'Declare PLL_REQ = On  ' XTAL X 4
'Declare ICD_REQ = On
'Declare CCP2_PIN PORTC.2
Declare OPTIMISER_LEVEL = 6
'Declare FLOAT_DISPLAY_TYPE = LARGE
'Declare FSR_CONTEXT_SAVE = On
'Declare WATCHDOG  = On
'Declare REMINDERS = OFF
'Declare WARNINGS  = OFF
   Declare SERIAL_BAUD = 19200
Declare RSOUT_MODE  = TRUE
Declare RSOUT_PACE  = 1   
'Declare RSIN_PIN    = PORTA.0   
Declare RSOUT_PIN   = PORTC.6
'DECLARE STAMP_COMPATIBLE_SQR = ON                   
Dim CONTROL       As DWord
Dim POSICIONOLD  As Word
 Dim SATURADO    As Bit
 Dim SIGNO       As Bit
 Dim SIGNO_ANTERIOR      As Bit
 Dim SE_PASO          As Bit
 Dim PROPORCIONAL  As Word
 Dim EROR          As  Word
 Dim INTEGRAL      As Word
 Dim INTEGRAL_TEMP As Word
 Dim DERIVATIVO    As Word
 Dim SETPOINT      As Word
 Dim MODULACION As Word
 Dim P  As Word
 Dim I  As Word
 Dim D  As Word

 Dim PPWM        As Byte           
 Dim X           As Byte   
 Dim UP          As Word
 Dim DOWN        As Word
 Dim VELOCIDAD    As Word
 Dim VELOCIDAD_A  As Word
 Dim POSICION     As Word
 Dim POSTEMP      As Word               
 Dim WW1 As DWord
 Dim WW2 As DWord

 
  ' INIT PWM
 CCP1CON = %00001100         ' Set CCP1 to PWM
 T2CON = %00000100      ' Turn on Timer2, Prescale=4
 PR2 = 249               ' Set PR2 to get 1KHz out   
Output PORTC.2
  ' END PWM
 
Dim IMAX As 5000 ' 80
Dim IMIN As 100
Dim COMPL As 512

P = 100'350       310 TO UP     370
I = 10'45                        10
D = 10'200'900 450  200 - 66        180  580
'________________________
POSICION     =  0 '16000' NO MAS DE 16384     16000
TMR0L  = $00
TMR0H  = $00
TMR1H  = 0
TMR1L  = 0
'________________________

SETPOINT      = 1000  ' NO MAS DE 16384   PUSE 18000 ______15700 16300
 POSICIONOLD  = 0
VELOCIDAD     = 0
EROR          = 0
INTEGRAL_TEMP = 0
PROPORCIONAL  = 0
INTEGRAL      = 0
DERIVATIVO    = 0
CONTROL       = 512
SE_PASO = 0
High PORTE.2   
INTCON2.7 = 0 ' PULLUPS   

UP = 0
DOWN = 0
ADCON1 =%110 '18F452
Input PORTA.4
Input PORTC.0
T0CON =%10111000  ' contador eventos
T1CON =%00000011   ' contador eventos

Y:             
' INTERRUPCION DE 5 US  LOW PRIORITY  6000 RPM     ' RB0 AND I/O INTERRUP   MOTOR 2000 RPM JALA OK
'CCP1_PIN = PORTC.2

    WW2.BYTE0  = TMR0L
    WW2.BYTE1  = TMR0H      
    WW1.BYTE0  = TMR1L
    WW1.BYTE1  = TMR1H
   
POSICION  = WW1 - WW2                 '  CALCULA POS
VELOCIDAD =   POSICION - POSICIONOLD  '  CALCULA VELOCIDAD
POSICIONOLD  = POSICION                                     
'RSOut Dec Abs  VELOCIDAD,13
POSTEMP = Abs (POSICION)
RSOut Dec POSTEMP,13
EROR =  SETPOINT  -  POSTEMP 
EROR = Abs EROR
 If    POSTEMP < SETPOINT  Then SIGNO = 0    ' PARA DERECHA O IZQUIERDA
 If    POSTEMP > SETPOINT  Then SIGNO = 1
If EROR > 350 Then
  SATURADO = 1
  GoTo ZZ
Else     
  PROPORCIONAL =  (EROR * P)
  SATURADO = 0
EndIf                                     
    If SIGNO_ANTERIOR = 1 And POSTEMP < SETPOINT Then    INTEGRAL_TEMP = 0 : SE_PASO = 1 ' SI SE PASA DE LA POSICION INTEGRAL               1
    If SIGNO_ANTERIOR = 0 And POSTEMP > SETPOINT Then    INTEGRAL_TEMP = 0 : SE_PASO = 1  ' ACUMULADA = 0 PARA EVITAR ANTIPHASE OSCILATION  0   
          If SATURADO = 0 Then INTEGRAL_TEMP =  INTEGRAL_TEMP + (EROR)               
        If  INTEGRAL_TEMP > IMAX  Then
        INTEGRAL_TEMP = IMAX
        Else
            If INTEGRAL_TEMP < IMIN Then INTEGRAL_TEMP = IMIN
        EndIf
    INTEGRAL =  (INTEGRAL_TEMP * I) /10
                                                                                                    ' RSOUT DEC INTEGRAL_TEMP,13
  DERIVATIVO =   (Abs VELOCIDAD) *  D
If SE_PASO = 1 Then CONTROL =  (PROPORCIONAL  +   INTEGRAL + DERIVATIVO ) ' SI LE FALTA  0 OK     +
If SE_PASO = 0 Then CONTROL = Abs ((PROPORCIONAL +   INTEGRAL)   - DERIVATIVO)  ' SI SE PASO    1  OK    -
SE_PASO = 0
If CONTROL < 1 Then CONTROL = 1
If CONTROL >  64500 Then CONTROL  = 64500 : SATURADO = 1  ' PARA 511
ZZ:
If CONTROL < 1 Then CONTROL = 1
 If SATURADO = 1 Then CONTROL = 60000
CONTROL =  (CONTROL  >> 7)  ' /128 = >> 7
If SIGNO = 0 Then  CONTROL = CONTROL + COMPL       '  OK
If SIGNO = 1 Then   CONTROL =  Abs ( CONTROL - COMPL ) ' OK
                                                                                                     
MODULACION   =    CONTROL
               CCP1CON.4 = MODULACION.0         ' Store duty PWM
      CCP1CON.5 = MODULACION.1         ' a 10-bit
      CCPR1L = MODULACION >> 2
SIGNO_ANTERIOR = SIGNO
' APAGA BANDERA INTERRUPCION
 DelayMS 2
GoTo Y
End
 
 
 
 
 
 

 
 
Logged
anemon06
Newbie
*
Offline Offline

Posts: 33

Thank You
-Given: 32
-Receive: 34


« Reply #5 on: February 05, 2008, 01:34:58 13:34 »

The Control With Dc Motor by Using PWM circuit and proteus simulation
Logged
alpaslan
Junior Member
**
Offline Offline

Posts: 62

Thank You
-Given: 6
-Receive: 48


« Reply #6 on: February 05, 2008, 01:53:05 13:53 »

anemon06,

Can you explain a little bit your work? For example it's usage and system pass?
Logged
fernandodiaz
Junior Member
**
Offline Offline

Posts: 73

Thank You
-Given: 1
-Receive: 18


« Reply #7 on: February 09, 2008, 01:46:32 01:46 »

The control PID is a filter for make fast response in a control system, with optimal adjust, this permit
no make oscilation and fast correction error.
 
The sample write beupper is a control position adjust the gains PID and position and make compile
sample file and see respnse in proteus.
can modify motor torque, encoder resolution, mass efect.
this algoritm is very used in temperature control speed motor control,  position control, lasers figure maker with servo mirrors, cable guide robotics, cnc servo controls, and very much more

see this link
http://en.wikipedia.org/wiki/PID_controller

Posted on: February 07, 2008, 02:09:57 02:09 - Automerged

HERE ONE NEW VERSION MORE SHORT CODE THIS SAMPLE RUN BEST AND MORE FAST 


' MADE IN MEXICO BY FERNANDO DZ.
 ' ESTA ELABORADO PARA EL CONTROL DE POSICION DE UN SERVO DC BRUSH
 ' SI PUEDEN CONTRIBUIR CON UNA MEJORA AL CODIGO  SERIA MUY BUENO.
 ' ES PARA LA COMUNIODAD DE ESTE FORO
 ' ESTA PROBADO CON UN MOTOR MAXON (SUIZA) DE 24 VOLTS Y UN ENCODER DE 500 SLOTS POR REV.
 ' ESTE CODIGO NO EXCEDE 1 K DE MEMORIA POR LO QUE ES MUY RAPIDO DE CORRER
 ' SE PUEDE USAR HPLL EN 48 MHZ PARA CONDICIONES ADVERSAS
 ' USAR EJEMPLO DE MICROCHIP AN696 DSN PROTEUS, VER DATOS DE POSICION ENVIADOS
 ' EN VIRTUAL TERMINAL  PONER PAUSA EN PROTEUS CUANDO SE DETENGA MOTOR
 ' COPIAR LOS DATOS DE LA VIRTUAL TERMINAL
 ' PEGARLOS EN EXCEL, PARA HACER GRAFICA DE LINEAS Y VER RESPUESTA DEL MOTOR.
 ' BEST REGARDS GOOD LOOK
 ' 15.5 KHZ SATURADO 20 US
 ' 6.3  KHZ COMPENSAND0 80 US
Device = 18F452   ' espacio de CWRITE & CREAD 0 32768 0 FFFE      18f4620
XTAL = 48         ' USA 993 BYTES DE MEMORIA   EE
CONFIG_START      ' COMIENZA CONFIGURACION FUSE
OSC      = xt     ' HSPLL CAMBIAR XTAL SPEED
PWRT     = On     ' Power Up Timer Enabled
WDT      = OFF    ' Watchdog Timer Disabled
WDTPS    = 128    ' Watchdog Postscaler: 128 MAX(18F452) 1:256  '8192  16384 32768
LVP      = OFF    ' Low Voltage ICSP Disabled
Debug    = OFF    ' Background Debugger Disabled
CP0      = OFF    ' Code Protection Block 0 Disabled
CP1      = OFF    ' Code Protection Block 1 Disabled
CPB      = OFF    ' Boot Block Code Protection Disabled
CPD      = OFF    ' Data EEPROM Code Protection Disabled
WRT0     = OFF    ' Write Protection Block 0 Disabled
WRT1     = OFF    ' Write Protection Block 1Disabled
WRTB     = OFF    ' Boot Block Write Protection Disabled
WRTC     = OFF    ' Configuration Register Write Protection Disabled
WRTD     = OFF    ' Data EEPROM Write Protection Disabled
EBTR0    = OFF    ' Table Read Protection Block 0 Disabled
EBTR1    = OFF    ' Table Read Protection Block 1 Disabled
EBTRB    = OFF    ' Boot Block Table Read Protection Disabled
CONFIG_END
'Declare PLL_REQ = On  ' XTAL X 4
'Declare CCP2_PIN PORTC.2
'CCP1_PIN = PORTC.2
Declare OPTIMISER_LEVEL = 6
Declare SERIAL_BAUD = 19200
Declare RSOUT_MODE  = TRUE
Declare RSOUT_PACE  = 1   
Declare RSOUT_PIN   = PORTC.6
                 
 Dim CONTROL        As DWord
 Dim POSICIONOLD    As Word
 Dim PROPORCIONAL   As Word
 Dim EROR           As Word
 Dim INTEGRAL       As Word
 Dim INTEGRAL_TEMP  As Word
 Dim DERIVATIVO     As Word
 Dim SETPOINT       As Word
 Dim MODULACION     As Word
 Dim P              As Word
 Dim I              As Word
 Dim D              As Word
 Dim UP             As Word
 Dim DOWN           As Word
 Dim VELOCIDAD      As Word
 Dim VELOCIDAD_A    As Word
 Dim POSICION       As Word
 Dim POSTEMP        As Word               
 Dim SATURADO       As Bit
 Dim SIGNO          As Bit
 Dim SIGNO_ANTERIOR As Bit
 Dim SE_PASO        As Bit

' INIT PWM
CCP1CON = %00001100            ' Set CCP1 to PWM
T2CON   = %00000100            ' Turn on Timer2,    PRESCALE   HZ PWM  @20 MHZ  XX ,11 1250 ,01 5KHZ ,00 20 KHZ
PR2     = 255               ' Set PR2 to get 1KHz out 249 EN 500 Y 255 EN 511                                
MODULACION = 512
CCP1CON.4 = MODULACION.0     ' COLOCA duty PWM  @ 10 BITS
CCP1CON.5 = MODULACION.1     ' 
CCPR1L = MODULACION >> 2     
Output PORTC.2               ' ESTABILIZAR MOTOR  EVITA ARRANQUES ARBITRARIOS
High   PORTE.2 : DelayMS 100 ' ACTIVAR CHIP L6203 PIN  USAR RESISTENCIAS 1K ENTRE PINS DE PIC Y L6203 INPUTS
' END PWM

Dim IMAX  As 5000 ' 80                                 
Dim IMIN  As 100
Dim COMPL As 511  ' ERA 512

P = 150       ' AJUSTAR PROPORCIONAL
I = 100       ' AJUSTAR INTEGRAL
D = 100       ' AJUSTAR DERIVATIVO
'________________________
POSICION     =  32000   ' IN THE MIDDLE WORD VALUE       
SETPOINT      = 35000   ' AJUSTAR SET POINT
CONTROL       = 512
SIGNO         = 0
TMR0L         = $0
TMR0H         = $0
TMR1H         = $0
TMR1L         = $0
VELOCIDAD     = 0
EROR          = 0
INTEGRAL_TEMP = 0
PROPORCIONAL  = 0
INTEGRAL      = 0
DERIVATIVO    = 0
POSICIONOLD   = 0
SE_PASO       = 0
UP            = 0
DOWN          = 0
 
ADCON1    = %110   ' 18F452 ALL DIGITAL
INTCON2.7 = 0      ' PULLUPS 
High  PORTC.6      ' PARA SERIAL
Input PORTA.4      ' CONTADOR DE EVENTOS
Input PORTC.0      ' CONTADOR DE EVENTOS
T0CON =%10101000   ' contador eventos TMR 0 BIT 4 0 LOW TO HI
T1CON =%00000011   ' contador eventos TMR 1
 
Y:             
' INTERRUPCION DE 5 US  LOW PRIORITY  6000 RPM     ' RB0 AND I/O INTERRUP   MOTOR 2000 RPM JALA OK
'UP.LowByte    = TMR1L
'UP.HighByte   = TMR1H
'DOWN.LowByte  = TMR0L 
'DOWN.HighByte = TMR0H
'POSICION =  UP - DOWN
'VELOCIDAD =   POSICION - POSICIONOLD  '  CALCULA VELOCIDAD
'POSICIONOLD  = POSICION                ' ccw positivo  hasta 32768
'________________________________________________________________

VELOCIDAD     =  DOWN
VELOCIDAD     =  VELOCIDAD - UP
UP.LowByte    = TMR0L
UP.HighByte   = TMR0H
DOWN.LowByte  = TMR1L
DOWN.HighByte = TMR1H
VELOCIDAD = VELOCIDAD  + UP       ' en los dos casos el num es negativo
VELOCIDAD = VELOCIDAD  - DOWN     'OBTENER VAL ABSOLUTO DE VELOCIDAD PARA MOSTRAR CORRECTAMENTE
POSICION = POSICION + VELOCIDAD   'POSICION ABS - 32768 PARA MOSTRAR CORRECTAMENTE
POSTEMP =     POSICION            ' 0 - 65535
'RSOut Dec UP,13
'RSOUT DEC DOWN,13
                                                                                                '   RSOut Dec POSTEMP ,13
                                                                                                EROR =  SETPOINT  -  POSTEMP 
EROR = Abs EROR
 If    POSTEMP < SETPOINT  Then SIGNO = 0 ': Low PORTE.0   ' PARA DERECHA O IZQUIERDA
 If    POSTEMP > SETPOINT  Then SIGNO = 1 ': High PORTE.0

If EROR > 255 Then
  SATURADO = 1
  MODULACION = 512
  High PORTE.0
  GoTo HASTA_LA_MADRE
Else
   Low PORTE.0   
  PROPORCIONAL =  (EROR  * P)' >> 1                                                                  RSOut Dec PROPORCIONAL,13
  SATURADO = 0
EndIf
                                   
    If SIGNO_ANTERIOR = 1 And POSTEMP < SETPOINT Then  INTEGRAL_TEMP = 0 : SE_PASO = 1  ' SI SE PASA DE LA POSICION INTEGRAL              1
    If SIGNO_ANTERIOR = 0 And POSTEMP > SETPOINT Then  INTEGRAL_TEMP = 0 : SE_PASO = 1  ' ACUMULADA = 0 PARA EVITAR ANTIPHASE OSCILATION  0   
          If SATURADO = 0 Then INTEGRAL_TEMP =  INTEGRAL_TEMP + (EROR)               
        If  INTEGRAL_TEMP > IMAX  Then
        INTEGRAL_TEMP = IMAX
        Else
            If INTEGRAL_TEMP < IMIN Then INTEGRAL_TEMP = IMIN
        EndIf
'                                                                      RSOUT DEC INTEGRAL_TEMP,10
INTEGRAL =    (INTEGRAL_TEMP >> 6)  * I    ' >> 6 ' /64                                                                                                   
DERIVATIVO =   Abs ((VELOCIDAD * D) << 3)  ' << 3   ' VELOCIDAD * 8  << 8
                                                                                              '     RSOUT DEC  INTEGRAL , 13   
                                                                                             '     RSOUT DEC DERIVATIVO,13                                                                                           
If SE_PASO = 1 Then CONTROL =  (PROPORCIONAL  +   INTEGRAL + DERIVATIVO )       ' SI LE FALTA   OK   +   1 baja mejor
If SE_PASO = 0 Then CONTROL = Abs ((PROPORCIONAL +   INTEGRAL) - DERIVATIVO)    ' SI SE PASO     OK  -   0 baja mejor
SE_PASO = 0
If CONTROL >  65535 Then CONTROL  = 65535 : SATURADO = 1  ' PARA 511
CONTROL =  (CONTROL  >> 7)  ' /128 = >> 7    '  2 4 8 16 32 64 128 256   ' OK
MODULACION =  CONTROL
HASTA_LA_MADRE:                           
If SIGNO = 0 Then   MODULACION =      (MODULACION + COMPL)  ' OK   0
If SIGNO = 1 Then   MODULACION =  Abs (MODULACION - COMPL)  ' OK   1
                                                                                                 '  RSOut Dec MODULACION,13
'MODULACION = 512 ' 412 - 612 PARA TEST   1023 MAX
       CCP1CON.4 = MODULACION.0         ' Store duty PWM
      CCP1CON.5 = MODULACION.1         ' a 10-bit
      CCPR1L = MODULACION >> 2
SIGNO_ANTERIOR = SIGNO
' APAGA BANDERA INTERRUPCION
 DelayMS 3
GoTo Y
   
End
 
 
Logged
malibus
Newbie
*
Offline Offline

Posts: 10

Thank You
-Given: 1
-Receive: 4


« Reply #8 on: February 09, 2008, 04:53:55 16:53 »

... HERE ONE NEW VERSION MORE SHORT CODE THIS SAMPLE RUN BEST AND MORE FAST  ...
 

this is interesting for me, but with which compiler I could compile this code?
Logged
Robi
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 54
-Receive: 1


« Reply #9 on: February 09, 2008, 05:11:59 17:11 »

Looks like Proton+ Basic Compiler.
Logged
fernandodiaz
Junior Member
**
Offline Offline

Posts: 73

Thank You
-Given: 1
-Receive: 18


« Reply #10 on: February 09, 2008, 08:43:43 20:43 »

WE CAN ADDDING A/D CONVERTION 10 BIT  AND ADVAL PUT IN SETPOINT
WHEN TURN THE POT  THE SERVO MOTOR TURN FOR LEFT O RIGHT VERY FAST
AND PUT 3 POTS FOR MODIFY THE GAINS TO CONECT PIC READ POTS AND
P I AND D   IN 8 BITS A/D  STORE YHE VALUE IN  THE VAR.
ONLY WHEN  CONECT THE PIC MAKE READ GAINS P I D
AND  OTHER READ 10 BIT POR FOR MODIFY THE POSITION.


Compile with proton+ 
Some little modification for compile with picbasic pro
change dword for word
disable optimizer level
and config switchs programming
remplace rsout for serout
quit declares

change delayms for PAUSEMS
MODIFY ALL  DIM  XXXXX AS WORD  FOR  XXXXX VAR WORD

REMPLACE
Dim IMAX  As 5000 ' 80                                 
Dim IMIN  As 100
Dim COMPL As 511

FIND IMAX IMIN COMPL AND REMPLACE FOR VALUES
AND COMPILE THIS  AND NO PROBLEM 

I NOW  WORK WITH OTHER SAMPLE  PIC18F2331  THIS PIC WITH INTERNAL QUADRATURE DECODER (QEI) IS MORE SHORT THE CODE
AND PWM COMPLEMENTARY 
Logged
malibus
Newbie
*
Offline Offline

Posts: 10

Thank You
-Given: 1
-Receive: 4


« Reply #11 on: February 10, 2008, 04:00:09 16:00 »

I would want to ask also if the schematic diagram for this code is  identical to the schematic in AN696?
How i can implement inputs  for step and direction on the board.
Logged
fernandodiaz
Junior Member
**
Offline Offline

Posts: 73

Thank You
-Given: 1
-Receive: 18


« Reply #12 on: February 11, 2008, 04:19:54 04:19 »

YES THE DIAGRAM IS IDENTICAL TO AN696
YO CAN IMPLEMENT USING SERIAL PORT USART, AD CONVERSION INPUT, INTERRUPT PIN  CHANGE FOR INCREMENT AN DECREMENT SETPOINT, GAINS
FOR MODIFY SETPOINT AND GAINS SAMPLE :  WHEN ADCIN = 0 SETPOINT = 100, WHEN ADCIN = 1023
SETPOINT = 65000, CEN MAKE ANY SCALING
OTHER SAMPLE WHEN RX USART = SP100  SETPOINT = 100 WHEN RXUSART = SP65000 SETPOINT = 65000.

IS VERY EASY....
Logged
ipek
Junior Member
**
Offline Offline

Posts: 95

Thank You
-Given: 59
-Receive: 79


« Reply #13 on: February 15, 2008, 05:17:37 05:17 »

DC Motor and PWM.rar  projects
user entry code default   2023 
entry key & menu change*
enter #
user code easy find simulated isis pause and look eeprom table....
Logged
djohn
Newbie
*
Offline Offline

Posts: 28

Thank You
-Given: 8
-Receive: 19


« Reply #14 on: February 15, 2008, 03:56:35 15:56 »

Hi, Has anyone tried the USB Raw implementation of LabVIEW for controlling generic USB devices. I have been 18F4550, but having problems.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC