Shop OBEX P1 Docs P2 Docs Learn Events
Need Help with BS2 connected to a motor controller — Parallax Forums

Need Help with BS2 connected to a motor controller

BaldenBalden Posts: 4
edited 2008-08-07 00:32 in BASIC Stamp
Hi. I have a bs2 in a board of education. I want to program my RC car's Brush motor to run. I have a motor controller by NOVAK. It is the XRS sport reversible motor controller. I am not sure how to program the motor speed controller with the basic stamp 2. I can control the steering servo motor no problem however. Can someone help me? I added pics so you can get an idea. Thanks
2576 x 1920 - 1M
2576 x 1920 - 1M
2576 x 1920 - 1M
2576 x 1920 - 1M
2576 x 1920 - 1M

Comments

  • BaldenBalden Posts: 4
    edited 2008-08-06 04:44
    Here is some practice code I tried. The motor turns on then slowly slows down. Then it barely moves and just makes noise. Can someone tell me what is going on? Any feedback or questions would help.



    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    speed VAR Byte
    HIGH 14
    LOW 15
    HIGH 15
    PAUSE 100

    FOR speed = 0 TO 127
    SEROUT 14,84,[noparse][[/noparse]$80,0,0,speed]
    PAUSE 20
    NEXT
    FOR speed = 127 TO 0
    SEROUT 14,84,[noparse][[/noparse]$80,0,0,speed]
    PAUSE 20
    NEXT
    FOR speed = 0 TO 127
    SEROUT 14,84,[noparse][[/noparse]$80,0,1,speed]
    PAUSE 20
    NEXT
    FOR speed = 127 TO 0
    SEROUT 14,84,[noparse][[/noparse]$80,0,1,speed]
    PAUSE 20
    NEXT
  • BaldenBalden Posts: 4
    edited 2008-08-06 05:42
    I think I have narrowed it down. Here is the million dollar question. A receiver inputs some impulses or logic to the motor controller which makes the motor accelerate, or decelerate or go reverse or forward correct? So, how do I mimic what a receiver inputs exactly for this device? I have researched and experimented and analyzed this problem and I still not getting my machine to operate very good. Hope to hear some good advice when I wake up. Thanks and good night.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-08-06 06:38
    Balden -

    Good analysis of the problem. You can mimic those pulses with the PULSIN and PULSOUT commands.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON

    Post Edited (Bruce Bates) : 8/6/2008 10:06:52 AM GMT
  • BaldenBalden Posts: 4
    edited 2008-08-06 23:46
    Figuring out now the exact PWM that a reciever sends to the motor controller. For example, full throttle foward, and full throttle reverse. What would be the Pulse width, and Pulse duration?
  • FranklinFranklin Posts: 4,747
    edited 2008-08-07 00:32
    Well, it looks like it hooks up to the receiver like a servo so I would start with sending it pulses between 1ms and 2 ms with a pause between pulses of 20ms. This is what works for servos and you will have to test and adjust these valuse for your hardware but that should give you a place to start.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.