Recommendations - Model Train Controller


Closed Thread
Results 1 to 40 of 102

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    as long as the POT impedance meet the maximum recommended.. it shouldn't be much of a problem.

    What happen to your supply when you plug your loco directly?

    Now, If you add 1 or more?

    Now do the same but add your transistor to drive them.. what happen?

    i got my few motor here, i'll do some test later.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Well well well... running 3 different Motor type from 500mA to 10A @12Vdc.. and a pretty messed up breadboard + Jumper it works

    2 channel PWM... all square...

    3 pwm ... still the same, life is good

    BUT... when you add ADCIN 4, DutyVar4... somethings goes bad....

    Do one test with anything matched with ADCIN 4... something go really bad... where it comes from... i don't know for now.

    Same thing happen if you do something with DutyVar4...

    scratch scratch scratch
    Last edited by mister_e; - 17th February 2007 at 19:26.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Everything just fine using...
    Code:
    @ __CONFIG  _HS_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_OFF 
    
    
    ANSEL = %00010111    ; - dt suggested value
    
    
    
    DEFINE OSC 20
    CMCON=7
    TRISA=%11111111        'set PORTA as all input 
    TRISC=%00000001        'set PORTC as all output apart from RC0
    
    DEFINE ADC_BITS  8     ' ADCIN resolution  (Bits)
    DEFINE ADC_CLOCK 2     ' ADC clock source  (Fosc/32)
    DEFINE ADC_SAMPLEUS 11 ' ADC sampling time (uSec)
    
    INCLUDE "DT_INTS-14.bas"            ; Base Interrupt System
    INCLUDE "SPWM_INT.bas"              ; Software PWM module
    
    DEFINE SPWM_FREQ  150                ; SPWM Frequency
    DEFINE SPWM_RES   255               ; SPWM Resolution
    
    DutyVar VAR byte[4]
    
    ASM
    SPWM_LIST  macro                    ; Define Pin's to use for SPWM
        SPWM_PIN  PORTC, 2, _DutyVar   ; and the associated DutyCycle variables
        SPWM_PIN  PORTC, 5, _DutyVar+1   ; Notice the underscore before variables
        SPWM_PIN  PORTC, 4, _DutyVar+2
        SPWM_PIN  PORTC, 3, _DutyVar+3
      endm
      SPWM_INIT  SPWM_LIST              ; Initialize the Pins
    ENDASM
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1_INT,  SPWMhandler,  ASM,  yes
        endm
        INT_CREATE                      ; Creates the interrupt processor
    ENDASM
    
    @ INT_ENABLE  TMR1_INT              ; enable Timer 1 interrupts
    
    ;_____________________________________________________________________________
    
    Main:                               
     ADCIN 0, DUTYVAR[0]
     ADCIN 1, DUTYVAR[1]
     ADCIN 2, DUTYVAR[2]
     ADCIN 4, DUTYVAR[3] 
     GOTO Main
    GO GO GO FIGURE IT
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Microstepper controller
    By aratti in forum Schematics
    Replies: 14
    Last Post: - 3rd January 2015, 16:52
  2. problem with the GSM controller
    By Dariolo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th May 2009, 20:33
  3. Replies: 2
    Last Post: - 14th July 2008, 22:11
  4. Model Train controller - revisited
    By malc-c in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 8th May 2007, 09:40
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts