Asked — Edited

H Bridge Movement

Hi All.

How do I move a robot forward a certain distance (or time, since distances are going to depend on wheel size), then stop? I couldn't see an obvious way from the H bridge control panel.

thanks in advance,

Frank


ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

United Kingdom
#1  

You'll need to use an EZ-Script and calculate how long it takes to move a certain distance. I'm not too clued up on EZ-Script yet and not home so can't check but full help is available in the EZ-Script module.

United Kingdom
#2  

I just had a play with EZ-Script (until ARC played up and froze... it's still frozen now 10 minutes on).

Basically, write an ez-script.

From here on out it is assumed movement at full speed

Work out how far your robot travels in 1 second, easy way is to use EZ-Script to do this...

Place your robot down, mark where it starts. Write an EZ-Script containing this;

Forward(255,1000)

Run the code. Mark where the robot ends up. Measure the distance between. Divide the distance by 1000 to get distance per millisecond (makes it easier in EZ-Script).

I.e. Robot moved 300mm when running the script. So the speed is 300/1000=0.3mm/ms

The calculation to work everything here on out is simple; t=d*s where t=time in milliseconds, d=distance in mm and s=speed in mm per millisecond.

Now, work out how long it will take to move the robot your desired distance. Let's say we want it to move 1 meter (or 1000mm).

Distance/Speed = time 1000/0.3 = 3333

To set up ARC to move by 1 meter write the following EZ-Script

Forward(255,3333)

When you run that script the robot will move forward 1 meter.

To move it by 600mm you would jut work out 600/0.3 = 2000 so the code would be;

Forward(255,2000)

If it moved 200mm after running the first script your speed would be adjusted to 0.2mm/ms and therefore your calculation would be distance/0.2 (so for 1m movement it would be 1000/0.2 = 5000)

You will need to determine your robots speed as this will vary between robots.

It's simple mathematics at the end of the day.

Hopefully that was clear enough to follow.

#3  

Thanks. I didn't see such command formatting / parameters mentioned in the Script Command Manual. It made it also sound like the command was strictly for servo movements rather than the h bridge.

Frank

PRO
Synthiam
#4  

Thanks Rich! Great info :D

At the top menu of this website is a button labelled "Tutorials". Press that and there will be a tutorial section that introduces how ARC works and specifically, what a Movement Panel is. It is very recommended that you follow the tutorial process steps regarding movement panels will be clear :)

I know you'll be looking back at this question in a few days and say "ooooh, I get it now!"

:)

United Kingdom
#5  

You can also use the script console to carry out simple 1 line pieces of code such as the Forward(255,1000)

I didn't mention that you need to have the movement panel/hbridge set up in ARC first too.

Like DJ said, the tutorials help A LOT!.. So does just playing with the commands as I have found out tonight.