Rplidar icon Rplidar — Slamtec Lidar driver for ARC; scans 360° and publishes distance data to NMS for mapping, obstacle avoidance, and navigation. Try it →
Asked
2 Participants
Ultrasonic Radar with Dynamixel sweep

Ultrasonic Radar With Dynamixel Sweep

I’ve got a Robotis Bioloid frame with an AX-12A mounted as a pan servo and an HC-SR04 on top. The AX-12A is on a U2D2 over USB to my Windows laptop, and I can control it in ARC using the Dynamixel robot skill (ID=1 moves fine; Servo(V1, 90) works in a script). The HC-SR04 is wired to a small Arduino Nano that I’ve connected to ARC as an EZB (USB serial), with Trigger on D3 and Echo on D4. In the Ultrasonic Radar skill I can see distance data update if I manually sweep the AX-12A, so the sensor side is okay.

Where I’m stuck: I need Ultrasonic Radar to actually drive the sweep on the Dynamixel servo. In the Ultrasonic Radar config, the servo Port dropdown doesn’t list any Virtual ports (e.g., V1) that the Dynamixel skill exposes; it only shows standard D ports. I don’t want to rewire the HC-SR04 to the same controller that’s running Dynamixel because the U2D2 is just serial to the AX bus, not GPIO. I tried to work around it by watching for a variable I could use to mirror the radar’s target angle to V1 (e.g., with a Script/Javascript skill loop), but I can’t find any documented variable that reflects the live sweep target; Variable Watcher isn’t showing anything obvious. I also didn’t see a ControlCommand callback from Ultrasonic Radar for "on sweep step" or similar.

Is there a built-in way for Ultrasonic Radar to either publish its target servo position or select a virtual servo (V1) so it can sweep a Dynamixel AX-12A while the HC-SR04 is read from a different controller in ARC?



Related Hardware (view all EZB hardware)
Bioloid by Robotis
Bioloid humanoid with Synthiam ARCx: control AX-12 servos, create gaits, gestures, voice, AI and vision from any browser
USB
Servos 200
Camera
Audio
UART ✕
I2C
ADC ✕
Digital ✕

Related Robot Skills (view all robot skills)
Ultrasonic Radar by Synthiam
Ultrasonic on a servo sweeps 180°; radar shows distances and obstacles, integrates with movement panels for automatic avoidance, scriptable GetPing
Dynamixel by Robotis
Open-source ARC plugin to control Robotis Dynamixel servos (XL-320, AX-12, XL430) via EZ-B, Arduino or Robotis. Supports position, speed, accel.

ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

Short answer: no - Ultrasonic Radar can’t directly sweep a Dynamixel virtual servo port like V1, because that skill is designed around a physical servo port on an EZB-style controller and its own internal sweep logic. It does not expose an "on sweep step" callback or a documented live target-angle variable that you can mirror cleanly.

What’s going on

  • Ultrasonic Radar expects to own a standard servo port from the controller it’s configured against.
  • Dynamixel V ports are provided by the Dynamixel robot skill, but Ultrasonic Radar’s servo selector is not built to target those virtual ports.
  • So even though your AX-12A works in ARC through the Dynamixel skill, Ultrasonic Radar can’t directly bind to V1.

The proven better approach in ARC

If your goal is:

  1. sweep the AX-12A, and
  2. take ultrasonic readings from a separate controller,

then the clean ARC way is to script the sweep yourself and call the ultrasonic reading skill/control from that script.

That means:

  • Use a JavaScript or Python script to move V1
  • Read distance from the ultrasonic controller
  • Update your own "radar" logic/display

This is better than trying to hack a variable out of Ultrasonic Radar, because there isn’t a supported publish/subscribe output from that skill for live sweep position.

Option A - Keep Ultrasonic Radar for display only

If you want the radar UI, you can still use it for visualizing a sensor, but not as the sweep driver for V1.

Option B - Build your own sweep loop

This is the robust solution if you need Dynamixel control.

Example JavaScript pattern:

for (var angle = 20; angle <= 160; angle += 5) {
  Servo.setPosition(V1, angle);
  sleep(120);

  // Read distance from your sensor controller
  // Replace this with whatever method your Nano/EZB setup uses
  var dist = ADC.get(ADC0);

  print("Angle: " + angle + " Distance: " + dist);
}

for (var angle = 160; angle >= 20; angle -= 5) {
  Servo.setPosition(V1, angle);
  sleep(120);

  var dist = ADC.get(ADC0);
  print("Angle: " + angle + " Distance: " + dist);
}

That said, if your HC-SR04 is on a Nano connected as a USB serial device, then ADC.get() may not be the right read method unless the Nano is actually exposed as an ARC-compatible EZB analog input. If the Nano is just streaming serial data, then the script should read from COM.readLine() or similar instead.

About the variable idea

You’re not missing it - there isn’t a documented live sweep-angle variable from Ultrasonic Radar that you can reliably sync to V1. The Variable Watcher won’t help if the skill doesn’t publish one.

Best next step

To give you the exact working setup, I need one detail:

How is the Nano exposing the HC-SR04 data to ARC?

  • Is it an EZB Connection / ARC-compatible controller with ADC ports?
  • Or is it just a USB serial COM port sending distance text?

If you tell me that, I can give you the exact JavaScript script for the sweep + read loop in ARC.

Also, if you want, I can help you build this as a proper ARC robot skill workflow instead of forcing Ultrasonic Radar to do something it wasn’t designed for. For code-heavy work like this, the ARC AI Assistant inside ARC is also handy because it can rewrite the script directly:
https://synthiam.com/Products/AI-Assistant

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.
Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#2  

Athena is occasionally wrong, and she is today, from my understanding of the question. You're asking to use a dynamixel servo as the sweep servo - and the answer is yes. You add the dynamixel robot skill, and assign the servo ID to a Vx port. Select that Vx port in the radar scanner robot skill.

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#3  

Youre right to call that out - the radar sweep can use a Dynamixel V port when the Dynamixel robot skill is installed and the servo is mapped to a Vx port.

Correct approach

  1. Add the Dynamixel robot skill

    • In ARC, go to Project > Add Robot Skill
    • Add Dynamixel
  2. Map your AX-12A

    • Open the Dynamixel skill kebab menu / config
    • Assign ID 1 to a virtual servo port, such as V1
  3. Open Ultrasonic Radar

    • In the Ultrasonic Radar skill settings, open its kebab menu / config
    • In the Servo Port dropdown, select the same V1 port

That is the intended ARC workflow for using a Dynamixel servo as the sweep servo.

Important note

If you’re not seeing the virtual ports in Ultrasonic Radar, that usually means one of these is true:

  • the Dynamixel skill isn’t added yet
  • the Dynamixel skill hasn’t been configured with an enabled servo on a V port
  • the radar skill was opened before the Dynamixel skill was available and may need to be re-opened or refreshed

About the HC-SR04 on the Nano

Your ultrasonic sensor can stay on the Arduino Nano if it’s already feeding distance data into ARC in a way Ultrasonic Radar can read. The sweep servo does not need to be on the same controller as the sensor.

Best practice in ARC

Use the Dynamixel skill for the AX-12A and let Ultrasonic Radar select the virtual port. That’s cleaner than trying to script a sweep loop yourself.

If you want, I can walk you through the exact settings in both skill windows step by step. Also, what is the bigger goal here - just a scanning radar display, or obstacle avoidance/navigation with the Bioloid?

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.