Sunday 20 January 2013

OWI-535 Robot Arm Coding Project 

Part I  

Some Java Code

 

Dance video- speeded up x4 for effect

Also see our new site Eusentient.com

Introduction

Be aware

When you install the new drivers for your USB robot arm (see below), the OWI software you loaded from the CD will stop working. This isn't a failure of the code or instructions, it's just that you need to install new drivers for the USB board that work with Java and the IDE.   

To revert to the OWI software interface.

In device manager uninstall the libusb-win32 devices: ELAN USB device. Then re-install the OWI software. Restart the PC between each step of the un-install and re-install process.

-----------------------------------------------------------------------------
***Disclaimer***
Please remember this code is provided for free and AS IS. There is no support and no guarantee. As a non-expert, I will answer what questions I can, and respond to constructive comments / criticism.
----------------------------------------------------------------------------- 

I've posted links below to get all the code and allied files (jars,wrappers, drivers and libraries) to control the OWI robot arm using a simple GUI interface. You can also make sequences in Netbeans which make the arm execute set moves - make it dance as I did in the video above, if you like! My code is based on Andrew Davison's OWI project: http://fivedots.coe.psu.ac.th/~ad/jg/nui06/index.html

Geekery Recipe
All the Java code and allied files are here:  on my Google Drive 
NB the OW535RobotArm file is 7-zip type get free here: http://www.7-zip.org/download.html

Jars,wrappers, drivers and libraries on my Google drive
LibusbJava_dll_0.2.4.0 (.zip)
libusb-win32-bin-1.2.6.0 (.zip)
ch.ntb.usb-0.5.9.jar

 Netbeans project files and Java sources
OW535RobotArm (.zip) 7-zip: http://www.7-zip.org/download.html

Contains Java files (Dr. Andrew Davison 10/07/2011):
    * Joint.java, ArmCommunicator.java, JointID.java

Java files added by Craig Turner 19/01/2013
    * RobotUserForm.java (GUI interface)
    * ArmDance.java (sequence of moves a "dance")
--------------------------------------------------------------------------------------------------------
Alternatively you can get libusbJava_dll_0.2.4.0 (.zip) and libusb-win32-bin-1.2.6.0 (.zip)

by cutting and pasting these links to your browser:

* libusb-win32:  you need: libusb-win32-bin-1.2.6.0
<http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/>

* libusbjava: <http://sourceforge.net/projects/libusbjava/> you need: ch.ntb.usb-0.5.9.jar

* dll: <http://en.sourceforge.jp/projects/sfnet_libusbjava/downloads/libusbjava-snapshots/20090517/LibusbJava_dll_0.2.4.0.zip/> you need: LibusbJava_dll_0.2.4.0.zip

---------------------------------------------------------------------------------------------------------

libusb-win32-bin-1.2.6.0 (.zip) 
  • Extract archive and run the \bin\inf-wizard application. Choose a device to create
    drivers for e.g. 0x1267 0x0000 ELAN USB Device
  • Copy and rename the relevant DLLs in e.g. bin\x86\.. over to the OS (x86 is windows example)
    libusb0_x86.dll --> Windows\system32\libusb0.dll
    libusb0.sys --> Windows\system32\drivers\libusb0.sys
LibusbJava_dll_0.2.4.0 (.zip) and ch.ntb.usb-0.5.9.jar
  • Download ch.ntb.usb-0.5.9.jar and LibusbJava_dll_0.2.4.0.zip move the JAR and unzipped DLL to your java project folder.
If using an IDE such as Netbeans, make sure these files are copied into your dist folder: [ch.ntb.usb-0.5.9.jar], [LibusbJava.dll] and [LibusbJava_dll_0.2.4.0.zip].


Project organisation in Netbeans looks like this:


 Text file for a java project here in Rich Text format: 


----------------------------------------------------------------------------------------

Other requirements:

