Manual Configuration
MANUAL CONFIGURATION
Connect via ssh to the raspberry on the robot or use a laptop connected to Arduino with srrg2_orazio and marrtino_apps software installed.
Motor board configuration for ArduinoMotorShield
System version >= 4.2
On Raspberry (or laptop connected to Arduino)
cd ~
ln -sf .mb2019_motorboard .marrtino_motorboard
Restart the docker services
cd ~/bin
./stop_docker.bash
./start_docker.bash
Use the Config web interface to configure the firmware parameters
[start web config] [orazio web interface]
System version < 4.2
Follow the instructions below.
Docker images
Docker images are available to perform manual configuration without installing software on your machine. Download the docker image according to your setup
New MARRtino motor boards (firmware and protocol versions 2019)
Linux Intel/AMD64
docker pull iocchi/orazio
Raspberry PI 3/4
docker pull iocchi/orazio:arm64
Old MARRtino motor board - Arduino Motor Board (firmware and protocol versions 2018)
Linux Intel/AMD64
docker pull iocchi/orazio:2018
Raspberry PI 3/4
docker pull iocchi/orazio:2018-arm64
Run the image
docker run -it --privileged -v /dev:/dev --net host iocchi/orazio:<version> tmux
Execute the commands described below inside the container. You do not need to download the srrg software, since it is already available in the docker image (with the correct configuration for your setup).
Firmware Upload
Download the software repository
git clone https://gitlab.com/srrg-software/srrg2_orazio.git
(only for Arduino Motor shield) downgrade to old version of the code
git checkout 64ecae3304dd3da5bbcf3f1a16fcdf2f399a3671
Compile and upload the firmware:
$ cd <PATH_TO>/srrg/srrg2_orazio/srrg2_orazio/firmware_build/atmega2560
$ make clean
$ make
$ make orazio.hex
The Arduino Board is now running the latest firmware for MARRtino.
Robot Configuration
Modify the scrip upload_config.script in marrtino_apps/config to match your MARRtino model.
Then run
cd <PATH_TO>/marrtino_apps/config
cat upload_config.script | rosrun srrg2_orazio orazio -serial-device /dev/orazio
Web Server
New version
cd <PATH_TO>/marrtino_apps/config
source run_orazio2_web.bash
Old version
cd <PATH_TO>/marrtino_apps/config
source run_orazio_web.bash
Type CTRL-C to stop the web server.
Web Client
With a browser, open the URL
http://<SERVER_MACHINE>:9000
You will see a web application that allows you to monitor the state of your robot.
Read the help pages and follow the instructions to configure the robot.
Motor shields configurations
Arduino Motor shield
Firmware version
Protocol version: 20180915
Firmware version: 20180805
Firmware parameters
joint_params[0].param.h_bridge_type 0
joint_params[0].param.h_bridge_pins[0] 3
joint_params[0].param.h_bridge_pins[1] 12
joint_params[0].param.h_bridge_pins[2] 9
joint_params[1].param.h_bridge_type 0
joint_params[1].param.h_bridge_pins[0] 11
joint_params[1].param.h_bridge_pins[1] 13
joint_params[1].param.h_bridge_pins[2] 8
L298 chip (red version)
Firmware version
Protocol version:
Firmware version:
Firmware parameters
joint_params[0].param.h_bridge_type 1
joint_params[0].param.h_bridge_pins[0] 3
joint_params[0].param.h_bridge_pins[1] 2
joint_params[0].param.h_bridge_pins[2] -1
joint_params[1].param.h_bridge_type 1
joint_params[1].param.h_bridge_pins[0] 5
joint_params[1].param.h_bridge_pins[1] 4
joint_params[1].param.h_bridge_pins[2] -1
Velleman PKA03
Firmware version
Protocol version:
Firmware version:
Firmware parameters
joint_params[0].param.h_bridge_type 0
joint_params[0].param.h_bridge_pins[0] 3
joint_params[0].param.h_bridge_pins[1] 2
joint_params[0].param.h_bridge_pins[2] -1
joint_params[1].param.h_bridge_type 0
joint_params[1].param.h_bridge_pins[0] 9
joint_params[1].param.h_bridge_pins[1] 8
joint_params[1].param.h_bridge_pins[2] -1
MARRtino Motor Board 2019
Firmware version
Protocol version: 20191212
Firmware version: 20190915
Firmware parameters
joint_params[0].param.h_bridge_type 3
joint_params[0].param.h_bridge_pins[0] 9
joint_params[0].param.h_bridge_pins[1] 28
joint_params[0].param.h_bridge_pins[2] 29
joint_params[1].param.h_bridge_type 3
joint_params[1].param.h_bridge_pins[0] 8
joint_params[1].param.h_bridge_pins[1] 26
joint_params[1].param.h_bridge_pins[2] 27
Testing procedure
Encoder check. Turn wheels and check that encoder speed is consistent with encoder position for each motor: positive speed -> position increases
PWM check. Check PWM signals (mode 1): desired PWM sign = speed sign = corresponding encoder increment (PWM +) / decrement (PWM -).
PID check. Check PID controller (mode 2): use small speed values and check motors turn slowly (if not, motors may be inverted: power and encoder signals are sent to different motors, or PWM signal and motor current may be inverted).
Kinematics check. 0.1 0 = forward slow, -0.1 0 = backward slow, 0 0.5 = turn left slow, 0 -0.5 = turn right slow
Kinematics calibration
MARRtino (2017 high school model)
The following parameters are good enough
drive_params.ikr 10000
drive_params.ikl -10000
drive_params.baseline 0.405
drive_params.right_joint_index 1
drive_params.left_joint_index 0
drive_params.max_translational_velocity 1
drive_params.max_translational_acceleration 3
drive_params.max_translational_brake 5
drive_params.max_rotational_velocity 2
drive_params.max_rotational_acceleration 15
Quick manual calibration
You need Orazio web controller for this procedure (as explained above).
Use a tape to measure the baseline (distance between the wheels in meters) and set the baseline parameter in the Kinematics section with Orazio web controller.
Place the robot in a starting position and read the initial encoder values eL, eR of the two motors in the Kinematics tab of Orazio web controller.
Move the robot on a straight line and measure the distance m [meters]. For example, you can set a value of watchdog_cycles (e.g., 500 cycles) in the System Settings and a base_velocity command (e.g., 0.1 0) in the Kinematics section. This will move the robot straight for a few seconds.
Read the new encoder positions fL, fR and compute the differences for each motor dL = fL-eL, dR = fR-eR [ticks]
Compute ikl = dL/m and ikr = dR/m [ticks/meter] and save these parameters as drive_params.ikl and drive_params.ikl in the firmware configuration.
Save parameters in text file and upload parameters as explained in
https://bitbucket.org/iocchi/marrtino_apps/src/master/config/
Precise calibration
Follow instructions in