Asked
Resolved Resolved by DJ Sures!

How To Move A Servo 360 Using Blocky With Time

I would like to control a 360-degree continuous rotation servo using Blockly in Synthiam ARC, specifying the duration of movement instead of a specific angle. Which blocks should I use to achieve this? I assume I need to use the "Move Servo" block to identify the servo number. What other blocks should I use to set the duration and speed for the servo's movement? Should I also consider using the "Move Forward" block, which allows setting left speed, right speed, and duration in milliseconds?


Related Hardware EZ-B v4
Related Control Continuous Servo

ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

PRO
Canada
#1  

To control a 360-degree continuous rotation servo using Blockly in Synthiam ARC, you can use the Continuous servo Movement Panel skill. Since continuous rotation servos don't have a specific position but rather a speed and direction, you'll need to specify the speed and duration for which the servo should move.

Here's how you can achieve this using Blockly:

  1. Add the Continuous servo Movement Panel: Ensure that you have added the Continuous servo Movement Panel to your ARC project. This panel will allow you to control the continuous rotation servos.

  2. Open Blockly: Go to the Blockly interface in ARC.

  3. Set servo Speed: Use the Set Speed block to specify the speed for the left and right servos. The speed is a percentage value between 0 and 100. You can adjust the speed to control how fast the servo rotates.

  4. Move Servo: Use the Move Forward, Move Reverse, Move Left, or Move Right block to specify the direction in which you want the servo to move. These blocks will control the movement of the robot using the Continuous servo Movement Panel.

  5. Set Duration: Use the Wait block to specify the duration for which the servo should move. The duration is specified in milliseconds. For example, if you want the servo to move for 2 seconds, set the wait time to 2000 milliseconds.

  6. Stop Servo: After the wait duration, use the Stop block to stop the servo movement. This will ensure that the servo stops rotating after the specified time.

Here's a simple example of how the Blockly code might look:

Set Speed Left: 50% Right: 50%
Move Forward
Wait 2000 milliseconds
Stop

Steps in Blockly:

  • Set Speed: Drag the Set Speed block and set the desired speed for both left and right servos.
  • Move Forward: Drag the Move Forward block to start the movement.
  • Wait: Drag the Wait block and set the duration in milliseconds.
  • Stop: Drag the Stop block to stop the movement after the wait time.

This setup will move your continuous rotation servo forward at the specified speed for the specified duration and then stop it. Adjust the speed and direction blocks as needed for your specific application.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#2  

Athena is correct - but only if you’re using the continuous rotation servo as a movement method. Meaning, it has a wheel attached to it to move the robot. That’s why you’d use a movement panel. A Movement Panel is responsible for moving the robot.

if the servo is to be used as something else, you can use a regular servo command in Blockly to move the servo. So yes, use the move servo block.

One bit of information that would help you is understanding how a continuous rotation servo works. This document explains what positions would make the servo move: https://synthiam.com/Support/Advanced-Fundamentals/servo-motor#part5

That same document explains the difference between a continuous rotation and standard servo. It’s important to know that a continuous rotation servo has no internals to understand positioning.

@athena can explain more.

PRO
Canada
#3  

Thank you for the additional context! Let's delve a bit deeper into how continuous rotation servos work and how you can control them using Blockly in Synthiam ARC.

Understanding Continuous Rotation Servos

A continuous rotation servo differs from a standard servo in that it doesn't have a fixed position range (like 0 to 180 degrees). Instead, it rotates continuously in either direction. The speed and direction of rotation are controlled by the PWM signal:

  • Neutral Position (90 degrees): The servo stops moving.
  • Greater than 90 degrees (e.g., 180): The servo rotates in one direction, with speed increasing as the value approaches 180.
  • Less than 90 degrees (e.g., 0): The servo rotates in the opposite direction, with speed increasing as the value approaches 0.

Controlling a Continuous Rotation servo with Blockly

If you're using the continuous rotation servo for purposes other than moving the robot (e.g., rotating an arm or a sensor), you can use the regular servo control blocks in Blockly. Here's how you can set it up:

  1. Add the Continuous servo Skill:

    • Ensure the Continuous servo skill is added to your ARC project.
  2. Open Blockly:

    • Navigate to the Blockly interface in ARC.
  3. Set servo Position:

    • Use the Set Servo block to specify the port and position for the servo.
    • For example, setting the position to 180 will rotate the servo in one direction at full speed, while setting it to 0 will rotate it in the opposite direction at full speed.
  4. Set Duration:

    • Use the Wait block to specify how long the servo should rotate. The duration is in milliseconds.
  5. Stop Servo:

    • To stop the servo, set the position back to 90 using the Set Servo block.

Example Blockly Code

Here's an example of how your Blockly code might look:

Set servo (port: D0, position: 180)  // Rotate in one direction
Wait 2000 milliseconds               // Wait for 2 seconds
Set servo (port: D0, position: 90)   // Stop the servo

Steps in Blockly:

  • Set Servo: Drag the Set Servo block and set the port and position to control the direction and speed.
  • Wait: Drag the Wait block and set the duration in milliseconds.
  • Set servo to Stop: Drag another Set Servo block to stop the servo by setting the position to 90.

This setup will rotate your continuous rotation servo in the specified direction for the specified duration and then stop it. Adjust the position values as needed for your application. If you have any more questions or need further assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#4  

@Monterdur.  Just checking to see if you go it working. I am very fluent in Blockly. For some of these items you kind of need to read between the lines. The 90 degrees will give you no movement  as you progress to say 70 degrees etc or inversely 110 will go in different directions. Although there isn't a potentiometer on the motor what you do is use the timeout block for your distance you want to travel-2000 milliseconds for 1 ft etc.

#5  

Thank you for reaching out. I am trying to make a 360 servo run on a voice command and to get it to run for a short period of time. I lost all of my work on the old laptop. But here is what the progress I made so far. The blocky code I used is below. But if I can make it run with time that would be best. I will be connecting the servo directly yo the EZV and not use the 16 channel board. I will look for the timeout block and try to implement it. Thank you and I will keep you posted. The current code makes the servo move with 1 voice command and stops with a 2 nd vice command.

User-inserted image

User-inserted image

PRO
Synthiam
#6   — Edited
  1. add some value to the move servo block. It’s currently empty

  2. remove the move forward block and replace it with a sleep block

  3. remove the stop block

PRO
Synthiam
#7  

Here's what i mean - i wasn't on my computer when i wrote the message yesterday. This will move the servo in one direction full speed. 90 is stop (or you can release it for similar behavior). Any value from 90 up or down will be the speed in the relative direction. It's documented very well in how a servo works if you click on the word servo anywhere in this response or other responses (it's a good read)

User-inserted image

The best way to understand if what you did makes sense is to ask yourself what every command does. For example, let's take a look at what you had done...

User-inserted image

If you explain each block, you'd find that they don't go together logically. The move servo makes sense but it's missing the value to move. Then you have a "move forward", which controls a movement panel. And then a release, which is good. But finally it ends with a Stop, which controls a movement panel.

What i would recommend is right-clicking on a block and selecting HELP to read the manual page for them. It will explain what it does - and then you can decide if that's the right command for the goal.

Hope that helps:D It can feel overwhelming learning new stuff but that's where a hot cup of tea and relaxing music in the background can help while we take our time haha.

#8  

Hi DJ,

That did the trick. It worked perfectly. Your explanation was very clear. Now the kids at our school will move forward with the 3D printing of gears and components. On behalf of all of the kids at Kids Elite. Thank you!

PRO
Synthiam
#9  

That's great to hear! Thanks for the kind words. Let me know what your next step with the kids is if you need any help:)