* An OWI-535 robot arm
   (http://www.owirobot.com/products/Robotic-Arm-Edge.html),
    **and** its USB interface.

In UK available here: Rapid Electronics

* The driver software may not include a Windows 7 version, but the
    OWI Robotics website has drivers at
    Owirobot downloads

* install the arm's ELAN USB driver

* Create a libusb-win32 device driver for the ELAN driver using
   libusb-win32's inf-wizard.exe

 i.e. Extract archive and run the \bin\inf-wizard application. Choose a device to create
drivers for e.g. 0x1267 0x0000 ELAN USB Device

------------------------------------------------------------------------------
 ArmDance.java

To use this class and it's methods you need to set the arm to a suitable position
so that  when the sequences begin the arm doesn't overshoot it's working
limits. Failure to do so may cause the gears to grind and click. The bot
may hit things, fall over and generally cause havoc.


For these Java method calls in the ArmDance class:
dance1(1, 5, 2);
faceCamShowOff();

I used the GUI (RobotUserForm.java) to set the arm to fully vertical
before starting.

-----------------------------------------------------------------------------

Last updated by by Craig Turner: 6th June 2013

Andrew Davison's OWI project: http://fivedots.coe.psu.ac.th/~ad/jg/nui06/index.html


If you use any of Craig's code please mention his name
and the Blog :
http://gampageek.blogspot.co.uk/2013/01/java-working-beautifully-many-thanks-dr.html

12 comments:

  1. Hi Craig Turner,
    I was instaled the new driver ELAN USB Device, but I cant download the OW535RobotArm.zip with Netbeans project files and Java sources. Because It have only the OW535RobotArm file that I dont know your type.
    I was instaled the NetBeans IDE 7.3 but I dont Know make this projet. If it possible post here the projet complete, with the Netbeans project files and Java sources.
    Thanks a lot!

    AdelJoao

    ReplyDelete
    Replies
    1. Hi Adelino, thanks for your question. The file type is 7-zip you can get the unzipper-zipper here for free . When unzipped it will have all the files to make a Netbeans project. Please try that but if you have more problems let me know and I will do my best to help.

      Thanks

      Craig [gampa geek]

      Delete
    2. Missing Link: www.7-zip.org

      Delete
    3. PS I've added all java classes in a rich text format to the google drive. You can use these to make your own project if you so wish.

      Delete
  2. Hi Craig Turner,
    I already got to run the project.
    Thank you very much!
    But I still have two questions:
    1- How I do to utilize the "JavaFilesAsTXT" file?
    2- How I do to revert to the OWI software interface?
    I already was uninstaled the ELAN USB Device driver and I was instaled again the OWI software in my Windows XP, but no result!
    How I do uninstal the libusb-win32 devices?
    Thanks a lot!

    ReplyDelete
  3. Hi, glad you got it working.
    In answer to your questions:

    1. If you are familiar with Netbeans you can just cut and paste the code to the classes you make. All the classes are in one txt file so look at the names of classes there and paste into seperate new classes in Netbeans.

    2. I don't understand why uninstalling the Elan driver and reinstalling OWI then restarting the pc dosn't work. It works fine on my PC. Did you do this in Windows device Manager and restart the PC then install the OWI software then restart PC again?

    3. You can only uninstall the Elan driver. Libusb-win32 devices is just a sub-heading in Windows device manager.

    ReplyDelete
    Replies
    1. 3. Continued... However if you think you need to remove support for Libusb-win32 devices as a whole from your PC, check this pagesourceforge.net/apps/trac/libusb-win32/wiki and this www.shouldiremoveit.com/LibUSB-Win32-20874-program.aspx. They can help you.

      best regards

      Delete
    2. I had a further thought. In windows XP you may need to manually delete the two files you put into windows system folders as you did in this setp from the blog:

      "..libusb-win32-bin-1.2.6.0 (.zip)

      Extract archive and run the \bin\inf-wizard application. Choose a device to create drivers for e.g. 0x1267 0x0000 ELAN USB Device
      Copy and rename the relevant DLLs in e.g. bin\x86\.. over to the OS (x86 is windows example)
      libusb0_x86.dll --> Windows\system32\libusb0.dll
      libusb0.sys --> Windows\system32\drivers\libusb0.sys.."

      Delete
  4. Hi Craig Turner,
    I already can to revert to the OWI software interface!
    Now is everything OK!
    Thank you very much!
    Only one more question: I want to utilize the OWI software with another USB Device (ex: FTDI to RS232), because I want send these data commands to a MCU on Wi-Fi, and a MCU send to a USB Host Device to communicate with the interface ELAN USB Device.
    In the true, I want to do the OWI Arm Robot wireless, with the ELAN USB interface.
    It is possible?
    Somebody can help me?
    Thank you in advance!
    Best regards,

    Adelino João

    ReplyDelete
    Replies
    1. I'm sure it is possible, maybe using Arduino [forum.arduino.cc/] These guys do a USB host shield for arduino [www.circuitsathome.com/products-page/arduino-shields]

      Delete
  5. Hi Craig, Have a look at my vbs/HTA program for OWI-535 Robotic Arm.

    Page - http://jeffphillips2000.tripod.com/downloads.html

    File - http://jeffphillips2000.tripod.com/controllerra.zip

    Cheers, Jeff Phillips.

    ReplyDelete