Shop OBEX P1 Docs P2 Docs Learn Events
HB-25 and reversal of direction — Parallax Forums

HB-25 and reversal of direction

qdennisqdennis Posts: 5
edited 2008-08-01 17:18 in General Discussion
I am interested in using the HB-25 as I add motors to a system I am building. They will be used to control trolleys that move back and forth on a track in a continuous fashion, with a smooth change of direction.

If the motor is running in one direction and I send a command to run in the other direction, does the HB-25 handle all this internally upon receipt of the new command? I can see that this is a peak current situation but are there other issues?

Thanks in advance
Quitman

Comments

  • DgswanerDgswaner Posts: 795
    edited 2008-08-01 15:21
    yes what you do is set a ramp rate, before you send the direction change. this can be done as you initialize the object or at any time during operation.

    if your current speed is 2000, and you change direction and speed to 500, the ramp rate is the increment rate to reach the desired speed, which is handled all on the HB-25.it's handled in the object so if your ramp rate is 50, the HB-25 speed drops by 50 until it reaches the desired speed...... 2000, 1950, 1900, 1850....down to 500. I don't know the time interval between changes but it is quick.


    added
    sorry, I forget that not every one is using the propeller.

    hope that helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner

    Post Edited (Dgswaner) : 8/1/2008 4:37:59 PM GMT
  • qdennisqdennis Posts: 5
    edited 2008-08-01 15:46
    Ramp rate is an interesting property but I have not seen reference to it·in the doc that I found so far. Is there doc that I have not seen?

    Thanks
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-08-01 16:01
    Ramping is not an integral part of the HB-25. On a BASIC Stamp it is done (as in the demo code) using a FOR…NEXT loop to send successive pulse values to slow and stop the motor before ramping it up in the other direction. Without doing this, if you simply change direction, the motor will, just as quick. This would most likely result in a very high current spike. You would need to determine if that spike was within the 35A capability of the HB-25. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • qdennisqdennis Posts: 5
    edited 2008-08-01 16:25
    Chris, thanks. I can code that and actually like the approach. I will order one and do it.

    Thanks
    Quitman
  • DgswanerDgswaner Posts: 795
    edited 2008-08-01 16:31
    oh, sorry about that... I forgot that objects/separate cogs of the propeller take care of it not the HB-25 but I'm pretty sure the new 12V motor controllers do.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner

    Post Edited (Dgswaner) : 8/6/2008 6:46:40 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-08-01 17:18
    Correct, the wheel controllers handle that, as does the Propeller Object, however for general use from a BASIC Stamp the example code gives a simple demo of it. It’s easy to code variables into the routine so that, regardless of what speed you’re going or even if you’re stopped, that you ramp to/from those points with a simple subroutine. If you need an example I could provide one for ramping to/from arbitrary points (pulse values).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.