Manuale Poldino ENG - Elettra Robotics Lab

PoldinoBot
Robot for everyone
Educational Robot by
ELETTRA ROBOTICS LAB
www.elettraroboticslab.it
User manual rev.1.0
THIS IS NOT A TOY
INDEX
1. TECHNICAL FEATURES OF POLDINO_BOARD CHARACTERISTICS OF THE
BOARD
1.1 CHARACTERISTICS OF THE BOARD
1.2 COMMANDS AND CONNECTORS DEFINITON
2. ASSEMBLY
2.1 FIRST USE
3. PROGRAMMING
3.1 PROGRAMMING WITH IDE PINGUINO
3.2 RECOGNITION OF THE BOARD PROBLEMS
3.3 PROGRAMMING WITH IDE MICROCHIP (ADVANCED USERS)
3.4 RECOVERY PROCEDURE OF THE FACTORY FIRMWARE
3.5 POLDINO_BOARD TABLE OF PIN
1. TECHNICAL FEATURES OF POLDINO_BOARD
1.1 CHARACTERISTICS OF THE BOARD
-
Microcontroller: PIC18F4550
GPIO:29 (8 for motors, switch and LED)
ANALOG CHANNEL: 12
MOTOR DRIVER: Dual, PWM, 1A max
POWER SUPPLY: 6-11V detachable for bridges with auxiliary terminal
QUARTZ: 20MHz
EQUIPMENT ON BOARD: LED for user, on and battery status, user and reset switch
USB Port
BUS I2C
REVERSE POLARITY PROTECTION
1.2 COMMANDS AND CONNECTORS DEFINITON
From the bottom right of the board (Figure 1.):
- Mini-USB connector. Don’t power on the board during USB connection.
- Power main connector: It provides power to the board. The source must be between 6 and
11Volts. Compliant the indicated polarity. The board is protected from polarity but is better
take care about this aspect.
- Principal power selector: it connect the main power to the board.
- LED PWR STAB: It show the presence of power from the battery.
- PROG/RUN switch: switch the board in programming mode. In this mode the main power
supply is interrupted, but it is advisable not to turn ON the board during programming.
- RESET: is the reset button of the card, it works like master reset in RUN mode, is required
to start recognition of the board in PROG mode.
- P2: optional connector for reset. If you need to insert a remote reset button, in parallel to the
main button, you can connect it to P2.
- SW2 AUX: user button. Generic button for using the card. If you want to use it, you must
program the RD0 pin as an input, then connect the jumper on P3 / RD0 connector. If you
use the sample program pre-loaded, this button acts as a start-up, it must be connected.
- LED PWR UC: It indicates the presence of power on the board, which come from the
battery or from USB.
- LED RUN yellow: is the USER LED, it can be used at will in the programs, it is connected
to pin RA4 of the microcontroller. It is active low, so is ON when the pin is in low digital
state. In the sample program, it indicates that the robot is ready to start, after the start it is
OFF.
- GPIO: There are 33 GPIO pins arranged in 3 connectors of 11 pin. Each group has three
rows of pins: VDD, GND, pin. The order is equals to a standard RC servo type connector.
This configuration allows you to connect small external card, such as additional sensors,
bringing the power supply using the same connector. Pay close attention to the polarity of
the sensor to be connected, there isn’t any protection in case of error. For the sensors who
comes with the robot, the cables have been properly made, because the target polarity is
different. In general, you should always check this aspect. The maximum current that can be
taken from the card is about 700mA. If the current supplying external cards is relevant, it
-
-
-
may be necessary to mount a heatsink on the integrated regulator U5. For questions contact
the ERL support.
AUX MOT connector: it provides external power for engines, different from the primary.
Depending on the version you may need to mount it if you want to use it. The range remains
between 6 and 11V. If you want to use this connector, you must open jumper on the P11
connector, in this way the power from the main engines become disconnected. On this
connector there is protection for reverse polarity, but you need to insert an external auxiliary
switch.
EN_I2C connector: they are used to enable the I2C bus, connecting the pull-up resistors on
the card. The jumpers must be inserted only if you use this option, and if you enable the I2C
bus from the microcontroller. If you do not do this, close the jumper could damage the pins
RB0 and RB1 of the device. If you are using the I2C bus, the pins RB0 and RB1 may not be
used.
P9, P10, P14 connector: they connect the motor control outputs to the engine driver inputs.
In particular:
P10: Motor direction A
P14: Motor direction B
P9: PWM both engines
P11 connector: it enable the primary power supply for the motor driver.
The junmper P9, P10, P11, and P12 need to be connected to use the sample program.
If you do not want to use Poldino_Board to control the motors, or you want to use an external
driver, you can open these connectors and withdraw the logic signals by the connector to another
board, or impiagarli as GPIO.
The pins used for motor control are the following:
P9: RC1, RC2
P10: RB4, RB5
P14: RB6, RB7
- I2C: I2C bus, it need to be enabled by software, and through the EN_I2C connectors. It
-
allows to connect directly on the card 8 devices trought I2C bus, you can expand the
external bus, up to the physical limit of the protocol.
MOTA and MOTB: connector plugs for PoldinoBot Engines.
ICSP: programming connector for Microchip IDE (See par. 3.3 and 3.4)
Figure 1. Layout of Poldino_Board
2. ASSEMBLY
Axonometry
Photos’ sequence with commentary for mounting:
CAUTION: care to respect the polarity of the power connector, as shown below.
Warning: the cables for the sensors, are not direct, so, you have to connect them according to the
colors in the picture.
On the sensor, the cable sequence is: Signal - Ground (black) - Power (red).
On the board, the sequence is: Signal - Power (red) - Ground (black).
Attention to this operation: there are no protections in the edge of the sensor.
So, follow the colors of the wires as in the pictures below.
Insert the battery (not included) into the lower bay, and secure it using the elastic. We recommend a
9V battery, preferably rechargeable 200mAh. So, you can use your robot more and more. Before
connecting the battery, check that the main switch is in the OFF position. It's possible to use
different sources, BUT they between 6V and 11V. Always we recommend rechargeable batteries
NiCd or NiMh type. About lithium batteries, if you want decide to use them, you know: under
your personal responsibility.
ERL accepts no responsibility for different power supplies use, other than those recommended.
The robot is ready for first starting. Adjust the sensors as described in section 2.1
2.1 FIRST USE
Figure: top view of Poldino_Board
When PoldinoBot had been assembled, is ready for first start:
• make sure that the Prog/Run switch is in Run position and that the ON/OFF switch is in the OFF
position.
• connect the power supply battery.
• turn Poldino’s knob On/OFF in ON position (lever moved towards the screw clamp). All the
LEDs are on.
• Now, the robot don’t work, but now you can adjust the sensors’ sensitivity. Act on the sensor
potentiometer screw, as shown in FIG. The sensor has two LEDs, the red one, on the right, lights up
when powered.
The green one indicates the presence of the obstacle. So, adjust the sensor, according to the lighting
conditions where you are. A brightness’ change may require a new adjustment.
• the robot is ready to start up, so, press the SW2 AUX (red button): the robot moves according to
the preloaded program, avoiding obstacles. After startup, the yellow RUN LED is turned off.
3. PROGRAMMING
3.1 PROGRAMMING WITH IDE PINGUINO
Poldino is prepared for programming through the open source IDE Pinguino, which offers a
simplified approach, Arduino compatible also.
• download the IDE Pinguino from http://www.pinguino.cc/ site (version 11 recommend)
• install it following instructions, depending on your operating system
• realize your program or load an example from the site
http://www.elettraroboticslab.it/poldino.html
• complete the program through the appropriate button. You will be prompted for which card to do
this, so, indicate:
- 8-bit Architecture
- Programming mode: Bootloader
- Bootloader: v4.x
- Devices: Pinguino 4550
• connect Pinguino to the PC with USB cable, make sure that the PROG/RUN switch is in the
PROG position and that the main switch is OFF.
The LED D2 PWR_UC (green) is on and steady, the PWR STAB LED (red) is off.
• Press the reset button (black), so, now the RUN LED (Yellow) should start to flash.
If this does not happen, please, read the section about the recognition card’s problems.
• click the button to load the program.
• wait for the message about finished loading
• disconnect Poldino and return the PROG/RUN switch in RUN position.
• Turn Poldino (main switch), and start it, according to the loaded program.
If you loaded the sample program, start as in the paragraph First Use.
3.2 RECOGNITION OF THE BOARD PROBLEMS
When you connect Poldino_Board to the PC, in a Windows environment, it maybe that the board
will not be properly recognized, so you can’t load the compiled program. This fact ‘cause different
reasons, but usually the following process is decisive.
Download
the
package libusb-win32-bin-debug-1.2.6.0
also
available
at:
http://www.elettraroboticslab.it/poldino.html
Install (administrator only)
Perform the filter installer
Perform Inf Wizard with the board connected to the PC, if the board is not yet identified,
press the board reset button.
It should be visible in the USB list, as Microchip or P8 device
Select the board in that list to filter it
Return to the IDE Pinguino and repeat the loading procedure.
If this procedure does not work, PLEASE, write on the forum IDE Pinguino or contact the ERL
support.
3.3 PROGRAMMING WITH IDE MICROCHIP (ADVANCED USERS)
If you want to program Poldino with IDE Microchip or equivalent, you can use ICSP connector on
the edge of the board. You can use PICkit2 or Pickit3 type programmers or compatible. Serigraphy
indicates pins’ functions. Ensure pins’ correspondence with their programmer before proceeding.
CAUTION: If you program Poldino using this way, the firmware will be deleted: the PC will
recognize no more the board by the USB port.
It’s possible to restore the factory firmware, again using a PICkit2 or Pickit3 programmer or
compatible (see specific procedure).
When you’re programming, you have to unplug every device on pins RB6 and RB/(PGC, PGD).
The Prog/RUN switch, must be placed in the PROG position, and the main switch must be OFF.
3.4 RECOVERY PROCEDURE OF THE FACTORY FIRMWARE
CAUTION: this procedure is not necessary if you use the IDE Pinguino, ‘cause Poldino_Board had
been preloaded with this firmware. So, use this procedure only if you used a different IDE (example
MPLab) wanting to bring the board to the factory initial condition, in order to use the Pinguino IDE.
Download the file: Botloader_v14.4_18F4550_X20MHz.hex
You can found it on the site or to http://www.pinguino.cc/
http://www.elettraroboticslab.it/poldino.html page.
This is the bootloader already compiled into machine language, which allows operation with the
Pinguino IDE.
To load it in the memory board, you must have an IDE Microchip (or equivalent) with a PicKit2 or
PicKit3 type programmer or equivalent. If you use the Pickit2, all you need is the tool, to load into
memory.
Set the PROG/RUN switch in the PROG position
Make sure that nothing is connected to RB6 and RB7 board pins
Connect the programmer by ICSP connector. The MCLR terminal, indicated on the board, has
identified on the original Microchip programmer by an arrow. Again we recommend for this
procedure, to refer to the IDE manual that you are using and its programmer.
Load the .hex file as the procedure of your IDE.
3.5 POLDINO_BOARD TABLE OF PIN
Pin name
Digital
I/O
up to 5.5V
tolerant
Analog
input
Other
Pin on
Chip
Microchip name
0
Yes
Yes
SDA / SDI
33
RB0/AN12/INT0/FLT0/SDI/SDA
1
Yes
Yes
SCL / SCK
34
RB1/AN10/INT1/SCK/SCL
2
Yes
Yes
35
RB2/AN8/INT2/VMO
3
Yes
Yes
36
RB3/AN9/CCP2(1)/VPO
4
Yes
Yes
37
RB4/AN11/KBI0/CSSPP
5
Yes
Yes
38
RB5/KBI1/PGM
6
Yes
Yes
ICSP PGC
39
RB6/KBI2/PGC
7
Yes
Yes
ISCP PGD
40
RB7/KBI3/PGD
8
Yes
Yes
Serial TX
25
RC6/TX/CK
9
Yes
Yes
Serial RX / SDO
26
RC7/RX/DT/SDO
10
Yes
Yes
15
RC0/T1OSO/T13CKI
11
Yes
Yes
PWM
16
RC1/T1OSI/CCP2(1)/UOE
12
Yes
Yes
PWM
17
RC2/CCP1/P1A
13
Yes
Yes
Yes
2
RA0/AN0
14
Yes
Yes
Yes
3
RA1/AN1
15
Yes
Yes
Yes
4
RA2/AN2/VREF-/CVREF
16
Yes
Yes
Yes
5
RA3/AN3/VREF+
17
Yes
Yes
Yes
7
RA5/AN4/SS/HLVDIN/C2OUT
18
Yes
Yes
Yes
8
RE0/AN5/CK1SPP
19
Yes
Yes
Yes
9
RE1/AN6/CK2SPP
20
Yes
Yes
Yes
10
RE2/AN7/OESPP
21
Yes
Yes
19
RD0/SPP0
22
Yes
Yes
20
RD1/SPP1
23
Yes
Yes
21
RD2/SPP2
24
Yes
Yes
22
RD3/SPP3
25
Yes
Yes
27
RD4/SPP4
26
Yes
Yes
28
RD5/SPP5/P1B
27
Yes
Yes
29
RD6/SPP6/P1C
28
Yes
Yes
30
RD7/SPP7/P1D
29
Yes
Yes
6
RA4/T0CKI/C1OUT/RCV
OSC1
13
OSC1/CLKI
OSC2
14
OSC2/CLKO/RA6
Reset switch /
ICSP MCLR
1
MCLR/VPP/RE3
USB-
USB
23
RC4/D-/VM
USB+
USB
24
RC5/D+/VP
Vusb
USB
18
VUSB
RESET
RUN LED /
USERLED
VDD (up to
5.5V)
11
VDD
VDD (up to
5.5V)
32
VDD
VSS (Gnd)
12
VSS
VSS (Gnd)
31
VSS