PDA

View Full Version : A4WD / EZ-B Project



Marv
09-03-2012, 03:51 PM
http://allenconnections.com/roboblog/wp-content/uploads/2012/09/IMG_1180_50.jpg


I bought an A4WD (w/o electronics) from Lynxmotion a couple years ago and have experimented with Xbee RF modules for communication both directly to the Sabertooth motor controller, as well as through an Arduino. I used C# to write multi-button window panels to control the drive motors. Other than testing sensors and servos, I never got to the point of including any of them in the motor drive program.

But things have progressed quickly since purchasing EZ-Robot's EZ-B Microcontroller. It comes with EZ-Builder software that already has just about any control panel a person would want included for use in its own script language. It also comes with SDK's for those who eventually want to write their own C# or VB programs.

While the EZ-B is more powerful and faster than an Arduino and has 20 digital ports, 8 analog ports, an Ic2 port and a uart port, the key difference with the EZ-B setup is the controlling program resides in the local computer not the remote microcontroller. That means large and very complex programs can be used without worrying about memory and storage limitations.

Here's how my A4WD is currently outfitted: (1) Sabertooth 2x12 motor controller; (4) Gearhead 12V, 30:1, 200rpm motors; (2) Quadrature Motor Encoders; (1) 12V 2800mAh battery; (1) Sharp GP2Y0A21YK0F IR Range Sensor on the rear mounted to a DGServo S08NF STD servo; Ultrasonic Ranging Module HC-SR04 and Sonix Wireless Camera V01-e03 mounted to Hitec HS-311 pan & tilt servos in the head; Dagu 2DOF Gripper Arm with DGServo S05NF STD for jaws and S06NF STD for up/down motion; EZ-B Microcontroller Ver 3A; Synapse RF266PC1 Wireless modules for serial communications.

I should mention my wireless camera, which is normally mounted below the Ultrasonic module, is in for warranty replacement. Also, the motor encoders are mounted but not yet being used for anything. I plan to use them to keep track of distances and report back a stall condition.

At present, I have a USB wired Playstation 3 joystick connected to a notebook PC running the above mentioned EZ-Builder software. The local Synapse RF module is also plugged into one of the notebooks USB ports.

The RF266PC1's are rated at 4,000 feet line of sight by Synapse. So far I have only run the A4WD around a local tennis court. Once I find a safe place to do some distance testing, I'll see how far the RF modules work in a real world situation.

I used to joke that I needed an automatic kill switch in case the Rover got away, but with these new long range RF modules, I really do need something to stop it. I probably should also have some sort of defense against an overly curious canine. The wireless camera won't be of any use, since it has a 2.4ghz range of only a 100' or so.

I have a blog with several video and other photos where I have kept track of my progress at:

http://allenconnections.com/roboblog/

http://allenconnections.com/roboblog/wp-content/uploads/2012/08/Joystick_Control1.mp4

tician
09-03-2012, 07:30 PM
Although it is far more important for larger (more dangerous) bots, I very much recommend you add a couple lines of code to the program running on the bot to create a hardware (interrupt-based) countdown timer that will stop the motors if it does not receive a valid RF data/command packet within a certain time frame. A software counter might be susceptible to pre-emption by other sections of code, but of course this is a moot point if you cannot actually modify any of the code actually running on the EZ-B board that controls the motor drivers (from a quick look at the EZ-Robot tutorial pages, it seems like only approved firmware released by EZ-Robot will work with the EZ-Builder program - kind of like Robotis and their RoboPlus software, except you can at least upload some user generated code to the CM-5/510/530/700 controllers).

A physical Emergency Stop button/switch to disconnect power to the motors (and maybe the controller as well) would also be pretty useful if there is not already an easily accessible power switch on the bot. The motor E-Stop is much more important on large, strong, and extremely expensive bots like the pr2, but it is still useful on smaller bots (especially when debugging and/or experimenting).

