Shop OBEX P1 Docs P2 Docs Learn Events
Max speed issue (direction switching) with Parallax Motor Mount/position contro — Parallax Forums

Max speed issue (direction switching) with Parallax Motor Mount/position contro

bulkheadbulkhead Posts: 405
edited 2008-12-08 00:03 in Robotics
When the maximum travel speed is set faster than the motor can physically travel at, the motor will run at full speed for a few seconds, then suddenly (instantaneously, no ramping) switch directions and rotate for a few more seconds, the switch back again in an ongoing cycle. The time period between subsequent direction switches appears to increase after each direction switch.

Is this a known issue or is there something else wrong?

Edit: I'm using the Parallax 12V motors/position controller combo with the HB-25.

Post Edited (bulkhead) : 12/7/2008 11:31:50 AM GMT

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-12-07 02:50
    Could we see your code?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2008-12-07 04:09
    Sounds like a power supply problem, possibly resetting the controller. Neither the speed controller nor the HB-25 "know" how fast the motor can go. Probably the current drain of the motor peaks as it reaches maximum speed with friction increasing the mechanical load on the motor.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-12-07 04:42
    bulkhead,

    What is the current rating of your motor?

    Besides motor abuse, throwing a motor into reverse like that can send current surges at least twice the motor rating if not more through the motor controller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • bulkheadbulkhead Posts: 405
    edited 2008-12-07 11:28
    I'm sorry if I wasn't clear before but I am using the Parallax 12V motor kit. The HB-25's each have their own set of batteries that are isolated from the main microcontroller (Propeller protoboard). The position controllers are powered from the +5V on the protoboard. I just verified that they aren't resetting when the motor reverses direcitons; the position count from the encoder still continues (just in reverse direction) and the Propeller is still outputting debug info to the terminal.

    I generated the problem by setting a value of 100 counts per half second as the max speed and then setting a distant position (10,000) for the motor to go to, where the actual maximum speed achievable by the motors is around 48 counts per half second (determined by querying the speed). Setting lower maximum speeds below 48 results in the motors functioning properly, as far as I could tell. Does this happen to anyone else?

    Right now I'm setting a max speed below 48 so I don't run into this issue; everything else is working fine. Also, this problem occurs with both of the motor/position controller/hb-25 sets, left and right.
  • GWJaxGWJax Posts: 267
    edited 2008-12-07 14:56
    PM Stampnuts about this and see if he can duplicate your program since I know he has the parts needed to run your code and setup and make sure you tell him I sent you to him as we are both are firends and we can work out your problem togeather or it just may be that the 48 counts per sec is all you can do with these motors.

    Jax

    ps please send me your code as well so I can look at it and make changes to it just incase. PM me and I'll send you my personal e-mail

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • bulkheadbulkhead Posts: 405
    edited 2008-12-07 20:44
    Jax, I just attached a short test program that generates the error for me. It won't compile until you fill in the pin # for the FullDuplexSerial uart.

    Here is the basic code that generates the problem:
    CON     
    
       'position controller commands
      TRVL = %00100_000
      SMAX = %01000_000
     
    ...
    
         motorUart.start(9,9, %1100, 19200)
        
        'set max speed to 100 counts/half second    
        motorUart.tx(SMAX) '0 device ID, so send to all devices
        motorUart.tx(0)
        motorUart.tx(100)
    
        'set distant position to travel to (40*256 =10240)
        motorUart.tx(TRVL) '0 device ID, so send to all devices     
        motorUart.tx(40)
        motorUart.tx(0)
    
  • GWJaxGWJax Posts: 267
    edited 2008-12-08 00:03
    I'll look over this program and see if anything pops out at me inwhich woud cause your problem. Since StampNuts lives in NZ he won't get your message until around 11 or 12pm tonight EST but I can catch up with him in the morning before he goes to bed.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
Sign In or Register to comment.