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

    i dont really know whats going on... ive been playing with it for a bit this weekend, and something funny is going on..

    when i hold the board about 2" above the motors, everything works fine, if its closer, it will start to speed up, and then just completely stop, and wont reset.

    if i plug in my serial LCD and keep the board 2" away from the motors, they run fine, but the LCD will work for a bit, then go blank, and then work a bit more, and go blank and then work more.

    with the board beside the motors, the LCd will start, go all black, and then come back and the motors will stop. then the lcd will keep displaying the speed variable changing, so somewhere in there, i think the motor reset is being tripped and its not restarting.

    heres a tiny bit of my code...





    baudLCD CON 32 'baud rate for lcd
    lcd VAR PORTF.0 'serial lcd port
    motor VAR PORTD.0 'serial motor port
    motorreset VAR PORTE.7 'reset pin For motor controller
    baudmotor CON 84 'baud rate for motor
    LBAK CON 1 'left backwards
    LFWD CON 0 'left forwards
    RBAK CON 3 'right backwards
    RFWD CON 2 'right forward
    speed VAR BYTE



    start:

    High lcd
    High motor
    High motorreset

    SerOut2 lcd, baudlcd,[254,"G",1,1,"Treadbot"] 'display treadbot on lcd in position 1,1

    Pause 1000

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

    Pause 10000
    'drive at full speed for 10 sec
    For speed = 80 TO 1 STEP - 1 'slow down motor until stop
    SerOut2 lcd, baudlcd,[254,"G",1,4,#speed," "] 'display speed var on LCD in position 1.4
    SerOut2 motor, baudmotor, [$80, 0, lfwd, speed] 'left motor forward
    SerOut2 motor, baudmotor, [$80, 0, rfwd, speed] 'right motor forward
    Pause 150
    Next

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


    Did you find this post helpful? Yes | No

    Default

    I built a walking (biped) robot and had trouble with motor noise causing the A/D signals to vary. (I use two A/D inputs to read pots coupled to the legs for position information.) Adding .1uf caps from each motor lead to the motor's case solved the problem.

    My motors are the cheaper hobby motors used with the Tamiya double gearbox. If you are using the Pololu serial motor controller they recommend the caps too. I use an analog H bridge and still had noise issues even with seperate motor and logic batteries.

    I don't know if it will help you but it is something to try....

    By the way, you did an excellent job on the project, I hope it works out.
    --John

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


    Did you find this post helpful? Yes | No

    Default

    thanks for the compliment John, i have added the caps across one motor, and just forgot about the other motor. i usually add one from each lead to the case, and another across both leads. its one of those things i picked up from RC cars and planes.

    heres a picture of one of my motors ontop of the scroll wheel on my mouse. i cant remeber if i posted it before, but here it is again..



    i would like to see a pic of that biped if you have any.. its one thing i want to do eventually. heres a hexapod i made, its kinda the same as the Lynxmotion hexapod.

    Last edited by dragons_fire; - 8th May 2007 at 02:28.

  4. #4
    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...

  5. #5
    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.

  6. #6
    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...

  7. #7
    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.

  8. #8
    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...

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