Drone Collision icon Drone Collision — Add HC-SR04 ultrasonic sensors with an EZ-B to AR Parrot Drone v1/v2 for collision detection and avoidance Try it →
Asked
2 Participants
Custom Movement Panel V2 H-Bridge Support

Custom Movement Panel V2 H-Bridge Support

I have a question about the ARC robot skill "Custom Movement Panel v2."

My robot is a two-wheel differential drive. The H-bridge I’m using requires a forward/reverse (direction) input pin and a PWM pin for each motor. Is there a convenient way to connect the "Custom Movement Panel v2" (or a similar Robot Skill) so it can control one direction pin and one PWM pin per motor?

Also, my H-bridge needs the PWM duty cycle to be limited to 95% or less to drive correctly - is that something the skill can accommodate?

For clarity: I haven’t specified how the H-bridge is connected yet. I’m planning to connect it via an EZB (so the H-bridge inputs would be wired to EZB digital and PWM outputs), but if other connection models are relevant (direct USB/serial driver or PC-connected hardware), I can provide details.



Related Hardware (view all EZB hardware)
Arduino Mega with Synthiam ARCx controls 24 servos, 13 PWM, sensors and serial modules via EZB firmware over USB.
USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 21

Related Robot Skills (view all robot skills)
Sabertooth Movement Panel by Dimension Engineering
Sabertooth movement panel: control two motors via Simplified Serial with variable speed sliders, movement buttons, and serial port options.
Dual H-Bridge w/PWM movement panel: control two DC motors' direction and speed via EZ-B PWM for responsive forward/reverse/turning.

ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

Yes - the proven way in ARC is to use a Movement Panel skill that maps directly to your H-bridge inputs, rather than trying to force Custom Movement Panel v2 to behave like a generic motor driver.

Best approach

For a two-wheel differential drive H-bridge that needs:

  • 1 direction pin per motor
  • 1 PWM pin per motor

the best fit is usually:

That skill is designed for exactly this layout and is the standard ARC solution for an H-bridge with direction + PWM on each motor.

About Custom Movement Panel v2

Custom Movement Panel v2 is mainly for custom locomotion logic when you need to write your own scripts for movement directions. It’s powerful, but it is not the most convenient or standard choice for a normal dual H-bridge drive base.

If you use it, you would typically write scripts for:

  • Forward
  • Reverse
  • Left
  • Right
  • Stop

and inside those scripts you would manually set:

  • the direction pins with Digital.set()
  • the PWM pins with PWM.set()

That works, but it’s more work and easier to misconfigure than using the built-in H-bridge movement panel.

PWM limit to 95%

Yes, that can be accommodated.

Best options

You can do this in one of two ways:

  1. Use the skill’s PWM/speed settings if it exposes them

    • Some movement panels let you configure speed behavior in the skill settings.
  2. Cap PWM in script

    • If you are using Custom Movement Panel v2, just map the movement speed to a maximum of 95 instead of 100.

Example:

var speed = Utility.map(Movement.getSpeed(), 0, 255, 0, 95);
PWM.set(d4, speed);
PWM.set(d5, speed);

If you need to preserve left/right speed differences:

var leftSpeed = Utility.map(Movement.getSpeedLeft(), 0, 255, 0, 95);
var rightSpeed = Utility.map(Movement.getSpeedRight(), 0, 255, 0, 95);

PWM.set(d4, leftSpeed);
PWM.set(d5, rightSpeed);

If your H-bridge is driven by an EZB, the cleanest setup is:

  • 2 digital outputs for motor direction
  • 2 PWM outputs for motor speed
  • then use the Dual HBridge w/PWM skill

That way ARC handles the Movement Panel logic and you do not need to reinvent the locomotion layer.

If you want to use a custom script anyway

Then yes, you can absolutely do it with Custom Movement Panel v2, and the correct pattern is:

  • Forward script: set both motors forward, apply PWM
  • Reverse script: set both motors reverse, apply PWM
  • Left/Right: vary one side or reverse one side depending on your drive design
  • Stop: set PWM to 0 and disable direction outputs

What I’d recommend

If your robot is a standard differential drive, I strongly recommend:

  • Use Dual HBridge w/PWM
  • Limit speed in the skill or by script if needed
  • Avoid Custom Movement Panel v2 unless you need custom steering logic or special behavior

That’s the standard ARC way and will save you time.

Quick question

What H-bridge board are you using, and are you planning to drive it from:

  • an EZB directly, or
  • another controller over serial/USB?

If you tell me the exact board model and your desired port mapping, I can give you the exact ARC setup and pin assignments.

If this is for custom code, the ARC AI Assistant inside ARC can also help generate the movement scripts for you 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  

Yeah athena is right. just use the hbridge pwm movement panel. that kind of motor controller you're using is a bit strange as it only has 1 input for direction instead of 2. but that'll still work, just connect the one wire to one of the outputs of the ezb for the hbridge.

the hbridge outputs a logic for direction. so like

STOP
0
0

FORWARD
1
0

REVERSE
0
1

but in your case, you'd just connect to one of the digital pins for the hbridge.

As for limiting the speed - that can be done via robot skills that control the speed. For example, if using a joystick robot skill, specify the max speed. But if you want a change to have a hard limit of 95%, we'd have to whip up a robot skill change for you.