Marv
09-08-2012, 04:44 PM
A4WD / EZ-B (http://forums.trossenrobotics.com/Shop) Project Phase 5 - Rover Gets Speech & Hearing

This part of my A4WD / EZ-B (http://forums.trossenrobotics.com/Shop) Project could be used by others for a non-robotic purpose, but my objective was to give my Rover speech and hearing "on the cheap".

The setup for my application is a pair of $20 Motorola FV-300 TalkAbout's; one connected to my computer, the other attached to my 4WD Rover.

There was no need to open the case on the unit connected to my computer. Everything was done using the PTT (Push To Talk) headset jack. The basic concept is that the computer's sound output jack is connected to the microphone input on its Walkie-Talkie. Then that Walkie-Talkie's speaker is connected to the computer's microphone input. Now this is not a perfect impedance match, but it works surprising well. The volume needs to be kept low anyway, so as not to overdrive the circuits and cause distortion. It does take more than just connecting these things but more on that in a moment.

The remote unit mounted on my Rover was disassembled and removed from its case so that connections could be attached directly to its circuit board. Knowing what I know now, disassembly probably wasn't necessary.

OK, let's start with the unit connected to my computer and this drawing.

4143

First, obtain a new 3/32 inch (2.5mm) plug. You should look for one that has a shoulder sufficient enough that 1/32 inch can be removed. That's so the plug will insert a little deeper in the headset jack on the Motorola TalkAbout. Motorola used a special jack to prevent anyone from using non-Motorola headsets. I put my new plug in a drill and used a file to remove 1/32 inch from its shoulder. Now it inserts all the way and stays inserted.

As the drawing for the new modified plug shows, the tip is the mic connection, the ring is the speaker connection and the base is ground. In normal operation, the Walkie-Talkie's speaker is working, and you have to push the talk button to talk. External PTT is accomplished by connecting the plug's ring terminal (ear piece) to ground. As long as those two terminals are connected, the Walkie-Talkie accepts a signal coming in on its mic terminal pin.

Well, up to 60 seconds, anyway. It seems a timer is built into its circuitry to prevent anyone from keeping the talk circuit activated any longer than 60 seconds. If the ground to earpiece connection is dropped sooner than 60 seconds, the unit immediately reverts back to normal operation.

For my application, I'm connecting the ear piece terminal to ground using an USB/Serial microcontrolled relay. There are plenty of such devices available. Depending on your application, the connection could be accomplished with something as simple as a momentary push button switch.

The headphone or speaker output of a computer is typically stereo, with the ring and tip each being a channel. For my purpose, I just
connected both channels to the Walkie-Talkie's mono mic pin.

The microphone input to a computer is also mono. Three terminal jacks and three terminal plugs are normally used, which might make you think it is a stereo connection. But the ring terminal is actually a +5V bias for the type of microphones used in headsets and such. In my case, the extra +5V power isn't needed. The Walkie-Talkie's speaker provides plenty of power without any help. So, the ring terminal is left unconnected.

That's about it for the computer end. Now any speech or sound from the computer is fed into the Walkie-Talkie after first pulling the PTT relay. Otherwise, sound from the other remote Walkie-Talkie is feeding the computer's speakers.

I won't be going into so much detail as far as the disassembled Motorola unit mounted to my 4WD Rover, as every model is going to be a bit different on the inside. Depending on application, someone might want to use the remote Walkie-Talkie "as is" and simply speak and listen to it from their remote computer.

The FV-300 takes 3 AA bateries, which provides 4.5V. However, the circuitry also picks off 3V from in between the batteries. That worked out great for me, as I already had 3.3V and 5V available on the Rover.

The push to talk button is just a two wire switch on this particular unit, so I soldered wires to it and ran those to an onboard microcomputer controlled relay. Same concept as the relay at the computer end, as far as PTT. I also had to extend the speaker's wires in order to mount it on the Rover's platform.

Now on to the fun part of integrating speech and hearing into the overall project.

4144

http://allenconnections.com/roboblog/