|
|
|
|
INTRODUCTION: ServoJoy is an adaptable interface between a PC joy stick and a serial driven servo controller board. Examples herein reference the Pontech SV-203 controller board but the character commands sent to the board can be changed easily. This software is intended for use with real time remotely ‘drivable’ devices that use servo controls as a primary means of locomotion. It is useful for animatronics and other control applications where the PC joystick is a desirable control interface.
OVERVIEW: The block diagram below shows the flow of information from the joystick to the serial output portion of the system. Inputs come in on the left come in from two sources, joystick position data and button condition (ON/off). Depending on the type of data, it is vectored down one of two paths, Joy stick and button.
Joystick data flow: The 4 joystick axis are read as 16 bit numbers directly from the positions of the potentiometers in the base of the joystick. (Endpoints of these numbers rarely lie at exactly 0 and 64K so there is a calibrator which automatically locates these limits for you.) A dead band filter is available to locate and take out the center play of the joystick. Joystick position data that falls into the dead band will be forwarded to the normalizer as a ‘hard’ 50% deflection. The normalizer combines the endpoint data from the calibrator and current position data into a percentage deflection between 0 and 100%. Deflection data is then available to the 8 channel cross connect and tank drive converter. At this point, deflection data can be assigned to any of the servo channels. Button Data: Buttons can be configured to operate in one of three different modes:
When direct commands are sent, they completely bypass the servo multiplex. This provides a more direct control of the interface board but depending on the command, it can cause the servo position indicator to be inaccurate.
Multiplex Data: The multiplex is essentially a big cross connect switch. Looking at it from the point of view of the servo, it decides where the servo is going to get it’s control input. The servo channel can be driven by any one of the joystick axis’ or any of the slider channels. Regardless of the channel selected, the multiplexer receives a number between 0 and 100%. This number is the ‘Control Deflection’. The first stop is the control law.
Control Law: The control law changes the shape of the control output curve on either side of the dead band (50%).
Center & Min Max limiters: Data from the control law is ideal but it must be fit to the limitations of the servo. Eachservo has three key pieces of travel data. The minimum, the maximum and the center. Typically minimums and maximums are physical limitations of the servos in their operating environment. The center is driven by the most desirable center resting place. The dead band and control curve outputs are fit to these three pieces of information. The dead band of the control stick will always be 50% and that will always correlate to the center position of the servo. Control outputs on either side of the dead band are fit between the dead band and the endpoint.
Inverter: Occasionally it is necessary to invert or reverse the output of a servo. In a linear world this means that 100% control deflection would result in a 0 output to the servo and a control deflection of 0% would result in a 255 for servo position. Checking the inverter box will result in the inversion of control data. For some exponential control curves this can be messy. To clarify the problem, all control axes are invertible too!
Command Construction: Servo interface boards each have a unique set of commands which must be sent in order to move a given servo. The command construction element has three components: The pretext, the data and the post text. These three data are combined and sent as one line to the servo board each time the servo data changes.
Screen Overview and Functionality: The ‘Comm’ screen: This is the opener screen; it configures and activates the communications port. Baud rate and port number are selectable here. One can also turn off and on the RTS and DTR control lines and sample the status lines. The COM port must be OPEN for the software to work or activate the joystick. This screen also displays any received data in the form of hex characters.
JoyStick Input: Start the joystick by clicking the Start Joystick button. ServoJoy will begin sampling the joystick at the indicated interval. This interval cannot be changed without stopping the joystick input. (The COM port must be open for the joystick to start. If the COM port is closed for any reason, the joystick will stop sampling automatically and must be manually restarted.) This screen also shows the joystick input raw data and dead band ranges. When the auto calibrate box is checked, the joysticks are cycled through their full ranges of motion and the boundaries are determined. Uncheck this box when you are done calibrating the joystick. The dead band management area allows one to auto locate dead bands. To do this, check the Auto Locate Dead Band box and the Enable box for each axis where you plan to use dead band filtering. Wobble the joystick in the dead band range to set the dead band endpoints. Once satisfied with the limits, Uncheck the Auto Locate Dead band box.
Servo Screen: This screen controls the multiplexing of controls for the servos, facilitates control law adjustment and servo parameters and activates and configures the tank drive if necessary. Servos are activated by the check boxes on the far left. This means they are entered into the sample and transmit loop. A control source is selected from pull downs as are control laws. Min, Mid and Max are adjusted manually according to the physical constraints of your servo. The servo output is built and displayed on the far right.
Button and Sliders screen: The eight push buttons are programmed on this screen as well as the slider channels. Sliders can be manipulated directly or moved incrementally by buttons. Buttons action is selected from the pull downs. Once selected, options to continue the configuration are made available. The rapid fire count number adjusts the speed at which the toggle modes are selected when the button is held down. The higher the count, the slower the rapid fire. A Zero turns off the rapid fire mode.
The Coolie Hat Screen The Coolie hat is an eight position switch available on some joysticks. Each position is fully programmable just like the buttons.
On the Top of the Screen
Menus: File: Open Allows one to load a configuration file
File: Close Closes a configuration file and restores all data points to their default values
File: Save Saves the current file configuration
File: Save As… Saves the current configuration under a user defined name
File: Exit Ends the ServoJoy session
Animate: Open Opens a saved sequence file
Animate: Save Saves a sequence file
Animate: Start Recording Starts recording the servo sequences
Animate: Stop Recording Stops the recording of servo movements
Animate: Start Starts ‘playing’ a previously recorded sequence
Animate: Stop Stops the ‘playing’ of a previously recorded sequence
Animate: Setup Sets up the timing intervals for record and playback
On the Bottom of the Screen: There are two fields which display the serial data traffic between the servo board and ServoJoy. There is also a transmit field which will allow you to directly type in and send a command to the servo board with or without a carriage return.
Concepts
Control Law Concept: A control law essentially changes the shape of the control output curve on either side of the dead band (50%). Control laws can be linear or exponential. In a linear control law there will be an almost 1 to 1 relationship between the control deflection and the servo position. For an exponential control law, the amount of change of the servo position will depend on where the deflection is. This might mean that between control deflection 55% to 56% there would be only a 1 point change in the servo position but between 85% to 86% there would be a 7 point change in the servo position. This type of control law can help to linearize the movement of a circular control element or enable fine control adjustments very near the center of the control mechanism. Exponential control laws are adjustable in the amount of curve, or deviation from linear, by as factor.
control laws: Red dead band linear in green and exponential in orange Dead Band Concept: In motion control interfaces a center resting point is frequently needed. This is the place where the human controller is telling the thing ‘don’t move’. Unfortunately with the very high resolution of the joystick, it’s difficult to exactly locate this point repeatedly. To further complicate the matter, most joysticks have a spring to center mechanism which centers the joystick if there in no pressure on it. This is nice but joysticks stop at a different ‘center’ depending on where they are released. For this reason, a ‘dead band’ is used. Dead band is a gap in the position data where the center of the stick ‘feels’ like it’s centered. The software takes any position data that falls into the dead band and reduces it to 50%. Data on either side of this gap are then fit into the 0% to 49% range and 51% to 100% range. For ServoJoy, dead band is calculated and filtered out right at the input stage of the data. The 50% position is also tied directly to the center of the servo travel for control law calculations.
Tank Drive Concept The tank drive utility takes data from two sources, an up down and a right left. It combines these two control axes and outputs right and left control data. It is there so that a joystick can be programmed like a tank drive. Full forward on the stick causes both right and left channels to go full forward. Full backward on the stick causes the reverse of both. Deflection right to left slows and speeds up the sides so that turns can be made in the direction of the deflection.
|
|
|