Asked — Edited

2Nd H-Bridge To Control Wrist Movement

I want to add a 2nd H-Bridge to my robot to control the rotational movement of the wrists for the hands. I want to be able to do this using voice command and will be using the H-bridge listed in the add control panel.

I know that it will have to be done using scripting, but I don't know what to start for that.

Can anyone help me out here?

Thanks

Dan S.


ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

#9  

If you want to use speech recognition here is what I would do, I would write a script that would turn the motor on an off, pause for a split second reverse and turn the motor on an off. That way when you say for example, "hello there please wave at me"' he's wrist will start turning back and forth. You don't really even need to add a digital control. Speech recognition start the script all by itself. You could however also add a control and assign it to that Digital port. That way you could turn the motor on and all of with those controls by hand from your laptop. I can't help you with the script right now but it would be really easy to write out. Just a matter of turning the digital ports on an off with a sleep function to get the proper timing.

#10  

OK, back home again from vacation and on my home computer now so I can send info better.

@thetechguru , Yes, I'm a big fan of limit switches. They have saved my butt more then once. As you know it's very easy to send your motor speeding away towards disaster or your fingers while your setting things up. Limit switches to cut power on each side of the radius and keep the tears away from your eyes. By adding a simple blocking diode on each switch you can easily revise direction. Without the diodes installed there is no way to back off the rotation because there is no power flowing. Blocking diodes allow power to flow one way but not the other so with them installed in the proper direction you can simply reverse your h-bridge when your rotation hits the switch and run it the other way. Here's one of my setups. You can see the switches to either side of the blue pot I use for location feedback:

User-inserted image

User-inserted image

@droidmech2002 , Try this script. You will need to adjust the values to your needs. Let me know how it works. Tip: start out with small sleep() times to keep your movements short but long enough to let the motor move to the proper place you want. Enlarge the times a little at a time till you get it right. This will hopefully keep you from having a runaway motor with no limit switches installed. (0500) = 1/2 second, (1000) = 1 second, (1500) = 1 1/2 second, exc:


# To Rotate wrist one way
# Adjust the Sleep() to get your timing right
#Replace Set() values to your ports
PWM(D6,50)
Sleep(0250)
Set(D9, on)
Sleep(1000)
Set(D9, off)

#add a Sleep() to pause between waving one and the other. Adjust value as needed:
Sleep(0500)

# to Rotate wrist the other way
# Adjust the Sleep() to get your timing right
#Replace Set() values to your ports
PWM(D6,50)
Sleep(0250)
Set(D7, on)
Sleep(1000)
Set(D7, off)

Have fun and good luck! Dave Schulpi