Model Train controller - revisited


Closed Thread
Results 1 to 33 of 33

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Oh and one other thing I've noticed,which may be causingn the PIC to bomb is when the when the wiper is at the top and thus connected to the 5.21v supply the pulses stop and the voltage out drops, and on some occasions this has caused the driver to sort of lock as moving the pot after the effect has no effect as the PMW generation has stopped. Is there a way of setting the voltage ref or ADC value so that a PMW signal is always produced ?

    Edit:
    maybe this video might help explain (2.2 MB Divx format) http://www.micro-heli.co.uk/scope4.avi
    Last edited by malc-c; - 22nd April 2007 at 20:00.

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


    Did you find this post helpful? Yes | No

    Default

    The weird results you have is probably caused by the delay to do the calc... well i think.

    Don't try the Resistor... i was 100% wrong.. it's not going to be LOG... just alog... as per i got from EXCEL... so just worst than before

    <img SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1557&stc=1&d=117726977 2">

    oops, it's sunday

    ...mmm something to do anyway with that... scratch scratch...
    Attached Images Attached Images  
    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

    What happen to your PWM lock-up thingy if you replace the Motor by a resistor? I don't see any back EMF diode here...

    EDIT: check the maximum range of your scalling maths

    EDIT2: well it's really sunday !!
    Quote Originally Posted by Malc-C
    However, the amount of rotation of the pot is quite small before the loco is up to a medium speed.
    so if i'm right... the curve above should work?

    do i need to sleep or get another brain? I've attach my noobie-style excel sheet.

    Just play with the Value in D1 cell and enjoy.
    Attached Files Attached Files
    Last edited by mister_e; - 22nd April 2007 at 20:49.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Hi again Steve,

    The EMF feedback was removed following a suggestion from Alain in the original thread ( http://www.picbasic.co.uk/forum/show...0&postcount=46 )

    Could you elaborate on the scaling thing...

    I'll have a play with the speadsheet and add a few resistors in parallel to see what happens. It will probably won't be tonight as I don't have access to the loco anymore (It shot off the end of the test track and now boxed up as it is in need of repair, and my son has gone to bed now so I can't get one of the other locos !)

    Sorry guys for going over this again, but I still cant get my head round some of these aspects of programming.

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


    Did you find this post helpful? Yes | No

    Default

    Well sticking a 1K in parallel with the wiper and gnd does show a great improvement on the scope trace... will just have to wait to see how it performs with a loco

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    Well sticking a 1K in parallel with the wiper and gnd does show a great improvement on the scope trace... will just have to wait to see how it performs with a loco
    Woohoo! Sweet! now depending what you need, 2-3K curve seems nice to me... but i'm not the guy who drive this loco
    Steve

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

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


    Did you find this post helpful? Yes | No

    Wink Archives !

    Hi, Malc

    I do not know wich pic you really use ... but if it is the same as in your Listing ( 16F767)

    you should have a look to Post #8899 from Bruce ... ( Jul 2003 )

    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    o.k. i see, from your previous schematic the Back emf diode where installed in a weird way, maybe why Alain suggested that. The diode should be in parallel with your motor. Like when you drive a Relay. It's not a bad thing to install a capacitor as well.

    Do the calc of Alain's routine with some ADC value. The results have to be bellow 255 or at very least bellow SPWM_RES value... i didn't did it here, but just for safety sake you should check that.
    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. Graphics controller for the Sitronix ST7549
    By ttease in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th May 2007, 21:45
  4. Recommendations - Model Train Controller
    By malc-c in forum mel PIC BASIC Pro
    Replies: 101
    Last Post: - 8th March 2007, 08:17
  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