TreadBot


Closed Thread
Results 1 to 40 of 177

Thread: TreadBot

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    so... i havent forgotten about this, im still working on it. I have just had a lot of work and other stuff to do lately. when i use:

    For speed = 0 TO 80
    'speed up motor to full speed
    SerOut2 lcd, baudlcd,[254,"G",1,4,#speed," "]
    'display speed on lcd
    SerOut2 motor, baudmotor, [$80, 0, lfwd, speed]
    'left motor forward
    SerOut2 motor, baudmotor, [$80, 0, rfwd, speed] 'right motor forward
    Pause 150
    next

    both motors will speed up to around 45 or 50, and then just shut off. nothing seems to be overheating, and the voltage doesnt drop. the PIC still keeps running because the LCD will still show the Speed Variable increasing. i have tried pulling the reset pin low and then high again at the end of each cycle of code, but that doesnt help either.

    if i tell it "speed = 80" then it will run fine, and have no problems.. i think maybe there is an issue with the motor controller recieving too many serial commands in such a short time, or something is getting messed up in the commands.

    do hopefully by the weekend, i will have the ultrasonic sensor working and it driving around...

    thanks for all the advice everyone...

  2. #2
    Join Date
    Mar 2007
    Location
    Boston, MA USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    If you are using the Pololu motor controller, make sure it's reset pin is held high. If it dips to 0V, it will reset the controller to its inital state (motors off).

    If you are using the Pololu Low voltage Dual serial controller:
    The green leds on the controller should also be on for forward settings, see if they are still on when the problem occurs.

    It looks like you have enough of a delay after the motor serial commands.

    --John
    Last edited by JohnH; - 17th May 2007 at 10:31.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Maybe try a little bit of 'DEFINE CHAR_PACING'?
    It add x ms between serial characters on the output.
    Maybe at the higher settings it doesn't like having x characters in a short amount of time...who knows...

  4. #4
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    yeah, i have been keeping the reset pin high. i have also tried to reset it after every loop...and i can get it to slow down from 80 to 0 using the same program without a problem.

  5. #5
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    so i got the motors workign by changing the caps across the leads. i found out a couple days ago that the drawers i keep my caps in got messed up, so i ended up putting in 22pf caps instead of 1uf caps.

    so now i added on the parallax ping ultrasonic sensor, and its messing something up. heres the short code for the sensor:

    PulsOut ultra, 5
    PulsIn ultra, 1, ping

    "ultra is the port, and ping is the distance variable. the pulsin line seems to work, and the LED lights on the ping sensor, but everytime i send the pulsout command, it sends wierd characters to the LCD, and the "ping" variable doesnt change from 0.... the LCD is on portf.0 and the ping sensor is on portf.1.... the traces are fairly far apart, and there is nothing touching them.

    if i delete the pulsout line, everything displays where its supposed too, and the ping var = 0...

    i know i didnt describe it the best, but if anyone has any ideas, please let me know...

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dragons_fire View Post
    so now i added on the parallax ping ultrasonic sensor, and its messing something up. heres the short code for the sensor:

    PulsOut ultra, 5
    PulsIn ultra, 1, ping

    "ultra is the port, and ping is the distance variable. the pulsin line seems to work, and the LED lights on the ping sensor, but everytime i send the pulsout command, it sends wierd characters to the LCD, and the "ping" variable doesnt change from 0.... the LCD is on portf.0 and the ping sensor is on portf.1.... the traces are fairly far apart, and there is nothing touching them.

    if i delete the pulsout line, everything displays where its supposed too, and the ping var = 0...
    Those ultrasonic transducers generate some fairly high voltages while doing their work. I can easily see one of those dumping current across traces and causing your problems. Maybe try putting a series resistor inline with portf.0 and see what happens. Don't run the transducer, start low on the resistance, work your way up until the LCD doesn't work anymore, then back off one or two values. Then fire up the transducer and see what happens...
    Have you ever been 'bit' by one? I wouldn't touch the bare metal on it while it's doing it's 'transducing'.

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Did you set the ultra pin to 0 before using Pulsout?

    Pulsout works by toggling the pin twice. To get positive pulses, the pin needs to be set low first. (if it wasn't already there)
    <br>
    DT

  8. #8
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    yes, i took it low before doing anything. heres a little more of the code:



    trigger con 5
    baudLCD CON 32 'baud rate for lcd
    lcd VAR PORTF.0 'lcd port
    ping VAR byte
    ultra VAR PORTF.1
    PORTF.1 = 0
    ping = 0


    SerOut2 lcd, baudlcd,[254,"G",1,1,"Ping Test"] 'display test on lcd in position 1,1

    start:
    Pause 1000

    PulsOut ultra, trigger 'send trigger to ping
    PulsIn ultra, 1, ping 'wait for ping variable

    Pause 1000
    SerOut2 lcd, baudlcd,[254,"G",2,2,#ping," "] 'display pin var in position 2,2

    GoTo start
    End



    so wheni take out the "pulsout ultra, trigger" line, everything works great (except the ping sensor cause it doesnt get its pulse). i added in long pauses so i could tell where the problem is. my LCD will display "ping test" in the correct position, then waits a second, displayes a wierd character, waits another second and then displays a couple wierd characters and then the ping variable. when it shows the wierd characters and ping variable, it just adds them right behind "ping test", not in the position its supposed to be in..

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