Recommendations - Model Train Controller


Closed Thread
Results 1 to 40 of 102

Hybrid View

  1. #1
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Nice !

    I was hoping for something with a component count in single figures

    Seriously though, thanks for the drawing - I'll have a study in detail later

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default the idea

    hopefully the attached image will try to get over my idea. By adjusting VR1 the resulting value is used to adjust the PPM output on RB0 which (via the power tranny) is fed to the tracks.
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    I would use PNP over NPN for that... Depending the current needed, Some P-Channel mosfet.
    Last edited by mister_e; - 9th February 2007 at 14:51.
    Steve

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

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Cool

    Driving a '3055 straight from the PIC port ...

    Interesting idea ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    The diagram was for example only, I intend to use FETs for the driver (They work fine driven directly from a PIC) - If I was going to use a 3055 I would use a GP NPN tranny and connect the two in an emitter follower fashion.

    I'm really after your comments on using a PIC's A/D to control the output PW modulation..

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Think simple ...

    Hi, Malc

    Why not simply use RCTime to read your pots ...

    That would allow "simple" pics like '84 or '628 ... even 648 !!! ... just because of the pincount !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Alain,

    One step ahead of you... I'm using a 16F828a and set up a 100K lin pot and 0.1uf capacitor, and a simple bit of code.. but can't get it to work (just slung it together in the past 5 mins)

    The code compiles, but I don't get any PWM on the output (using a LED for test purposes at the moment - no FET connected.)

    10k between MCLR and +5v, input from the pot to A2

    Here's the code

    Code:
    ;************ set up PIC *****************
    PORTA = 0                        ' declare port level BEFORE port direction = safe power-on
    CMCON = 7                        ' PortA Digital inputs
    CCP1CON = 0                      ' PWM off
    VRCON = 0                        ' Voltage reference disabled
    OPTION_REG.7 =    0
    
    
    TRISA=%11101111                  'set PORTA as all input apart from A4
    TRISB=%00000000                  'set PORTB as all output
    
    @RC_OSC_NOCLKOUT 
    @WDT_ON
    @PWRT_ON
    @MCLR_OFF
    @BOD_ON
    @LVP_OFF
    @CPD_OFF
    @PROTECT_OFF
    
    ;************* set up varibles ************
        
    D var byte                          ;used to store the result of the pot on port A2
    scale var byte                      ;used in the POT command
    Scale = 254                         ;used to set range 
                                                                
    ;************* main program ****************
    Main:                         
    Pot PORTA.2,scale,D                 ;used to read value from pot
    pwm PORTB.4,D,1
    Goto main
    The main loop is self explanatory, port A2 is checked and the result is placed in the variable D, this is used to set the width of the PWM sent out on pin B4

    Any ideas why I can't get it to work
    Last edited by malc-c; - 10th February 2007 at 15:44.

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