User interface

From Rsewiki
Revision as of 06:48, 28 May 2017 by Jca (Talk | contribs)

Jump to: navigation, search

Contents

Screen dumps

The user interface can configure and run the robot, as well as inspecting almost all values on the robot. Written in python using Qt GUI library.

The interface looks like on figures below.


Gui robot.png

Figure 1. The general settings for the robot. The left panel is the general connection status and space for some messages from the robot. The central tab is mostly for configuration of the robot and some sensor and calculated values like pose and tilt. To the right is a fast graph of the last mission. NB! the data rate is low, so this is just to get an overview, use the log-function for more details.

Data logger

Gui rev0.png

Figure 2. The data logging options. A number of sensor values and interface points in the robot software can be logged. The text window shows loaded data from a mission. The log format is designed to be directly compatible with the 'load' function in MATLAB.

ACC and gyro

Acceleration logs the acceleration values in m/s^2 on all 3 axis (x (forward if in balance),y (left), z (up if in balance))

Gyro is rotation velocity around the same 3 axis. Unit is degrees per second (after calibration offset).

Encoder

Encoder values for wheel rotation (left, right) 48 values per rotation, increases on forward.

Motor voltage

Is the motor voltage - before conversion to PWM, is compensated for changes in battery voltage.

Motor current

Filtered current sensor values. zero current is calibrated just before start of a mission - this calibration sometimes make a mistake, resulting in a bad offset of the logged current. Value is in Amps. The value is filtered to match the log-interval, if interval is > 2ms.

Wheel velocity

Based on time between encoder tics - in units of 10us, it more tics within 1ms, then the interval time is averaged. When long time between tics, then time since last tick is used to calculate velocity, i.e. velocity goes towards zero with time if no encoder pulses arrive.

Turn rate

Is turn rate based on encoder tics (not the gyro), unit is radian/sec

Robot pose

Is position since start of mission (odometry coordinates), x,y,h,t where h is heading in radians (positive counter clockwise), and t is tilt in radians (zero is in balance, positive is forward).

Line sensor

All values related to line sensor, including AD value from each sensor.

IR sensor

Is distance converted to meters for each sensor (default is sensor 1 is right and sensor 2 is forward.

Battery

Battery voltage in Volts.

Extra

Debug feature for log of extra values.

Mission

State, Thread, Line, Event. Where State is mission state (should always be 2, or 8 when stopping), thread number and line number in that thread, for the latest line activated (if more than one is activated in the same log interval, then the latest is logged. Event is a 32bit integer where each bit corresponds to an event number, events are accumulated over the logging period.

Motor ref

Is the desired motor velocity (input to velocity controller) - in m/s

Control time

Is the time taken to handle sensor data, calculate control values and advance in mission lines - this should be finised within 1ms. Value is in micro seconds, so should be below 1000 to ensure valid control calculations.

Control details

Value order: r, m, m2, uf, r2, ep, up, ui, u1, u

The control details gives details at data points connected to or inside the general PID controler design used for all control settings. These control data points are illustrated in the figure below.

Controller block overview

Gui control data points.png

Figure 3. The general PID controller design with additional optional controller parts. "r" is reference input. And after the optional "pre-filter" the reference is compared with the measured value "m", optionally through a Lead filter. The "m-dot" is an optionally derivative of the measurement, that can be used for a less noisy Lead (with tau_d as normal, but no pole). The error signal "e" is fed through a gain "Kp", an optional Lead and an optional integrator. After this the output "u1" is summed from "up" (proportional/Lead), "ui" integrator term and "uf" from an optional feed forward branch. The output "u1" can further optionally be integrated (if Kz=0, if Kz=1 then the post-integrator has a zero). The output is finally limited to signal "u".

The yellow circles indicate the datapoints that can be logged.

All integrators can be limited. The integrators are further disabled if the output limiter limits the output. Some of the control interfaces (all but the balance controllers) further disables integrators when there is defined an acceleration limit in the mission, and this actually is limiting the acceleration.

The "post-integrator" is (mostly) usable in the balance controller.

The balance controller replaces the "Lead" after "m" with a "1", and uses instead the "m-dot" that is connected to tilt velocity from the gyro.

Controller configuration

All controllers can be configured from the "control" page. See Design_overview for more control details.

Gui control.png

Figure 4. All control values are set from this page, click on the relevant controller and enter the relevant values in the dialogue window shown below.

Gui control dialog.png

Figure 5. This dialogue configures the wheel velocity controller - shown as a PI-controller with output limit at (+/-) 9V and a lead in the feedback branch with a zero and a pole. All other options are disabled. The blue boxes indicate a traditional PID controller with lead in forward (and)/or in the feed back branch.

When disabled lead/lag and pre-filter just pass input to output, where integrators and feed forward that is disconnected when disabled. When "enable controller" is disabled, then the control is disabled. To use feed forward only, enable controller, but set Kp=0, and enable feed forward with some value for Kff.

IMU

The IMU page shows data from the IMU, and is used for tilt measurement for the balance controller only.

Gui IMU.png

Figure 5.1 IMU data. The graph shows calibrated values, and the gyro is calibrated by keeping the robot satble and press the "calibrate" button. (remember to save the result in robot flash). The servos drift slightly, so repeat if needed.


Menu

Regbot gui show menu.png

Figure 6. Other tab pages are available from the "show" menu.

Mission

Missions are entered through the mission tab:

Gui mission.png

Figure 7. Missions atr entered in the left (white) area, and can be syntax tested with the button above. The result of the check is shown in the yellow area (right). The mission actually on the robot can be fetched to the right area. Missions (the left area) can me saved and loaded from text files with the buttons below.

If you copy-paste from another application, so make sure not to include any formatting, 7-bit ASCII characters are allowed only.

Missions are not saved to the robot before you press "save to robot".

The mission is lost for the robot after a power cycle, unless you save the configuration to robot flash - using the "save to robot flash" to in the left pane.

Mission lines

Mission specification consist of mission lines, each line consist of two (lower case) parts divided by ':'

drive parameter: continue condition (continue conditions are OR'ed) 

e.g.:

vel=-0.2, acc=3.0 : dist=1, time=12

Drive backwards at a speed of 0.2m/s, accelerate with 3m/s2 to this speed, until 1 meter is driven (or max 12 seconds).

See Mission for more details.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox