Shop OBEX P1 Docs P2 Docs Learn Events
Can a BS1 talk to a continous rotation servo? — Parallax Forums

Can a BS1 talk to a continous rotation servo?

Hello!
This being the boring end of Winter I am off on a predictably strange project. It was inspired by this article in Ars Technica from last month, "Autonomous battery-powered rail cars could steal shipments from truckers"
And the idea was to have the container shown in the photo be made up out of Lego and use ordinary Lego wheels to make up for the train trucks. Power would be supplied by those Lego compatible servos that were discussed on the Forum not too long ago, and of course I asked the same idea here

Nothing much happened with me then, because as all of us can imagine I ran out of steam as it were to move further along.

But picture this, the container made up of Lego houses a BS1 and its project board and power source for both itself and the servo. That rests on eight wheels. Poking out of the back and resting on the floor for example is that same Lego compatible servo from Brown Dog, and attached to it as an appropriate wheel. Which of course I am still looking for. When started it would continue rolling along until it meets the end of the travel space.

Again at the moment that's all being considered.

Comments

  • Ah ... the old reliable BS1. You betcha it will talk to a continuous motion servo. It's the same pulses that are used to talk to a standard servo except that the width of the pulse specifies the speed and direction of the servo rather than the position of the servo..

  • Buck,

    Assuming this is what you have, it is NOT a continuous rotation servo, but only moves 90 degrees.
    LEGO Power Functions 88004 Servo Motor
    https://www.lego.com/en-us/product/power-functions-servo-motor-88004

    However, some on the Adafruit forum said that they got it to rotate using a Adafruit Motor Shield V2 on an Arduino.
    They couldn't control the speed but it rotated which is what I assume that you want.
    https://forums.adafruit.com/viewtopic.php?t=62325
    https://forums.adafruit.com/download/file.php?id=19516&sid=5a9906842e68f7ce7bd51dd935109b5b

    #include <AFMotor.h>
    
    Lego motor (15,1);
    
    void setup()
    {
    Serial.begin(9600);
    motor.setSpeed (10);
    }
    
    void loop()
    {
    motor.step(1,FORWARD, single);
    motor.step(1, BACKWARD, single);
    }
    

    Instead of a L293D darlington driver, we now have the TB6612 MOSFET drivers.
    Motor Port 1

  • @Genetix said:
    Buck,

    Assuming this is what you have, it is NOT a continuous rotation servo, but only moves 90 degrees.
    LEGO Power Functions 88004 Servo Motor
    https://www.lego.com/en-us/product/power-functions-servo-motor-88004

    However, some on the Adafruit forum said that they got it to rotate using a Adafruit Motor Shield V2 on an Arduino.
    They couldn't control the speed but it rotated which is what I assume that you want.
    https://forums.adafruit.com/viewtopic.php?t=62325
    https://forums.adafruit.com/download/file.php?id=19516&sid=5a9906842e68f7ce7bd51dd935109b5b

    #include <AFMotor.h>
    
    Lego motor (15,1);
    
    void setup()
    {
    Serial.begin(9600);
    motor.setSpeed (10);
    }
    
    void loop()
    {
    motor.step(1,FORWARD, single);
    motor.step(1, BACKWARD, single);
    }
    

    Instead of a L293D darlington driver, we now have the TB6612 MOSFET drivers.
    Motor Port 1

    Hello!
    Close partner very close, but not in gold. I was thinking of the servos designed by Brown Dog, Brick Compatible Continuous Rotation 360 Degree Servo that's the one I was thinking of. It is easier to apply and then to install. (Or it should be.)

  • Buck,

    As long as the real Lego servo isn't ultrasonically welded then you can hack it like a normal servo to spin continuously.

    Standard servos have a stop on the shaft and are connected to a Potentiometer.
    You cut off the stop and solder in a resistor value instead of the Pot, and now it will spin forever.

    Is the speed critical because it will change as the battery voltage drops.

  • JonnyMacJonnyMac Posts: 8,918
    edited 2022-02-07 16:51

    One thing that catches people out with older servos is long delays between updates. If you need to do a PAUSE while the servo is running, you can do this.

    Servo_Pause:
      PULSOUT Servo, servoValue
      IF delay < 20 SP_Exit
      PAUSE 19
      delay = delay-20
      GOTO Servo_Pause
    
    SP_Exit:
      PAUSE delay
      RETURN
    
  • @Genetix said:
    Buck,

    As long as the real Lego servo isn't ultrasonically welded then you can hack it like a normal servo to spin continuously.

    Standard servos have a stop on the shaft and are connected to a Potentiometer.
    You cut off the stop and solder in a resistor value instead of the Pot, and now it will spin forever.

    Is the speed critical because it will change as the battery voltage drops.

    Good advise. However this is a continously rotation enabled one from Brown Dog. Not one from Lego.

Sign In or Register to comment.