First Setup

After the assembly of Farrusco is completed let’s test all of its components and check if everything is working properly.

First you will need to install FTDI controllers so Farrusco’s Motoruino can be recognized by your computer.

If:

- you don’t have the FTDI controllers installed, or never heard about them;
- you don’t know what a Serial Port is;
- you’ve never used Arduino and/or Processing;

Then jump to Arduino’s page where is explained step by step the instalation in Windows, Mac and Linux.

Download a set of examples from our github where you can begin with a blinking led, and get into the principles of obstacle avoidance.


If:
- you are familiarized with Serial Port;
- you have the FTDI controllers installed;
- you have used Arduino and/or Processing;

Then you can continue with the tutorial.

With the FTDI controllers installed, download the configuration pack and programming of Farrusco, several examples of navigation and the configuration programs are included in this pack.
DOWNLOAD HERE

If your Farrusco was acquired before May 1st 2011 it’s necessary for you to open the Arduino configuration sketch, for that go to the folder [FARRUSCO/00 SETUP/FARRUSCO_ARDUINO/] and open FARRUSCO_ARDUINO.pde.

Upload this program following the specific indications of your Operating System: Windows, Mac and Linux

The Farruscos acquired after this date have already the necessary programming to continue.

Inside the folder [FARRUSCO/SETUP/APPS], choose your Operating System (windows, osx, linux)  and open the aplication [FARRUSCO_PROCESSING].

The first screen shows up the serial ports available on your computer, depending on your operating system, the list of ports will have different names and numbers.
Windows
00_SERIAL_PC
In Windows, the Serial Ports are called COM#, and can have different numbers depending on which computer and/or Windows version you are using.
010_1
In this case I know that my serial port is COM6, and I can find out going to the Device Manager and looking at [COM&LPT] ports.

Mac
00_SERIAL_MAC
In the OSX the Serial Port appears like this, if you have modems, mobile phones and printers, this devices will show up on this list, so if you are not sure, try one at the time.

In this case I have only the Motoruino USB Cable connected to this computer and I know that the Serial Port concerned is the first one.

When the correct Serial Port has been selected, you will enter in a GUI (Graphic User Interface) that will tell you the state of the multiple components of Farrusco:

- Bumpers (colision sensors)
- Distance Sensor (SHARP Infra-Red Sensor gives a range of 10 – 80cm)
- Servo Position (the angle in which the Servo motor is turned at the moment, this motor has the range from 0 to 180º)
- Motors Control:this 4 bottons control Farrusco’s motors:

F Front

B Backwards

L Left

R Right

PWMPulse Width Modulation, with this functionality you will be able to send controlled voltage by the Motoruino PWM (3, 5, 6, 9, 10, 11) pins, having a range from 0 to 5 volts, that will be translated in values from 0 to 255.

It is normal that Farrusco won’t perform a straight line, and for that we need to send a little less voltage to the motor that is spinning faster. But we’ll talk about that later.

interface
For now it’s necessary to placeFarrusco in a obstacle free and flat zone.

To correct the Farrusco’s motors spin direction we’ll need to use the wires that are plugged in the [IN] zone of Motoruino.

Always remember that the pins we are using are digital pins 3 and 5 to one motor, 6 and 11 to another motor. It’s not important to define if we’re working with motor A or B because in the assembly process there are lots of things that can change from user to user.

From example, if the wires that connect the motors to Motoruino are inverted that will affect the configuration of the motor A and B.

For this, we created this application that will simplify the Setup process.

motor_in

Enough conversation, let’s press the F button, and Farrusco should move forward.

If the bot walks backwards it means that you need to swap both motors wires to invert the rotation.

Compare the two images and notice that the wires were switched in both motors.

01_ambos_motores_invertidos

If you press the F button and Farrusco rotates around itself, it means the wires from one of the motors is inverted.

To solve this situation you need to identify which of the motors is not moving forward and invert the connection wires.

02_um_motor_invertido

When pressing the R button, Farrusco should rotate around itself to the right, clockwise.

If Farrusco rotate to the left it means both motors are switched, you need to swap both wires that connect the motor A and connect them to motor B, and the wires connected to motor B should go to motor A.

If Farrusco walks forward instead of rotate it means one of the motors is inverted, check out the previous step.

02_um_motor_invertido
The same logic applies to the [L] Left button, but while testing one side we’re automatically testing the other side.

BUMPERS (colision sensors):
bumpers
The Bumpers detect if there were collisions, and it’s necessary that they are properly connected so Farrusco knows in which side there was a collision, so he can retreat and step of in the opposite direction.

If you press the Left Bumper on Farrusco, and if in the screen the right Bumper lights up, it means the wires are switched in the 7 and 8 pins and you have to swap them.

The same applies to the right Bumper.
04_fios_bumpers

The Distance Sensor should show the correspondent value to it’s readings, place your hand in front of Farrusco’s “eyes” to see this readings vary. The bigger the value, closer the obstacle is.

If the sensor readings variate a lot, or if you don´t see any value at all, check if the sensor plug is in the pin ANALOG 0, and the black wire is in the GND row.

distancesensor

06_sensor

The slider that controlls the ServoMotor positions the servo horn in the angle that you choose. The important thing in this controller is to check if, at 90º, the head is looking as forward as much as it can get.

servo

05_servo

If everything is correctwe can procced, in this program you have the possibility to select 2 navigation modes.

Obstacle Avoidance: the robot wanders in space and when gets closer to an object it will diverts untill it finds a safe distance to run. This behavior is set as a group of conditions that we will see ahead.

Free Space: the robot wanders in space and when it gets closer to an obstacle will stop, look from one side to the other, compare the distance measures and continues in the direction of the biggest distance.


Choose one of these navigation modes and press the SAVE button.

Next unplug the USB cable on Farrusco side, and the bot should start moving around with the choosed navigation state.


Congratulations! Farrusco’s configuration is completed.

If you want to get more behaviours for Farrusco download the .zip file from our github.