![]() |
|||||||||||||||||||||||||||
![]() |
![]() ![]() |
![]() |
Robix Software TutorialUsbor (model 32i) Robotic Servo ControllerConnect servos 1-6 to positions 1-6 on connector 'A'. Make sure to have the yellow/orange wire on 'top', as shown in the All Cables this Orientation legend, below right. Plug the USB cable into connector 'J' and into the computer. Connect power. (These steps may be done in any order.) Usbor-32i SoftwareOn your host computer (Win XP/2000 or Mac OS X, with PC-Linux coming soon) start both the Nexus and Nexway programs, in either order.
Your First ScriptWe start with an empty script panel. Notice that this is the script for Pod1 of the Usbor 3MUCYKMVDH6, or just Pod1 of 3MU for short. Now type in these two script lines move all to -1000; wait 5; digout 1 on, 2 off; wait 5 move all to 1000; wait 5; digout 1 off, 2 on; wait 5 Now run the script by clicking the
Click
Your First MacroNow turn the two script lines into a script macro named osc by altering the script to this form: Note that the osc 4 line could also have come after the macro definition instead of before it. Run this script as before ( Note that in general, you can have multiple commands on single line separated by ;'s. A ; is allowed at the end of a line but is not requied. Commands may not 'span' lines; that is, a command needs to start and end on the same line. A script may contain any number of macros, and macros can call other macros. Servo Current and TorqueNow apply gentle rotational pressure on the output shaft of servo 1 and watch the absi value of servo 1 increase as the servo draws more current to oppose the force you are exerting. The absi value is the absolute value of the short-term (~.1 second) average of the servo current. This value, in general, indicates the torque being exerted by the servo. Teach ModeNext, postion the text cursor on the word 'end' at the end of the
macro and open the Teach Window by clicking on the teach button '
After you have moved the pod's servos to new positions, click on the 'Add to Script' button in the Teach window, and a move command will be inserted on the line with the '->' arrow and the arrow will move down a line. Repeat these steps to add several new lines to the osc macro, then run the script again to see your added move commands in action. Editing Scripts to Change Servo ParametersCommands that alter servo properties need to be edited into the script by hand. In the macro osc, change the speed of the motion, add the command maxspd all 5 as the first line in the macro, and then run the script again. You'll see that the motion is slower than before. By the way, instead of running the script with the
You can also adjust other servo properties assuming that these servo properties were defined as 'variable' in the pod's configuration. This brings us to the next section. Usbor-32i Firmware and the Config EditorNotice what happens when you add the line minpos all -1500 to the script, and then double-click the line to execute it. An error message, Servo property is read-only, appears in the panel near the bottom of the Pod gui as you can see in the image above. The reason for this error message is that the pod configuration stored in the Usbor, declares that minpos cannot be changed by a script command. This brings us to the next topic in this tutorial. Usbor ConfigurationThe Usbor configuration is stored in the flash memory of the Usbor itself. The configuration defines how the 32 servo outputs (each of which can alternately be a digital output or 'digout') and the 32 analog inputs are assigned to various pods in the Usbor. Since the memory available in the Usbor for its configuration is limited, not all options can be turned on all the time. Let's build a new configuration. In this example we will use 18 of the 32 servos, and make three pods of 10, 5 and 3 servos each. And all servos will have all of their properties adjustable by script commands. We begin by clicking the 'Configuration' tab on the Usbor Nexus gui. Next click Open Usbor Configuration Editor and get We start with 1417 bytes of ROM (flash) memory and 1824 bytes of RAM for our configuration. At present, the configuration holds only pod defintions, but in the future other features may be added to the Usbor firmware that also use configuration memory. Users will be able to update firmware via downloads from Robix.com. To configure our 3 pods of 10, 5, and 3 servos each, each with all servo properties 'variable' we highlight System_All_Var as shown. Then we click Configuration and have We can see the shortcut keys to add a pod ( Ctrl+Shift+P) and to add a servo (Ctrl+Shift+S) since we want VT or 'velocity trapezoid' servos. So now we quickly add a pod and 1 servo using the appropriate keystrokes, and make sure that 'System_All_Var' appears in the parent servo box at top right. Then we add 9 more servos with Ctrl+Shift+S presses and the first pod is complete: Similarly, we next press Ctrl+Shift+P to start a new pod and add 5 servos to it with Ctrl+Shift+S and then add the final pod with 3 servos: Finally, we save the new configuration to file '10-5-3.rbxUsborConfig' by using the file menu, and then we send the configuration to our Usbor by clicking on the Download button and selecting an Usbor (there's probably just one) to which to download the configuration. A reset of the hardware by pressing the reset button just below the USB connector may be required. Now if we look at the Pod1 gui, we'll see that it has automatically recognized the new configuration and shows data for it. First, right-click on the servo properties panel and click Select Properties. Then check the minpos and maxpos boxes and close the dialog box. Finally, double-click on the script line minpos all -1500 and note that the minpos values in the servo properties panel change appropriately. One last point: If you now try to run the script, a syntax error will appear in the digout command. Number is out of range. - 1 This error appears because the new pod1 configuration has no digout's. So remove the digout commands and run the script to see that it is valid once again. Customizing the Pod GuiSince there are now no digout's or sensor inputs, you can actually remove those panels in the pod gui to make more room for other parts of the display. Right click on the sensors area and you will see where we have already highlighted Remove This Panel. Click to remove the panel and then repeat this for the Digouts panel. The right click on any panel in the pod gui and click on Pack Window. The result is Now let's move the panel that says idle and also the error log panel just to the right of idle to a position right under the scripting window. We do this by removing both panels and then adding them. Remove the idle panel and the error log panel, and then do Pack Window again. Here's what we get: Next we right click on the script panel and split it to the South and once again do Pack Window. This gives us: Note the short, empty panel below the scripting panel. Right click on it and split it East. Then right click on the left panel and Replace With Pod Action Right click on the right panel and Replace With Error Log. Finally, right click on any panel and Pack Window. Here is our final result: If you would like to make this your new default pod gui, click on Gui and Save. If you would like to save this pod gui layout under another name, click Gui and Save As. ![]() |
![]() |