101
MICROCONTROLADORES EN ROBÓTICA MÓVILAUTORES: NÉSTOR FERRER IMAÑAS XAVIER PARLADÉ RIOS JUAN ANTONIO JOSÉ GIMENO TITULACIÓN: INGENIERIA TÉCNICA EN ELECTRÓNICA INDUSTRIAL DIRECTOR: PERE PONSA ASENSIO DEPARTAMENTO: ESAII FECHA: 26 de Mayo del 2003

MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

  • Upload
    voliem

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

��

���

“ MICROCONTROLADORES EN ROBÓTICA MÓVIL”

AUTORES: NÉSTOR FERRER IMAÑAS XAVIER PARLADÉ RIOS JUAN ANTONIO JOSÉ GIMENO

TITULACIÓN: INGENIERIA TÉCNICA EN ELECTRÓNICA INDUSTRIAL

DIRECTOR: PERE PONSA ASENSIO

DEPARTAMENTO: ESAII

FECHA: 26 de Mayo del 2003�

Page 2: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

��

����������� ��� ����

��������� ���� ���� ����������� �������� ����������������� ���������� �������� ������������������ �� ����������������� � ���������������� �������� ������������������ ����� �� ���� ���� �������������� ��������� ��������� ������������� ������� ������������������ ���� ��������� ������!���������������"#$��%&'()�������� ���� ��*���������� ��� ���� �+��,���� ���������� �����-��� ������ ������"#$!� ��� ������������ ��������� � �� �������� � ���� �!��������������������������� ����������������������� �� ����������� ����������� �������������� �������� !��� ����� ���������������������� ��-� �� � � .�� ���"#� ����������������������������������!������������� ����������-� ���������������/� ������ � �!�� �������� ������� ��� �*������� ����������� �� ������!������������������� �!����� ��������!����������!������������������ ����� � ������

�����������������

Microcontroladores Servomotores Estructura

Robótica Hardware Timers

Móvil Software PWM

���������

Page 3: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0�

�������

���123�4"51$�����������������������������������������������������������������������������������������������������������'��

���"64�178##"96�������������������������������������������������������������������������������������������������:�

� ����;<� � ������������������=�����������������������������������������������������������������������:�

�����#���� ��������� ���� ���������������������������������������������������������������������>�

������������?-��� ������������������������������������������������������������������������������������������>�

�������� ������� ���������������������������������������������������������������������������������������>�

������� � ����0�4 ������������������������������������������������������������������������������������������������>�

� ��0�7�� ������ �� � ��������������� ����� ����������������������������������������

� ��@��#�� ����� �� � ��������������������������������������������������������������������������������������������������

������ � ��@����� -�������������� ��������������������������������������������������������������������������������

������ ��@����A ��� ������ �� �������������������������������������������������������������������������

��@�0��1��������� ���������������������������������������������������������������������������������������������� � ��@�@�4� ���� �� �����������������������������������������������������������������������������������

0��,�����������"#�%&'()�����������������������������������������������������������������������������������������@��

0�����;<��� ������"#=�"�������������������������������������������������������������������������@��

0�����&����������������������"#���������������������������������������������������������������������B�

0�0���#���� ��������� � �� ��� �������������"#�%&'()������������������������������������%�

�0�@���5������ C� ���D ����������E��� �F�����������������������������������������������������������(�

�0�B���5������"�� ��������������������������������������������������������������������������������������������������

�0�%���$��� ���� �� ������������������������������������������������������������������������������������������

�0�(�#���� �������� � ���� �������������������������������������������������������������������������������@�

Page 4: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@�

0�(����#������������� �������������������������������������������������������������������������������(

������� 0�(���� ������G����������D$,���F������������������������������������������������������������������:

��������� � 0�(�0��� � ������������������������������������������������������������������������������������������������������0>�������� � 0�(�@��4 ��������H��������DH74F�������������������������������������������������������������0��

0�'���� ����� �������E$���������������������������������������������������������������������������������������00�

0�:���4�� ����������������������������������������������������������������������������������������������������������������0:�

0��>��� �������� ��������������������H �����������������������������������������������������@��

0�����"�� ����� ���������������������������������������������������������������������������������������������������@%�

0������ ���������� ���?E7�����������������������������������������������������������������������������������@'�

0��0���8$?�4�����������������������������������������������������������������������������������������������������������@:�

@��?�,"#?#"16�$��6�,?��1294"#?� 95",�#16��

�,��"#�%&'()����������������������������������������������������������������������������������������������������������������B>

@����)�,1���I7�4�#41��� �����������I ����� �����������������������������B>�

@������"����������������������������������������������������������������������������������������������������B>

������� � @������#���� ���������������������������������������������������������������������������������������B>

������� � @���0��#���� ��������������������������� �����������������������������������������������������B�

������� @���@��?-��� ��������J� ������������������������������������������������������������������������B�

������� @���B���� � ���������� ��� �������)�� ������������������������������������������������B�

@���%������������ �*��������������������������������������������������������������������������������B�

@���(��$���J� ����������������������������������������������������������������������������������������������B0

����������� � � @���(��������� �������������������������������������������������������������������������������B0

������������ � � @���(��������� �������������� ���������������������������������������������������������B0

Page 5: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B��

� @���(�0��#���������������������� ��������K������������������������������������������������B0�

@���'��?��� �������������������������������������������������������������������������������������B@�

@���:��#��������� ����������������������������������������������������������������������������������������B@

@����$#�?4#A"��������������������������������������������������������������������������������������������������BB

@������"�������������������������������������������������������������������������������������������������BB

@����������������� �*��������������������������������������������������������������������������BB

@���0��?-��� ��������J� ������������������������������������������������������������������������BB

������������ � � @���0����$ ��� ��� ���������������������������������������������������������������������BB

����������� � � @���0����&� �� �� ����� ������������������������������������������������������������������BB������������ � � @���0�0��#������� ��� C*������������������������������������������������������������������B%�

@���@��$���J� ��� ���� ������ ���������������������������������������������������������������B%

@���B��#���� ������������������ ����������*�� � ���� �������������������������������B(�

@���%��#��������� ����������������������������������������������������������������������������������������B(

@�0���������C������?�.�����������������������������������������������������������������������������B'

@�0����"��������������������������������������������������������������������������������������������������B'

@�0��������������� �*��������������������������������������������������������������������������B'

@�0�0��$���J� ����������������������������������������������������������������������������������������������B'

@�0�@��#���� ������������������ ��������������������������������������������������������������B'�

�������������������������@�0�B��#���������������������������������������������������������������������������������������������������B:

� �@�@���,?4?&1� ?��1294"#?�$82?#8L4"#?��#164�1,?7?��1��86�?,M1�"4 1�M�6N4"#1�������������������������%>

@�@����"��������������������������������������������������������������������������������������������������%>

�@�@����$��� ��� ��������������������������������������������������������������������������������������%>

�@�@�0��$��� ���� �*�����������������������������������������������������������������������������������%�

�@�@�@��$��� ��� � ������������������������������������������������������������������������������������%�

�@�@�B��$���J� ����������������������������������������������������������������������������������������������%�

�@�@�%��#��������� ����������������������������������������������������������������������������������������%�

Page 6: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%�

@�B������������ ���2����������������������������������������O O O O ����������������������������������O O �%@

@�B����"��������������������������������������������������������������������������������������������������%@

@�B����$��� ���� �*�����������������������������������������������������������������������������������%@

@�B�0��A��J� ��������������������������������������������������������������������������������������������%B

@�B�@��$���J� �����������������������������������������������������������������������������������O �������%B

@�B�B��$��� ��������������� �������������������������������������������������������������������%%

@�B�%��#���� ���������������������������������������������������������������������������������������%%

@�B�(��#���������������������������������������������������������������������������������������������������%(

@�%����.�����������������������������������������������������������������������������������������������������%'

@�%����"��������������������������������������������������������������������������������������������������%'

@�%��������������� �*��������������������������������������������������������������������������%'

@�%�0��A��J� ��������������������������������������������������������������������������������������������%:

@�%�0����#������� ����� �� ����� � ��,�:0���������������������������������������%:�

����������� � � @�%�0�����"#��%&'(%�����������������������������������������������������������������������������%:

@�%�@��$���J� ��� ���� ������ ���������������������������������������������������������������(>

@�%�B��#���� ������������������ ��������������������������������������������������������������(>�

@�%�%��#��������� ����������������������������������������������������������������������������������������(>

@�(��M1$(��������������������������������������������������������������������������������������������������������������(�

@�(����"��������������������������������������������������������������������������������������������������(�

��������� � @�(������, � ��"�����?����������������������������������������������������������������������(�

@�(��������������� �*�������������������������������������������������������������������������������(�

@�(�0��A��J� �� ��������M1$(�����������������������������������������������������������������(0

��������� � � @�(�0����$ ��� ������������ �� ��M1$(�������������������������������������������(0�

��������� � � @�(�0����?������ �������������������������������������������������������������������������������(0

@�(�@��$���J� ����������������������������������������������������������������������������������������������(0

Page 7: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(��

@�(�B��#���� ���������������������������������������������������������������������������������������(@

@�(�%��#��������� ����������������������������������������������������������������������������������������(@

@�'�� "#�1��1214�P5���� P�����������������������������������������������������������O O ��(B

@�'����"���������������������������������������������������������������������������������������������������(B

@�'�������������� �*��������������������������������������������������������������������������������(B

@�'�0��A��J� �������������������������������������������������������������������O ����������������O �(B

@�'�@��$���J� ����������������������������������������������������������������������O �������������������(%

@�'�B��#���������������������������������������������������������������������������������������������������(%

@�:��������$8 1Q� ? �1Q�������������������������������������������������������������������������((

@�:����"��������������������������������������������������������������������������������������������������((

@�:��������������� �*�������������������������������������������������������������������������������((

@�:�0��A��J� ��������������������������������������������������������������������������������������������('

@�:�@��$���J� ���������������������������������������������������������������������������������������������('

@�:�B��#���� ������������������ ��������������������������������������������������������������('�

��������������������������� �!������������������������������������������������������������������������������������������������������������������������������������(:

B��������������� ���� ���� ���� .�������������������������������������������������������������(:�

B����6�� ���&�����������������������������������������������������������������������������������������������������������'>

���B������ ��� ����� ������ ������������������������������������������������������������������������'>

��������� B����������������������������������������������������������������������������������������������������������'B

������� B���0�� ���������� ���� ����������������������������������������������������������������������������''

������� B���@����� ���� �������������������������������������������������������������������������������������':

�B���B��� �������� ���� ����������������������� ����� � ������������������������������������������������������������������������������������������������������������������������������:�

"��������!�������������������������������������������������������������������������������������������������������������������:(�2"2,"1M�?&"?������������������������������������������������������������������������������������������������������������������:'�$�����H ������������������������������������������������������������������������������������������������������������������������������::

Page 8: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'�

1. Objetivos

,�����G ������� � �� ������� ����������� �� ���� �� ������� �������� ���������������� ������������������!����� ������������������������������������������� ��������� ������������ ���� �������������� �������������� ��� ��������� ������������ ����������������"#��%&'()����� ���������� ��������� ����������������� ��������� � �� ���������������� �� � ���� ��� � ������������� ���� � ������ �� � � � -�� �� ��� G ����� ���� ���� � � ������ ����� �� �� ���� ���� �� �� �������������� � � ���*� ��� � ������ ������� � � ���� ������������ -� � ������ ���� �������� � �������������� �!� C�������������������-� � ��������������������� ���� � ���������� �� � �������� ���� G �����-� �� �����������R������� �-�� ���������������� � ������ ���������������� ������� ����� �!� ��� ���� � � -�� � ����� ��� ���� ����� � � ������� �� -� � � ���� ���� ���� ������������� ������� ����� ���� ��������-� ������ ������!���������� �-�� ������������� �� � ������������ ���������������������� ��������R������� �-�� ����������� � ����� ����� � ����������������������� ����� � �������������

#������G ������ ������� �������������� � � ������������ �� ������� ���������������� ������� ��������� �����������������!������ ����������� ��������������-� ���� ���� ���������� ���*�� �� ������� �������������,���-� �� ���� �������� �� ��� ����� ���������� ����-� ��������G ������������������������ � ���� ���������������-� � �� ������ ������������ ���������������� �� ���� ����������������������������� ������� � ������-� ������ �������� ���� ��������������� �� ������� ���� ������������

Page 9: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:�

2. INTRODUCCIÓN

2.1. ¿Que es un microcontrolador?

��

,���������������� ���������� ���������� ������� ���������-� ��� �� ������*��� ���.���:(%������-� ���� ����� ���� ������ ���� �� ��� � � ������ �������� �� ��������� �� C� ���� D����!� ����!���� ���!���F������-� �� �� ����������� �������� �� ��� ������ ��������*�� -� .����&� ���� �������"64�,S�� ��-� � ���:'�!������������ ���������������������S� �� ��*������� ����� � �������������!����-� �$"� �6$�S!�?4 �,S!������������� ������������������

?������ �� � �������� � ��� -� � ��� �������������� �� ��� ���� ��� ��� ����� ������ �� � �� ���� ��������������4 � ����-� � �� �� �-� � ����������� ���� �������������� ����� ��� ��� ���� ����� ��� G ���!����'>'%!����-� ��� ������ ���G��� ��� �����G������� ����� C� ����5 �������������� ����������� ������� ���������

��

• #��������� ��� ���'�����!����-� �������� �� ������� ������������������ ��� ��%� ���������0��������5 �������� ��������� ������� ����������

• #�������� � ��G������������• �? ���� ���� ���'��������������������• �1 ���� ���� �@T2�����������• & �� ������� � ��G�� �������0>� ���U��• R���� ��� ����� � �����E�������������� �!���������� ��� ����� �� ���� ���� ��� �

���� �� ��������� ��E������������U��• 2�G����������D� ���� �� ��#A 1$F���• $��������������� ���������� ����������• $��� ��� ����������� ���� ������� ������ �������������*������� �������!�����-���������� ���������• "��������� ��� �� ������ � ��������2�����2�����• ��������� �� ������ �����G��� ���������� ����� �������1 ���� ���V��? � C� ���������

������? � C� �����• ������������ �������� ������ ������1 ���• ��� �������� ���-� �������� ������������ ����������� ����#�8�DP� ��M����*��P�H �����7��F���• ������������� ��������������� � �������������� ���!������ �&8,,I78�,�)!��$�0�!��$@0�!� ���!��• ������������� �������� ����������� ������ ����� �������H ��U��• ����0�� ������� ��� ��%��������• B���%�"�� ����� ��������� ��������� � ��� ����������

6���� U+� #���� � �� -� � �� � !� ������� -� � ��� ����� ������� ��� ��*� �������� � �� ������ ����������������� �!�� �� *�� ����� ������ ���������� ���������� ��������-� ��� �� ���������� ���

Page 10: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�>�

2.2. Características de un Microcontrolador

#�#�$�� %�&�!��������

���' �!���(������)�?������ �� ����������������M � ��� �� �������G��� ������� ��

����*�!(!�����!(�������������+)��� ����� �� ������������������������ ��� ������� ����� �� .���

%����*%''�!���!����'��!,!������(���������������+)�7�� .������������������������������������� ���

�����)�#�������!��������� ��� �� ������������������ ��*��� ����� ��������

�-+� ./�0� ��� ��� ����!��1� � $ � �������� �� ������� ��������� �� D;������� � � ��=F!� ���-� � �������������� �� � ������������ ���������������� ����D;?$"�=F!����������������������������� ������� �� ���*������D;7$�=F��

#�#�#�� �������!�����

2������-�)� @!� '��� �%� ������7 �������������� ����� �� ����� ��� � �������� D � �������������!���������� � �������!���������������������� ��������� ��� ���� �!� ���F���

2�������!�)� �%��� 0�� ������ 4� ��� � �������������� �������� � ��� ���� ���� D������� �� ���������!�� ������������� �!��7?!� ���F��

2��������)�0�!�%@!���'�������&����� ����� �� ��� ���� ����D�� ���� �!���� ���������!� ���F�

#�#�3�� ������(4��

%�!������! �)�B5!�0�05!���B5!���5�

������)�� �� �WH ���� � ����� �H �

5�������!�)�� �� �TA����MA��

Page 11: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

���

2.3. Diferencias entre Microcontrolador y Microprocesador

���6�!���'����������*7�+)���������� ��������������� ����� ����������

6�!���������������*7+)�7������������� �����-� ������� ���������� ����!�� ��������������������

����������������������������������������������� ��������D������������� ��64�?7?E$?,"7?!����� ���� ��?E7!�� ���

������������������������������������������������ �������������!� ���F��

Page 12: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

���

2.4. Criterios de selección

#�8�$�� ��&�!�!����9�������

6�������!����)�;#��� � � ���������� �=�?�*������� �� ����� ����� ������� �� ���������������������������������D �� ���������� ������� �����J� ������ ������J� F�����������������������������-)�#������� ���� ������� ����� �������� ����� �����J ���

6 ������(4�)����� �������!�����������6 ����)�D� �� ��B>������B>�>>>�������*�F��6 5!��!�!���)�&����� ����� ����������� ��� ����� ������������������������������-�)������ �?������� �����X'>�D'�����!�Y�:(>F������� �� ������"""� ��� � ��������

#�8�#�� :�����!��������������������

I�� ���!����� G����!� ������� ��

#�8�3�� ������,��������

- �;'��!���!��9���'����)�D� � ������ ��*������H �+�� ������IZ�0�B>>�>>>!������������������������������������������$���IZ���B>>�>>>!�'>B��IZ��0>�>>>!�%'A#���IZ��>>�>>>!�X'>�IZ�:B�>>>F��I���'��!�!�!���)�'>'%�IZ�'>�'%�IZ�'>0'%�IZ�'>@'%�IZ�� �������������������������������������%'>��IZ�%'>:�IZ�%'���IZ�%'���

6��!�'��!�!�!����9���(������,������)�,�� ���������� ������������ ��� �������� ������� ����������������������������������������������������������������������������������� ����������*�����$� � ������ � �� � ������ �������� �� �����������������������������������������������������������-� �������� � �������������

��

#�8�8�� !��'����������������

I���'�����! �������!��'������������������������������,!�!��)�� -� .��� ������ �� ���� ���� �� ���� ����������������������������������������������������������������������������������������������������������������� ��� ������ � ������������ �������������

���

Page 13: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�0�

��I�<!������!��������'�������)�,�������� ����� �������������� ����������� �������� ���*�������D���� ���������������������������������������������������������!� ������������.��F���I������������!���������������(4�)�,��*���� ���������� ����� ������������ �-� ������� ����� �� ����������������������������������������������������������������� ����� �������������� � ���� ��������������������������������������������������������������������-)�A�� ���������� .��� ������� ���� � �������!�-� ����� ����� �������D����������������������������������������������������������������������������?� !����>> A�!��������������� ��>�HE A�F!� �������������������������������������������������������������������������������������.����#���������������� ������ � ����� ���� �������D�������� ����������������������������������������������������������������������?� ����0>>� �����B�HE A�F��������������������������������������������

Page 14: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�@�

3. La familia PIC16F87X

3.1. ¿Qué es un PIC? Introducción histórica.

./�0���������1��

8���"#� �������������������������� ��� ��������1 E&,?$A�� ����������� �������4 ����������

���������! ��=!�� �!����

����:%B�M"�������������������� ����� � �������!�� ����������� � �������� ����-��� ����������� ��� �� ��������1 �������1 ��7 ���������� � ������M"� ��� � ��������7���������� ��������� ������� �� �� �������������������� ����� �������� ��������� ��������������� ���������������?/0ICCCC���?/BICCCC���

M"���������� ����������� ������ ��%����!�� ���������#��%>>!������������ �����(>����� ��� ���������� ������������ !� ������������� �� ��� ������ G������ ����� ��E$����������������������� ������ � ��������M"���� .�����#���������� �"�� ��� �� �������D�"#F� ���������:(B��&� ���� .�������� �����*���!��� �*��� �� ��������������� ��E$���������*-������ ��%������ ������� � ����������������������� �������������� �!������-� ����������� ����������� ���� � -� .����

6�� ��� � C��.��-� ���� ����������� .���� ���:(B� �!������������ �� !�����-��� ������ ����������"#�%#BC��?� �*�!����� ������ ��:(B��� ��������������� ���������6 1$�������� �������������� � ��� ���� ��� ��1 �� ��*����!� ��� ������� ��������� �� -� .��������������������� ����!����������� !���� ���������� ���"#�-� ��� ���������� � �� ���������� ���������� ��R����� �� ���

7���� �����'>!�M"� ����������� �������� � �������!�� ��������������G�� ������������ ����������� �!�� ���������� ��� ��� ����� � ������ �� !������������� ������ ����������� �� ������������ ��C�����M"� ��� � ��������7�����������������M"� ��� � ��������"���D���� � �� �� �����������F!����������� ������� �� �� ������ ���:'B���5 ��� �#������"�� ����!������� ��������*����� ��#����� !�?�������,��� �� �� �5 ����� ����������������� �������� ������������� ���������.��!�� � ������������������ ���������� �� ��?/0!�?/B�������� � �� ������!�� G���������� ��� ������� ������"#���� ������ ����������1 ������1 ��$ ���������� �������� ���� ���������� �������.��!�� ���������?������ �������4 ��������!�������������� � � ������� �������������������� ����� ��������

#������ �� � ���� ���� ���!������������6 1$��"#�%BC��� � ��� .������� �� �������-� ��������������.������������������� ��� �!�� ��������1 ��7 � ���������������� ������ ���� ������ � ��� ���������# 1$!�14����� ������ ��������������1 !����� ����������������"#�%#BC���

?������ �� � ���������� ����������������R� ��� �� G����������-��� ������������!�����*������������������ ��� �����������������G��������� ������ ���������� ���

Page 15: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�B�

3.2. Familia microcontrolador PIC��

���$#>>>)�'I�����I���E�@I���������J���

�"#����S��"$#������ ��� � ��'I���7"����$1"#�������@ ������I�������@I����� �����������!��>�@��������� ��������2�G�������G �� �� �����+���B5�� �� G��� ���� ����� �������������J� ��00�"��������� �����'���� ������1 ���%@���� ���? ��

���$"�>�5��!�9)���I���������J���

�"#����S��"$#������ ��� � ���@I!��'I!��>I����'I���$1"#���$$1�����I������ �������������������> ������������[�������2�G�������G �� �� �����+���>5��������14��A�������'���� ��� ��? ���

��$">>>�5��!�9)��@I���������J����"#����S��"$#������ ��� ����� ������������ ��'I���%'I�����@I������ �������������������> ��!�������'[�������� �� G��� ���� ����� ����'I��� � ��� ������0B�"��������� ���#��� ��+�?���������I�I7�����������I������A�����0%'���� ��� ��? ����B%���� ��� �����1 ���

��$?>>>�5��!�9)��%I���������J���� �"#����S� #8\���"$#������-��� ����� C� ��������%I���������������J���������00 ������ �%0'@��������� ��������#��G������ ����������� ������������B'����������� ��������� � ��%���� � ���"�� ����� ��� �����������A�����:>����� ��� ��? ����B%���� ��� �� ����1 �����$@>>>�5��!�9)��%I���������J���� ?-��� ������"$#����������A����+��%I��������'I����� ��������((����������� ����������� %@T���� ��� ���������@> ��!��������� ��� �� ���1 � ���������� �0����� � ��� ����� ��� �� �� ��� ���� ������A������B0%���� ��� ��? ����>�@���� ��� �����1 ����

Page 16: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�%�

3.3. Características generales de la familia PIC16F87X. 7����������+��"#�%&'(0!��"#�%&'(@!��"#�%&'(%����"#�%&'((��#���� ���������*�����+�

�������4��!���� $"5@?3� $"5@?8� $"5@?"� $"5@??�

& �� ����� *C���� 7#I�> ��� 7)I�> ��� 7)I�> ��� 7)I�> ���

������ �������&,?$A��������� ��@������

@T2� @T2� 'T2� 'T2�

�������� ���? �� ������� �:�� �:�� 0%'� 0%'�

�������� ������1 �� ������� ��'� ��'� �B%� �B%�

�� �����E$� ?!�2���#� ?!�2!�#���7� ?!�2���#� ?!�2!�#���7�

6]�� ���� �� �'� @>� �'� @>�

"�� ����� �� �0� �@� �0� �@�

4�� �� 0� 0� 0� 0�

�������##�� �� �� �� ��

#����������� ��$ � � $$�!�8$?�4� $$�!8$?�4� $$�!8$?�4� $$�!�8$?�4�

#���������������� ��� I� �$�� I� �$��

,�� ���� � ������ ��#��� �����?E7�� ��>������

B� '� B� '�

3� ���� �"��������� �� 0B����������� �� 0B����������� �� 0B����������� �� 0B����������� ��

,��������� ��������������� �@������ �@������ �@������ �@������

� � ���D�� �����F� �1�!�21��

D�H�4!�1$4F�

�1�!�21��

D�H�4!�1$4F�

�1�!�21��

D�H�4!�1$4F�

�1�!�21��

D�H�4!�1$4F�

Page 17: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�(�

3.4. Visión externa (encapsulado / pines).

Page 18: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�'�

Page 19: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�:�

�!��������$"5@?3A?".

��"6��

7"���"6 �

$1"#��"6 �

"E1E��4���

2��� �4���

�7 ��������

1$#�E#,T"6� :� :� "� $4E�# 1$�

�������� ����������I�������E��������� .���� � ��G� C� ����

1$#�E#,T184� �>� �>� 1� IIIII� $������� ���������� ����������� ��������������������������#!� �����1$#����������������#,T184!������������� ������� .���� �� �� �����_�� ����� .���1$#�!���������� ��������� ��������� � G �������� ����������� ��

� #,�E5����

�� �� "E�� $4� ����� � � ��D ��� �#� ��� � �F������������� ����G�������� � ������� �������G ������������������

� �� ���?��� ������� ��������� �"E1�

�?>E?6>� �� �� "E1� 44,� �����������������>��

�?�E?6�� 0� 0� "E1� 44,� ��������������������

�?�E?6�E5 �I� @� @� "E1� 44,� ������������������E5����G �� � � ������ ��������

�?0E?60E5 �V� B� B� "E1� 44,� �����������������0E5����G �� � � ��������������

�?@E41#T"� %� %� "E1� $4� $������ ����� ������� ���E��������� � ��G���� ��4�� >�

��?BE$$E?6@�

(� (� "E1� 44,� �����������������@E$ � ������� �� ���������� ��� ���� � ����������

� �� ���2��� ������� ��������� �"E1�

�2>E"64� ��� ��� "E1� 44,E�$4�

����� ���� ������ C� ���

�2�� ��� ��� "E1� 44,� �

�2�� �0� �0� "E1� 44,� �

�20E�M � �@� �@� "E1� 44,� ����������������G ���G��� �����������

�2@� �B� �B� "E1� 44,� ����� ���� ���������������� ���� ��� �� ������

�2B� �%� �%� "E1� 44,� ����� ���� ���������������� ���� ��� �� ������

�2%E�M#� �(� �(� "E1� 44,E�$4�

����� ���� ���������������� ���� ��� �� �����E�$ .���� � ��G�� ����������� �� �� ��

�2(E�M7� �'� �'� "E1� 44,E�$4�

����� ���� ���������������� ���� ��� �� �����E�$ .���� �������� ����������� �� �� ��

� �� ���#��� ������� ��������� �"E1�

�#>E4�1$1E�4�#T"�

��� ��� "E1� $4� $������� ������������ ��4�� �E��������� � ��G�� ��4�� ��

�#�E4�1$#"E�##���

��� ��� "E1� $4� �������� ������������ ��4�� �E��������#��� �E�$������#��� �E�$�������H ��

�#�E##��� �0� �0� "E1� $4� �������#��� �E�$������#��� �E�$�������H ��

�#0E$#TE$#,� �@� �@� "E1� $4� $ .���� � ��G�� ���� ��������������� � E�$���������$�"� �" #��

�#@E$7"E$7?� �B� �B� "E1� $4� �������� ����������$�"��� �����I�������� ����������" #��

Page 20: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�>�

�#BE$71� �%� �%� "E1� $4� $������� ����������$�"�

�#%E4)E#T� �(� �(� "E1� $4� $������� ���������������������� ����8$?�4E�$ .���� � ��G���������

�#(E�)E74� �'� �'� "E1� $4� �������� � � ��������������� ����8$?�4E�$ .���� ����������������

5��� '!�:� '!�:� �� III� 4� ��

5��� �>� �>� �� III� ?��� ��������

"a������� 1a$������ "E1a�������E$������ � �a��� �����

IIIIIa�6��������44,a�������44,� $4a��������������� �� �$�������

��������������� �� �$������������������������������� ������ C� ��!� �������� ������������$ � ��� �����������������#��� ������# 1$� ������-�� �����������

Page 21: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

���

3.5. Visión Interna.

��$"5@?3A@?"� ��$"5@?8A@??�

Page 22: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

���

3.6. Sistema de memoria.

4� � ���-��� �����A����!�� ������� ������ ������������� ������ ������!���� ���� � ��� ������ ����� ���� �������������?����� � �� ����� ���� ������������ ��������� �������� ����� ������ ������������������ ������� ������!�� � �� ����������� ��������� ��������� ������� �� ������ ��������

���������"#�%&'()+����� ���������������������������������������

��� �������������������������������������������

�,������������� �� � ���������������-� ����������R������������ ����� ������ ��������#������������� �� ������ ������������ � �����R�����������������

��'����������!������(������

Page 23: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�0�

��'����������!��'�������������$"5@??A@?"�

��'����������!��'�������������$"5@?8A@?3�

Page 24: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�@�

3.7 Características especiales 4����������"#�%&'()��� � ������� � �� � � � �������� �����!� ������������������� ������ �� ������� .����� ������������ �� �� C� �������� ����������� � � ����� ��� ���� �*������� � �������� � � ���������� �� ���������

�,��� � � �����-� ���� ������+�����1������������� � ������ �� ���������������������������7�� ���������� ���$�4!� �� � ����+������������������� C����� �������� ���������D��J ���� � �!��1�F������������������������ �� �������D2�J�I���� � �!�21�F!����+�

b���J I����� �D�H�4F��b�1�������������I����� �D1$4F��

���������0��5�������� � ��� ���� ����������������@��4 ��������H��������H74F�����������B��"����������$,���!������� ���G��������������������%����� ������� ������������������(���������� ��� ��� ������������"7�D�>>>�I�>>0�F�����������'��#����� ���� ������������ � �����������:��#����� ���� ������������ � !�� ���G�������G �����������>� ����� ����� ��#������!������������G��������� �� �,?2I"#7��

�4����� ���������� ��������� ����������� ������������ �������������!�-� �� � ���� ���������� ������������������ ����� ���� �� �� � ���������,���� ������-� ������ ������>>(����

�� �����+��������� ��������������D?77��$$��>>(AF�

�����0I��!��� #��+#�>+&,?$A�2����� ��� ������� ���������� ����� ������ ��������������!� �� 7�28M+� ����� ����� ����������

�a� ����� ���� � ����������� �����������!��2%����2(�� �����������"E1������>a� ����� ���� � ��������������������!��2%����2(� ��*��� �����������

�� � ���� ��

�����>!�� � 6����� � ������� �� ���������

����:!� � H�4+�&,?$A�A������������� � ������� ��� ������ ��������a�,��� ������ ������������ ������ �� � � ���������� ���������� ���#16�>a�,��� ������ ������������ ��������� �� � � ���������� ���������� ���#16�

�����'!� � #�7+�#������� ��� ������� ����� ���������1 �� �������� � �a���� ������� �������������� � >a���� ������������������

Page 25: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�B�

����(!� � ,5�+�A������������� ��������������� � �������G�������G �� � �a��20E�M ������ � �������������M ���������!������������������������� � >a��20� ����������"E1!�A5� �� #,��� � �� ����������������������������%!� � 217�6+�2���� ��������������� ��2�J�I����� � ��� � �a�21�������������� � >a�21��� ������������

�����BI@!�������� ��a����� ������� ������������

�>a���&>>�����&&&����������� �����D�"#�%&'((!�'(%F��>a��>&>>����>&&&����������� �����D�"#�%&'(@!�'(0F�>�a���>>>�����&&&����������� �����D�"#�%&'((!�'(%F�>�a��>'>>����>&&&����������� �����D�"#�%&'(@!�'(0F�>>a��>>>>�����&&&����������� �����D�"#�%&'((!�'(%F�>>a��>>>>����>&&&����������� �����D�"#�%&'(@!�'(0F�

�� ����0!� � �H�4�+�2���� ��������������� ����J I��4�� �� � � �a��H�4������������� � � >a��H�4�� �������������� �����!� � H74�+�2���� ��������������� ��H ��������� � � �a�H74������������� � � >a�H74�� �������������� �����I>!�� &1$#�+&1$#>+�2����� �� � ������� ������������ � � ��a��#����������� � � �>a�A$����������� � � >�a�)4����������� � � >>a�,���������� ��������� �������������������D����������F�� ����������� �������������� ��0&&&���4���������� G���#��+#�>�G���������������� �� ����� ��*���� ������?����������� ��2�J�I����� � �������*����� �� ���������� ����J I��4�� �D�H�4F!����������� �������H�4��

� �����+�$4?48$���M"$4���D?77��$$�>0�!�'0�!��>0�!��'0�F�

����(!� � "��+�2���� �� � ������� �������� � �������D������ ���� �������� ��������� ���F���a�2��[��!�0�D�>>��K��&&�F�>a�2��[�>!���D>>��K�&&�F�

� �� ����%IB!�� ���+��>+�2����� �� � ������� �������� � �������D������ ���

�� �������� ������ ���F���a�2��[�0�D�'>��K��&&�F��>a�2��[���D�>>��K��(&�F�>�a�2��[���D'>��K�&&�F�>>a�2��[�>�D>>��K�(&�F�#������������ � ���'���� ��

�� ����@!� � 41+�$ ���������������� ������� ���� � � �a�7 ������ ��J I�!���� ��������������� ��#,�H74���$���� � � >a�?�����������H74���� I�����

Page 26: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�%�

�� ����0!� � �7+���J I��J������� � � �a�7 ������ ��J I��������������������#,�H74�� � � >a������� G �������� ���������������$,����

������!�� � X+�2���� �� ��

� � � �a���� ��������� ����R������� ������������������������� ��� ��� � � >a���� ��������� ����R������� ���������������������������� ��� ���� ������ � 7#+�2���� ����� �� ������������D���������� ��?77H&!�?77,H !�$82,H !��

$82H&FD7 ��� ����� ���� ����������������� ���� ��������������������F��a�$ ����� ������� �� �� ������������� ������������������>a�6��� ����� ���� ��

�����>!�� � #+�2���� �����D����������� ��?77H&!�?77,H !�$82,H !�$82H&F�

�a�$ ����� ���� �� �� �������*����������������>a�6��� ����� ���� �� �� �������*����������������

�������� ��������������� ��*���� ������,�� ����� � ������� ����� ���������� ������ � ��������� ��� ������� ����������������������� ��D��&!��,&F� �� ������ ���������� ���*������������������ ��� ����� �� �������������

Page 27: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�(�

3�?�$����,!(����! ���������!������

���������������� ���� ������"#�%&'()�� � �� �� �������������+�

�$��,�I�#������������������ *����� �������� ���G���� ������

�������������#��)4I�#������������������ *����� ������� ��*����������������� 3��A$I�#������������������ *����� ������������� ����������������������8���#I ���� ���� ����I���� �������

�A���-� �� � � ���� ���� ������0��� ��������+��

���#��� ����� ������ �� ��� ���*�� ����������� ����� � ����� ���� ���� ����-� �����������������,������� ��� ��������� ����� ������ ����������� ��� �R�� ���������� �� � ����������������������0��,�� ���� ��������� � �� �� � ����� �������A$���)4���� ����������������� ��������������������������� �� ��

��� ��������#�� ��������������� ��� �� � ����!���� �� ����� ��������� ����������!��������� ��� �����#�� � ������������� ��������� �� ������ ����������� ���.

Page 28: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�'�

Page 29: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�:�

3�?�#���������-����������*�B���+���

�������� ���� ���������G���������� G ����������������������$,�������� �� ������ ������������ ������ �������� G��� � G ��������������� ���,���� ���������� ������? ������ � ���������� �!��������������������� ��������� ������ ������������������ �� ������$4?48$+�47a�����7a>��

�$ ���� �� ���������G����������� ����� +��

���� � �� C� ���D #,�F�����7 ������� ����� ��H74��0��"�� ����� ����� ��*�������������!����-� �M"����� ����������+�

���"�� ������ C� ������"64�����"�� ���������������� ����������������� ��1�42��0��"�� ��������$��@��"�� ������4 ��!�� ����� �������������������������B��"�� ������##��������������%��"�� ������$$��� � ������� ������� �$4?�4!�$41���(��"�� ������$$�������������� � ����� ������� ��������'��"�� ������8$?�4�������E � ���������� ����������������:��"�� ���������� �����?E7����������������� ��G�����#��

��������������������������������������>��"�� ������ ������� ������1 ���

,���� ���������������������� � ��� ������������������ �*��� �� ��������������������������R������ G ����������� �� �������������

Page 30: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0>�

3�?�3���������

��� �������������� �� ������������� ���$�4+��

��������� C����� ����� ��������D��J ���� � �!��1�F��$ ����� ������������ � � ��������� �������� ����� ������� ����� ����������� �� ��!�����!(���������� � ������� ���� � � �� C� �������������������� C����� ����� ����������

���?����������� ������ � � ��D #,�F!������ ����� �������������,�������������� � ��������� ���� ���������� ����G����

0��?����������� ������ � � ��D #,�F!������ �$,�����,�������������� � ��������� ���� ���������� ����G����

@��� � ������������ ��J��������DH74F������ ������ ��������������

B��� � ������������ ��J��������DH74F������ �$,������

%��� � ����������������������� �������G �� ����� ��������D2�J�I���I � ��!21�F�5�����G�� �� �0!'����@!�������� �������>>����� ����?��������������� ��� �������������� � ������-� ���������� �-�������� � � ��� �������������

Page 31: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0��

?����������� ��� ��������*��C��6�'�!���D��E �4F!�� ������ ������� �����1����21�!������ � � �� � ������� ������ �����G��� �(���!���������������� ������������ �5����

��C��� ����� ������� ��������*���!������������6�'�!���D���4F!�-� ����� ����� ������ ������ ���H�4D����������������������F����� �� ���� �� � ������� ������� ����>�@��������� ����� .���� � ��G!������ ����-� � ����� .��� �� ����� ���� � ������ G �������� ����������� ���$ ��������� ������ �����1�!�21������ ����� �� � �� ������$,�����

Page 32: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0��

3�?�8����'��!F�����E ���=��(�*E�).

���� ��������J�������� ��� �������������� ������������� �������������#���� �������� -�� ������ �� �� C� ���������� �� ���������� �������$,�����

����� ������������������� ��H74�� �� ������� � �������$�4��

�$�� ������������� ��*� ��$,���!����� ������ ��H74����� �� ����������������� G �������� ����������� ��G����� �������������� ������ ���������������$,�����

��� � ���������� �� ����� � ������� ����������� ��������������H74���

��� � ��������� � ����I�������D�������������4 �>F��������������� �� ������ �� � ������� ��������� �� �� �� ������ ������� ������ ��H74��

�,������������� ��#,�H74���$,������ ����� ������� ����� ��H74��� �����I��������

����

Page 33: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

00�

3.8. Puertos de Entrada/Salida.

Puerto A ����� ���?��� � �%�������� ������ ���������,����������D �����E������F��� ����� �� �� ���� ���?�� ������������4�"$?+�

���#������c�\� ���������� �4�"$?� ������� ����� �� �� ��� ��� ��� � ����������#������c>\� ���������� �4�"$?� ������� ����� �� �� ��� ��� ��� ���������

?��� �� ��1�4?�� �� � ������� � �� � �� ������/� ����� ���� ���1�4?�� ���������� ��������� ��������,��� ����������������������������

?������� ������� ��*�������� C����� �� ����� ��������� � ������������ ����� �����#������� ������������ ������� ������� ����� �� ����� � ����� ���������� ��������� � ����

�,���������������� ������� ��� ��� ���?+�

Page 34: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0@�

Page 35: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0B�

Puerto B ����� ���2��� � �'�������� ������ ���������?��������-� � �� ��� ���?� C��� � �� ������4�"$2����������������� �������#�������� ��� ���2��� � �������I����� ����,���������������� ������� ������ � ������� ����� � ������� �� ������1�4"1d��Me(Z�D �2�8F��������I��� �� ���������������*����� �� �������� ��� ���� ��������������������,���������*��������� ��� ���2�e�2(+�2@Z!�������� ��*������������������� ������!�� � ��������������� ���������������� �������� � ��������������� ������� � �� � �������"#�� �������$,�����,������������� ������� ������� ����� ���� � ���� ��� ���D�1�42F������������ ��������2"&��

� ,��� ��������������������� ������� ��� ��� ���2����+��

Page 36: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0%�

Puerto C ������ ���#��� � �'�������� ������ ���������?��������-� � ��������������� �� �� ��� ���#��� � � �� ������4�"$#����������� ��� ������� �����������D ��������������F��$��� ��������������� ���������� ����� �� ������������ �� ������4�"$#�� � �������� �� �������� ����� �� .

,������ ���������� ����������� ������� ��� ��� ���#� �+��

Page 37: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0(�

Puerto D

����� ���7��� � �'�������� ������ ���������#���� � � �� ������� ��������������4�"$7���� � ���������� ������� ���� �"E1��������� ��� ���������� ����$�!�� ����� � �������$� 17��� �� ������4�"$��D����@F����� �� �R��������������� �����������44,��

,����������� ����������� ������� ��� ��� ���7� �+�

Page 38: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0'�

Puerto E

����� ������� � �0�������� ������ ���������$ �� � �������������� ����������4�"$������ � ��� � �������������������������������� �� ������?7#16���7 � ����������� ������ ������� � ��������������� ��� ��������� ���$�!����������� ����� ��$� 17�� ��4�"$������ �� ������� � ��� � �������������� ���

,����������� ����������� ������� ��� ��� ����� �+��

Page 39: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

0:�

3.9. Timers

!����G���

��������������������

4� � ���������� �� ������� ���������*�����+�������� �'������������ � ������������� ���������������������������D41#$F��0��$ �� � �� ��� ������ ������?�� ����������������������� ������������������-� �� � ����� ������ � ���� ��@��,�������������$,�������������B��4� � ���� I�������������� ������D�$?!�$�!�$>F!�������������� ��J���������

����� ��������� !"#$%F+�b�,��� .���� � ��G� ����� ���D&���E@F��D$ ���� � ���������������� ������F��b�,��� �� ������ ���� � ����� �� � �������������� �� I���������

������������� !"#$�F+�b�,��� .���� � ��G� �� C� ���D�?@E41#T�F��b�$ � ������� ��������������� .���� � ��G� C� ���� ����� �����D41$�F��b�,��� �� ������ ���� � ����� �� � �������������� �� I��������b�?������������������������� .��� C� ���� � ��G�� ��������������������� �� �� ��G���� ��!��� ����� � �����-� ����� .��� C� ��� ��������� �������������� ����G����� ������ ��� ��������-� ���4���.

Page 40: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@>�

!����$����������������������4� � ���������� �� ������� ���������*�����+�������� ��%������������ � ������������� ���������������������������D4 ��#$F��0��$ �� � �� ��� ������ ������ �������4 ��A!�4 ��,��@���� � ���� ������������ �� ����� � ������4 ��16��B��4� � ���� I�������������� �������J� ����

����� ��������� &'�"#$%F+�b�,��� .���� � ��G� ����� ��������������� �� ������ � G �������� ����������� ��D&���E@F���

������������� &'�"#�$�F+����,��� .���� � ��G� �� C� ��������C��� ���������������� ���������������������4�1$#�6a���

b�$��4�1$#�6a��� ���� � ��������������� �������� �� ������#�E4�1$#"E##����b�$��4�1$#�6a>� ����������� ��*�� ��������������� ���� � ��������������� �������� ���#>E4�1$1E4�#T"��

0��,��� .���� � ��G� C� ���� � ����������� ��������� .���� � ��G���� ��+�����D4�$/6#a>F��

b�$��� ������������D4�$/6#a>F���� G �������������������$,����� ��������� ����� �� ������������� ���������������b�$�� �����������D4�$/6#a�F����� ����� ����� �$,���������� ������� ������*�� � ����� ��������� � ������#�8���

Page 41: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@��

!����#���������������������

�4� � ���������� �� ������� ���������*�����+�������� �'����������$ �� � �� ��� ������ ������ �������4 ����0���� � ���� ������������ �� ����� � ������4 ��16��@��4� � ���� I���������������I�������������� �������J� �B��$������ � ������� ���������%��4� � ���� ������-� �� � �� � ��� ������ ��������� ��������������������+�

b�$���������� ��� �4 ���������� ��������!�4 ���������� ����

?��������� �4 ���������� ����� ������� ������4 ��+�������������� ���� ������� ����� �� ��4 ��"&�D� �������"��D�FF�������A���������I�������������������� ������������,��� �������� � I������������I�������� ����������+������������� ��4 ���������������� �� �� ������4�#16����0��#���-�� ������ ���$�4��4 ������� ���������� ������ ��4�#16���

Page 42: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@��

3.10. Módulos de captura, comparación y PWM. A���������������##�!����������� � ���������� � ���� ������� ��%I�����-� �� � ��������������+�

���� ������� �������� ��%����������� ������� ������������ ��%�������0��� �������� ���E �������� �������� ���H !���������������������� ��������

�,�����������##�����##��������������������� C� ������ �������� � �����D� ����� � ������� F��,��� ��������������������+�

��� #��������� � ���������� � ���� ������� ��%�����!�� ���� � ������� �'����+��##���IZ##���,+##���A�E�##���IZ�##���,+##���A����8�� ������� �������+�##��#16��������� �##���E�##��#16��������� �##��� ����(I%+�6����� � �����+�$ �� ������c>\�����BI@+�##�C)+##�C/+�H ������� �������������������

� � � ���������+� 6��� ������� � � �������������+�6��� ������

�����H +������������������������� ������������������� �� ���������������� ���������������������� �������H ��

����0I>+�##�C 0+##�C >+�2����� �� � ������� ������##�C��� >>>>a�7 ������������#����E#��������E�H �D � � �� ���������##�CF��� >�>>a� ����#����!�������������� ���G������ >�>�a� ����#����!�������������� ���������� >��>a� ����#����!������@���������� ���������� >���a� ���������!�������%���������� ���������� �>>>a� �������������!������������������##�C����D##�C"&� ������� ��

��� ������� �������F�� �>>�a� �������������!�� ������������������##�C����D##�C"&� ������� ��

��� ������� �������F�� �>�>a� ����#��������!�� � ���������� ������D##�C"&� ������� ��

��� ������� �������!�##�C�������� �� ��� �����F��>��a� �������������!������� � ����!�D##�C"&� ������� ���� �������

� �������!�##�C����� ���������F�##��� � � ��4 ��f�##��� � � ���4 ��������� ������������ �����?E7�D��� ���������?E7� ��*�����������F�

� � � ��CCa��H �������

Page 43: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@0�

�������'���������� �� ������##�����##�������������� ���������������D� ���������� ��� � ����������������������Ca�!�F���� �� ���������� G��� � �������##��CA+##��C,������� �������� ��%������-� ������ � �4 ������������� � ���� � ���� ����������#�E##�C�� ���1�4#�D�������� ��� � ����������� ������ ���������������� ��4�"$#F��,��� � ������������������������� ��##�C 0+##�C >�� �� ������� ��������##�C#16!���� �������#������?�� ���������������� �������� ������� ���� ������##�C"&������������ ������ ��*������������� ����� �##�C"�!�� �� � �������� �������������� ��##��CA+##��C,�����4 ����4 ��� �� �� ������� � � ��������������������� �������������������������!������� �����������������?���������������������� ��� ����������� ����� ����� ������������������ � �� �������� ����������� ���

Page 44: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@@�

��������'����! ������� �� ���������� G��� � �������##��CA+##��C,���������������� ��������������������� �������� �4 ����#������������� �� ������#�E##�C�� ���1�4#�D����������������������F���� ���� � �����,��� � ������������������������� ��##�C 0+##�C >�� �� ������� ��������##�C#16���� �������#����������?�����������##��CA+##��C,���4 ���� �������� ������� ���� ������##�C"&������������ ������ ��*������������� ����� �##�C"�!�� �� � �������� �������4 ��� �� �� ������� � � ��������������������� �������������������������!������� �����������������$��� ����� � ��������� ������������� � ����!� ���������##�����##��� ��������� �����������������##����� ���>� ��4 ����� ��##���������������������� ������� �� ����������� �� � �� ������� �� ���� ����� ������##����� ���>� ��4 ������� �*����������������� ������ ��?E7!��������-� �� �� � �� ���������� ���� �� ���������?��-� �4 ��a>����� �� � ����� ������� ����� ����

Page 45: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@B�

������E����

#��� �� ������� �������� ���������!�������������� ���� ������� ��� ��������������� ������ ������������� ����� ����� � ������� �� .�� ���$ �������������������##�!� ����� �����������#�E##�C�� �������������������� �� � �������������4 ����������� � ���������������+�

���?������c�\� �����I����� ������������� � � ��4 ����0����������� �##��C,�� ������ ��##��CA��

��� ������ ����� .���� �������������+��������������������� ����agD���FV�hU@U4���UD5���� �������4 ��F��$ ���������������� ��� ��>������Dg##��CA+##��#16DB+@FhF���4 ��������� ����������������������� �� ��� ���� �� ��G���� ��F����������������� �+�

���7 ��������c>\� �����I����� ������������6�� � � ��4 ���

���������������� �+������������������?���������aD##��C,+##��#16DB+@FFU4���UD5�� �������4 ��F�������������������� ���H +�

���?��������������?������##��C,���##�C#16DB+@F��0��#���������#�E##�C�� ���������@��?������� I������� ��4�#16��B��?������4 ��� ��4�#16��%��#��������##�C� ��������H ��

Page 46: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@%�

3.11. Interrupciones

�,����"#�%&'(0E(%��� � ���0��� �� ��� ���� �����!��� �����-� ������"#�%&'(@E((��� � ���@���,����� �� �����+�

���7 ������� ����� ��4 �>�����?����������� ������2>E"64��D�������������������"647�Ma�!���G�������"67�Ma>!��1�4"16d��MD%FF��0��#������� � ������ ���������� ������� ���1�42D@+(F��@��&������������� � ������� ������1 ��B��7 ������� ����� ��4 ����%��7 ������� ����� ��4 ����(��#�����������������##����'��#�����������������##����:��4���� ������ ����� ���� � ����������

�������������������������>��#��������� ����� ���� � ��������������������������������������&���� ��������������� �����8$?�4������������������������������&���� ���� � ����� �����8$?�4���������������������������0��&���� �������� �����?E7���������������������������@��4���� ������ ����� ������ ��� ��������D�"#�%&(@E((F��

�,��� ����������� �� ���������������������� ��� ���� ���������� ��"64#16!� ���"������"����/����������� �������������� ��*�� ��"64#16!��"������"�����C��� ��������� ��������������� � ���� �������� ����� �!�M"�� �� �� ������"64#16D(F��?��� �� ����������� ������������������������ ��� ��������� ������

Page 47: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@(�

��������!�����������!������'�! ����

?�������� ������� ����������� �� �������#�� ������� ����������?� �*��� � �� �� � ����������� ��$4?48$!��#,?4A���H �������J� ��������� � ���� ���������� ������ C���� �� ��� ��� �0�������� �+��

���Hd4� �����$4?48$d4� ��0��Hd4� ���

������� ��������� ��� �������� ��������� ��� ������� ������? �� �� � �������� ����������� �� ��������� ��� ��� ����� ����������������"#�%�'(0E(@+�

�����Hd4� �� ����������>C�>!�>C?>!�� �������� ��������>����������������$4?48$d4� �� ������-�� �����������>�0����Hd4� �� ������-�� �����������>�

��"#�%�'(%E((+�

�����Hd4� �� ������-�� ���������� ����� ������%���� ���*�������������$4?48$d4� �� ������-�� ���������� ����� ������%���� ���*��������0�� Hd4� �� ������-�� ���������� ����� ������%���� ���*���������

Page 48: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@'�

3.12. Módulo conversor A/D �������������� ���?E7�����"#�%&'()!��� � ����� ���������� ��>���������B������ ����� ���%&'(0E(%���'������ ������%&'(@E((��

,�� ��������� ��������� ������ �� �� ����5 �aDD5 �VFID5 �IFF+� ��������aDD5 �VFID5 �IFFE�>�@a5 �E�>�@��

D5 �VF���D5 �IF�� � ��������������� ���*C�������������� ����� ����������������-� �� �� � ����� �������5 ��������� ��� ��5��,��D5 �VF���D5 �IF�� � �� ���� ���D577F���DM67F��� C� ������������ ������� ����?0IZD5 �VF����?�IZD5 �IF�������������� � �@� ������+�?7��$A+?7��$,!�?7#16>!�?7#16���

�'����! ������������! ��%A����]�#�������� ��������+�

��� ������� �������D4�"$?F������������D?7#16�F��$ � ������� ��������D?7#16>F��$ � ����������� ��������� ����� �����4?7�D?7#16>F���� �� � ���������D?7#16>F�

�]�#����������� ����� �+�,���������?7"&�?������?7"��?������M"������"���

0]��� ���� ���� ������� ������ �������@]�#�� ����������� ����+�

?����������M1E716��D?7#16>F�B]��� ����-� �� ��� +�

��������M1E716�ac>\���?7"&ac�\���� ����� ������

%]�, � �� �������� ������ G��� � �������?7��$A+?7��$,��(]�6� ������� ����������]����]��

Page 49: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

@:�

3.13. USART ���8$?�4�����(������������������������������������(��������������)� ������� ���������� ����� � ��� �����-� ������ ������"#�%&'()���� � ����������� ������������������������*)����������������������*F�� ������������+�

��� �������������*�D���� �������F�����8������������� �+�

b��#%E4)E#T+������������D������F��b��#(E�)E#T+� � �����D �����F��

0��,��������� ���������� � ������.��� ���� ��@����� ���������� ���������� ��.�� ��������� �$���a>����������� �$��a�!���� � ��.���� ������� �������� �������D G ��������� ������F�������'������� ������+��� 5������������� ����������� � ��������������$I�0��E��$I@'B��%��,��������� �������� ��������� �� �������G����������������(��,������-� ��-� ��������������8$?�4� �������������������+�

b�"��������������������b�+������������������b� ������������,��������b�'����������,��������

'��,��8$?�4�������������� � ������� ������������J� ��:����������������������8$?�4�� ������� ���� ������� �������$,���.

Page 50: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B>�

4. APLICACIONES EN LA ROBÓTICA MÓVIL CON EL PIC16F87X

4.1. XPLORER-DETECTOR DE MINAS ANTIPERSONALES

��� � �� ��� ���� ��������� -� .�������������-� �������� �� ���� ����� �������!� �� � ��R���� ����������� �� D C��������� ������� ��������������� ���� ����� ������ !��������� ���!������������ ��� !������!��� ���!���������������������F��

���� �� �������������������� �������)�,1���� � ������� .������������ C������������� � ������� ����������� ����� ���

� �

��������! ��$)�>�B�����

8�$�$�����������! ��

�������� ����������� ����� ������� �� ������ �� ����� ��������� ���������� ����� ������D�#F����������� ���������*� � �� ���������� ������� D����I�*����#I 1$F!������������� �� ������� �� � ����� ��������������������� � � ����!���������� � ������� �� ������� �������� ����� ������������ �������� � ����� �� ��������!� C�������� ��� ����

#�*���� �������� � ������������!����� ���������� ��������� ����!��� �������� �� �� � ������*����� �� !������*���� �����������Dij������ � �����kQF!������� �� ���� ��� ��������� ���� ���������� �� ����������������� G����������������������������� ������������ -� .���� ������D���������� �� ����� ������F!��������� ������� ��� G��� ����������

���� ��� �� � ��� ������������� ��� �������� �� ���� ��������� �������!����� ���� �����������������������R�� ��������������� �� � �� ��������� �3��-���>D��9�������������! ���������!��!�����

8�$�#���������4��!�����0��!����������

�!��������������)�

�"#��%&'(0�

�!�����������)�

7���� ������ ���

B��F��������������)�

����D�������� ������F��

��������)�

#*����#I 1$�2E6��

Page 51: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B��

$ ����� �� � ����+�, 00B��

7 � ����� �� ��� ���

5����G ���� ������� ���

5����G ���� �����������

�������������)�

������& �?� ���

������5�� ��?� ���

8�$�3���������4��!�����0��!���������! �������������

�#�����1$�H "6�:B!�H "6�:'���H "6�64��

$���J� �� ������������������������� ��������

4�G ������������� ���� ���

������& �?� ���

8�$�8��%�&�!��������=���C����

��� ��� ��������� � � ������� D�� ����F� ��� � �� ������ "�� ���� D �������� �� 5������ 2����F� -� � ���� ��� �� � ������ ����������� �*�������� ����������������������*� � ��� ���� ��-� � �������������

��������� ��� ��� ����� ������ �������� � ��� ��� � � �� ����� ����������� � ������� �� ����� D�&F��������� ���������� �� ���G ��������� �� ���� �������������������

��������! ��#)���-������������!���! ��

�������� ������������� � ��-� � ��� �� ���� ��������� �������������R�� ������ �� ����!����� �*��� ������ ��� ��D� � ����!� ��������� ���!�� � ����� ������!��*����� ���� �F��� ������������� ��� ������������� �����

�������� ��*���� �����������!��������������� �*��$"5@?3F!� �������� � ������� ���� ������� �!�� ��� �!��������� ��&����

Page 52: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B��

8�$������������������!��������������>'������

#���� � � ���������� ������������ �� ������ ������ ���������������������������� ��

��������! ��3)��������������

?��!�� ����� � � .��� �H � D� � ������ �� ����� ����F!��� ���� ������������ �� � �����!���������� ��������� �������������� ��������

��������! ��8)���H����E��

�������� ���� ��� ��� ���������������������� -� .�������D�������� ������F� ������������� ��� �������� ������������� ������ ������������� ����� ������� �� ����� ��D,�:02F��

8�$�"����������������I�!���

1�G ����+� #��� ���� ���� ��������� � � ����������� ���!� �� ��� ����� -� ��� �� ��� ��� ��� ������ ���� � � ������ ������!������������� �!������ �� �� ��������� �������� ����

=��!�)�&���������������������� �6������ ��>�C��>�C�>!B�����

����! �)�$��� �������������� ��������������������������������� ����D"����������BF��

��������! ���)�����! ��

�����������������%���� ��� ���� ��������������� ������ �� ������� �������� ����� ��������!� �������� � ������� ����� ����� �������������� ���� ��� ��� ����� ����������������*���

Page 53: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B0�

��������! ��")��-��'����������!�!�������������! ��

,���� ����D� ������ ����!�� � ����������������� ��� �� �����G������ ������F� ��*���������������������� ���-� �������������������� ������ ��

�,���������������������D� ������������F� ��*��������� ������� �� ���� ��� ������!���� ������ � ���������� ���� �������@������ ������ ��������� ��������7 � ����� ��� ����������������������� �%�����

8�$�?����,�C����

����-����.���������������)�

��������� ��*������ �������� ���� ��������� �������!����� ��������� � ��� ���������!�-� ������� �� ��� ��������� ��������� ������ ������ ������ ������� �� �� ������������������#������� ������� ���������� ������ ������ ��� ����� �� � �������� �� ������� �������� ���!��������� ������ ����� ���������������� ��������� ���������

���� � ����� ������� D� � ����� �� ��� �F� ��*� �� � ���� ����� ��� ��!����������� � ���������������� ������ �� �� �� � � ������!��������� ��������� ����!��������� �������������� ������ ��������

8���������D�����G�F�� ���������������������� � ������� ��������!���� ���� ���� ���� ��������� ��������-� �� ���� ��������������������������������'>]���� ���������!������������� -� .�������-� �� G���� ���� -� .����G ���D� ������F�� ���� ����������8���� ��� ���� ���!�� ��� G��� ��������!��������� � ����� ���������� �������� �� ���� ��������� ���������

����-����.����������.�����/�����������0�

������������ �� �������������� ������� ��������� ������������ �!������ ���������� �������� ����� ������!���������������� �� �� ��������������� ��� ��������

?� �*���� ���� ���������� ���� ��� ���������*� � ����������������*����� ���� ��-� ��� ��� ������!����� �������� � ������������G �� �������� �����

#������ �������� � ������������!� ����� ��������� ��������� ������������� ������������

����-�1��"���������/��.�����/��������������'�����

,���������������� � ����� � �� ����� �������� �������$ ����� ��������������������� ����������������� ��� � ����� ����������� � � ������ � � �� �� ���� � �� D��� ����� ���� ��� ���� � ������� � � ������� � �����F��

8�$�@��%�!������! ��9���������

���� ������������ � ������ � ���� ��������� � � ���� ���� ������� ����� ��� �� �!� ����� � ����������� ���� �B5E(B>�?�������� ������������ ����������� ���:5E0>>�?�������� ��������� ������������ ��������

Page 54: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B@�

#������ �������� �� ��������� � ��������B5�� � �������������������� ������!������������ ��� � ������������� �� ����������+�

• ��������� �o $ ����� � ������������������?�o , ������������������DC�F�����>�?�o ��������������������������������������@�?�o ������4)I�)��������������������B�?�o , �������������������������������������?�o 7 � ����� ��� �������������������>�?�o 414?,��������� �������������00�?�• �������*������� �����������������������(B�?�• ���DC�F������������������������������>>�?��

Dimensiones 18x12x12 cm

Peso 300 g

Velocidad 10 cm/s

Batería motores 5V/750mA

Autonomía 1 hora

Batería lógica 9V/300mA

Autonomía 2 horas

Profundidad detector metales 6 cm

Alcance transmisión RF 100m

8�$�J��������!�����

��������)�� ���� ������������ �C��������� ���� � � � � ����� ��� �� �� �������� ������� ���� � ���������� ���������������� �� ��������������������

6� ���� ����������� ���� � �� ��� ����� �� � ����� �� -� � � ���� �� ����� ��������� �� ��� � �� � ���������������-� �� ������������ ����-� �������� ������������� ��� ��������� ������ ��������� ��-� � ��� ��������#����� �����-� � ������������������� ����������� ������� �������� ��*����� C� ������� �������� ��* ����������-� �������������������������� �� ��� �������� ���� ������� ��� ��� ������� ������ �����G���

��� ��� -� � � ���� � �� � �� ���� ����� � � ������ �� ����� � ������ � � � � �����R������� -� � �� G�� ��������������� �-� ����� ������ ���� ��������������� �� ���������������� ������������ ������

Page 55: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

BB�

4.2. SCRATCHI

6� ������������������� � ������ C*���� �������� *������� ���� ����� �� ������*������� ����� ������� ��� ��-� ��� ���������������

8�#�$�����������! ��

��� ����� $#�?4#A"� ���� ������� �� ���� ����� � � �������� �� ��� ��� � ��� ����� ��� �������� ����"#�%&'(0�-� � ��� ������������� �� C� ����������������� ��� ����-� � ������������������������ � �� � � ������ � � ������ ���� �� ���� � ������ �� �� ����� ��� ����� ���� ��������� � � ���� ����� ����� �������� ���� �������������

��������! ��?)�:�;I'������%:��

8�#�#�������,��������I�!���������

,����� �� ������� ������������ ����������� ����$�� � ���� ��*�� ������������� ��� �� ������� �� ��� � ������������ � ����� ��������� � ������

,���������������������� �������� �� �� ������������� G������� ��� �� ������������� �� ����������������� ���D��5F��

���� C*������������ �8�������������+�,���������������������� � ��������� �������!�!������������� ����������������� ���� ����������� ��!������������� ����������������������� �� �����,��������������������� *������ ���������� �����������=�;I'��������� ���� ����������� ���� ���������������� �����

8�#�3��%�&�!��������=���C����

����1����#���������������������)�

���� ��������������� ���� ���������� � ���� ������������!�-� �� � �����*�� �� � �����������*����!�� ����� ���� �������� ������ .���� ��'�T���-� � ����*���� ���� !����� ���� �������������� .���������� -� .�� ������� �� � ������� � ����������� �������������,,!���������������!��� ������� � ������� ����������� �������������������� � .��� �������������� ���������G������� �� �����������,,�� ����� ������������ ������ ��I#��

����1����2������������������/�+�

���������B���������������M�������� ������ ��������������� ���� ������������ �������� ����� ������� �����

� ��� �-� � ����������������� �� ������������������������ ����������� ���������� ����� ������� ���D�������������>!'��� ���F��

Page 56: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B%�

,����� ���� �� � � �������� ������� �������������������������� ����������������� ���������� �� -�����

����1�1��"������������*3���0��

���������������������� ������ ��� C*��������� ����� ���������� �� ������� �� �+�

�� ������������4��� �$�������D@>�>%F�$���������� �� ���������� ������ � �������� � ������������������ � �����-� �� ������� � �� �� ������������������ ����� �����������

����������� �?������� �"������+�#��� �� ������� �����G��� �������� ������������������������������� ����� ������� ��� ��������������� !�-� ������ ��������������� �� ���������� ���������������� ����������� ����� �����

��������! ��@)��������������H������'������

��$"5@?3)���� ��������������� �� ������������ ������ ����-� � �� � �� ��-� ��� ������� ����������������������� ������?� �� �� ��� ������������������� ����� �� ������ ��� ����� �R��� �� ������ ���-� �� � ���� ���������� �����������$ ������ � ���������� �� ��"#����-� ������������������������ ��������� �������������� ����� ���� ������������ ��������� ������ ���

?� �*�� �� �"#�%&'(0� �� � � ��� ����������� � � -� � ��� ���������� � � � � � ��������� �� ������������*���� �� �� ����� ������������������� ����� �������

#���� � �� .����-� ������� � ��������� ���� ����������� ����������� ����

��������! ��J)������������!���!���!�'�����

8�#�8����,�C����9��������(!��������������

,�������� ���� � ������ �������������� ��������������������������� �������� ��D� ��� ����� ��F� ��������� �� ��� ������ �� ���� ��� ��� C*������������ ��� ��*������ � ����� � ���������������!������������� � ����� ������������� ������� �� ������ ���� ���?��!� ���"#�%&'(0� � ��������������!�� �R��� ����������������-� �� ��� �� ��� ��� ���2��� � �� �� ������ ��� �!������� �� ���� � �����-� � �������������R � ������ �� ����!����� ������������������������������

Page 57: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B(�

���� ������ �� �"#� � � ��� ���������� �� ������ �,?2!� �� ����� �� ��� ����� � � � ��������"#4�?"6����

?-��� � � ������*�� ���� ��� ���� � � ������� ����� �����!� ���� ����� ��� ����� �� -� � � � ��� �������� �������������� ����� � � ������ ��� ����

8�#�����������4��!����,4�!����9���0���!�����I�������������

$ �� � ��������� ����������D� ���������*C������������� !� �������� ����� �!� ���F��� ���������D� ������� ����� �������!��������!� ���F��

��������! ��$G)��������4��!����,4�!����

��������! ��$$)��������4��!������0���!����

8�#�"��������!�����

,��� � G���� -� � � � � � �� ������ �� �� � ��������� �� �� ��� � �� � �� ��� �� � � �*����� � � ��������������� ��� #���� � � �� � ��� ��� �� ��� ����������� (� ���� ����������� �� �� � �� ��� ��� �� � � ��������������� ����� ��8�������� �� G���� ��������� ����������������� ��� G� �� ����� � �� �������������!����-� !���� ���������������������� �� ������������R������� ���������� G��������������������� G��� �� ����� ����� ��� C*�����

1���� � G���� ����� � ������ ��� ��� � � �� ������� ��� -� � �� � ����� ��� �� � � �������� ���������� � ���������

Page 58: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B'�

4.3. Robot Explorador Araña

8�3�$�����������! ��

,��?�.������������� �����R������� �� ����-� � ��� ������ ��������� �� ��������������� ������,���*����##7�-� �� �� ������������� �����-� ����������������*� � ������������ ������� ����� ����-� � i� Q� �� ����!� ��� C����� 8��� � � ���� ��������� �� � �� ����� ����� � � �� ���� �� �� ���� � ���� ���������� ������� � !��� G ���+���� ���������� � ���� ���� �� ����� !�����R� �������� ����� ��������� ������!� ������������ �����������*� � ��������� �� ��������������������� ������������ ������ �� ����������������� ������ ���

8�3�#�������,��������I�!���������

��� ����� � � ����� � � ��� � � ��� ������ ���*� �������� ���� ���� �������� �������� � � ���� ����� D������ ������� �� ��������� � ������F����-� ������� ��-� � � �� � ��� ����� ���� �������� � �������� ���� � �����������,�� �������� ��� �������������*�������,������������������������������������� �� ���������� ���������

,���*���� ������������ ������� ������� ���� �� ���������������� ����������������������� ��������� �������� $ ���� �������� ��������������� ������ ��������� �� ������ �� ���� ������������*������������� �����

��������! ��$#)�������%���9��

8�3�3����,C����

���� ���������� ������������� �� ���@��������������������#���������� � �������������� �����

A������������� ���� ������ ���������� ������������������� �������������� ��������� ������� �����������

?��������� ������� ������J� ��������� ���� ������������� ����� �����������������8������������������� ���� ��� ����������������������*����� � ��� ���4��������� �����������������������"7������ �������� G�������������������������� �������� ����� �����������

8�3�8���������4��!����,4�!����9���0���!����

,���*����##7�� ���������?8�?,!� �����������*� � ������������� ����� ������ �� ������,��� �� ����� ��� ��00 A���

�,�� ���� �� �� �� ������� �� � ��� �� ������� � �������� ,�� �*���� � � ���� �� �����G�!� �� �� ��� � � ������� � ����������� ��������� ����?�.������� � �� �� ���� � � ����!����-� � ������������������������������ �������G ����-� � �������� � ��� ��������������

,���*���� � � ���� ����������������� � � :5� ���������������������� � �� ������������,��������� � ������������������������ ���� � ������ ���5��

Page 59: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

B:�

8�3����������! ��

��� ������ �������� ������� ������������"#���� ����� �������������� ��� � ���������

��� �������� � ������ ���������� � ��������-� ������������������ ���������������������-� ��������� ������ � �������������������$������ ��-� � �� ����������� �������������� �� �����*����-� ����������������������������������� �� � ����������������� ��� ��� ���� ����������-� � ����������������������������� ������ ��� ������ ����������� ����������� ������J� ��

Page 60: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%>�

4.4. PLATAFORMA ROBÓTICA SUBACUÁTICA CONTROLADA POR UN ALGORITMO GENÉTICO.

$ � ������ ����� .�!��������������� �������� �� � � .��� ����������������������������*�������������� ���������������� ����� C��� ��������� ��8��?��������M ������� ��������������� �������� �� �������*������� ������� ����-� � ����������������������� ����������� ������� ����!����������������������G��� � � �����$��� G ��� ���������������)���/��

8�8�$�����������! ��

�C��� ������ �� ������ �� �� ��� �������������� ��������� ����������� ������ G������ ���� ������ ��������� ����� ������������� ��������� ������������� �-� ���������� ��!���������� ����� � ������������������ ��������!���� � ������������������ ��������� ����� � �� �������� � ���� .������� ��� �� ��������������� ����������* ��� �� ��������������*��������� ���������� �� ����� �� ��������������������� ������� �����*�������� �� �� � �� !������������������� ����������

,�������������������� ����������� � �������� ������������������ ��������!� ��������� ���� ��� ������ ������!���������� �������������� �� ����� C��� �-� �� � ��� ������� ���� �������������� ���*���������������������� �� ������ ���+�

b�$��� ��� ���������

b�$��� ���� �*�����

b�$��� ���� ���G �����

b�$��� ��� � ��������

8�8�#���!������������������

������� ��� ������������ � � ���������� �*������ � ��� �D-� ������ � ������ �*������ ���F�������� �������� C� ���� ������������!� ��� ������������������*������� ������ �-� ����������������� ������

$ �������� ���� �*������ � ��� �������� ���� ��� �� ���� ���� �����4� J� ����� ��� �� �������������� �������� ���� �*���!��� �����-� ��������� �� �������� ������ �������� C��� ������-� �� �� ����������������

��������! ��$3)�<!������'��!���������'����,�����

,�� ����������� � ������������� � � ���� � � ������������ �� ������� �� ��-� � ��� �������� ���� ����� � ������������������������� �������� � ������,����� ����� ��������� �������*������ ���� ��� ��� ���� ���� ����������!������-� �� ��� ������� ���������� ��������� ���� �� �� �� �-� ���� � ������� �� ����������������?������ ����������� ������ ��� ��������� !�������������� ������ �� �� ���������������� ������������

Page 61: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%��

8�8�3���!���������I�!���

������� ���� �*����� �� �� ��������� �� � �� �������� ����� ������ ����� C��� ���

#������ � �� ���� ���� �� 7#� �� ��� � ���� � � �.�� �� -� � ��� �� ��� � �������� �� ��� ����� ��� �� ���� � ����� �������� ������������!���������� ���� � ��� ��������!� ��� ����������������������-� �� ��� ������ ��������� ��� � ���,��� ���� �������� �������� ������������ �������������������� ������ �������� ������������ ����� ��������� ��

��������! ��$8)�<!��������!F�������'����,�����

8�8�8���!������������ �!���

$ ������ �� ��������������������$"5@?3!������� � �� ����?7),�>�!�������� ��4�?0(�(������������ �!������� ����� �� �� ����I � ���� ������G���

���� ����� ������G��� ��� ������ ������ ��������� ����������� ���R� ��� ��� � ��� ����������

,������� � �� ������� ������� � ������ C �� �������������������� ������ C� ������� �� ��� ���� �*������ � ��� ��������������������� ������� ��� � ������ ��� ���� ����������������������� ����� �� ���!���� ������������������ ��� � � �� �����

��������! ��$�)�<!������'��!�����������!���!���!���(�����

,������ ��� ���������������� G���������� ��� ������������ ����������������������� ��� � ������� ���!����������������� �� �� �� ������� � �� ������� ����������G����� ��� ����������������������� � ����������� ����������� ��������� ���,������������� ����������������� ����� ��� ��� � �������� �#� ���� ���� ���� � ��������� 8$?�4� � ����������������� ��� �������� �� ����������� ��� � ������������� �� �������� ��������� �0'@>>����� ���� ������� ����������$I��0����������� ����������� ��������� �������������� ������������������� ��������������������� �� �� �� ���#�-� �� ��� ������������������-� � ������� ����� ������ ������ �����������������

?��������� �� � ���������������!���� ����� ����H \��� � ������� .�� ��� ��������� � ������������ G���������� ���

Page 62: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%��

8�8������,�C����

��� ��������� ���� �������� � � ������� ���� ��� ������ � � ��� �� �� � �� ������ � ������� ���� �������������!���� ��������-� �����-� � ��������� ����������� �������� ��� ������� ���� ����� �� ���!����������������������G��� � � �����������G��� ������������� � ������ ����������� �� ������+�

��������! ��$")��!�(��������,��-��

��� ��� �#� ����� �� ��� ��������� ��� ���������� �� ����� � � � ����� 7 � ����� ��� ������ ��� ��������� ������ ������������� �� ������ ������� ����!����� ������� G ������� ����������������������� ��������������������������� ��� ���

��������������� � ��:>�� ��������� ����������������� G ����� �����������!�������� ����������!��� � ������������������������� �� ���!��������������� ���� � �� �������

0�� ?�� � ����� �� ��� ��� � � ������� �� ��������� � ����� ������ ��������� � �� � ��� �� ���R�� ��� � � .��� �������������

@����� ��� ���� � �� �������-� �� �� ��� �� � G ������������������D������������F��

B��,��������������� �������������I��������� ������������������ ������������ �� ������������� ����� ������������ ��� �������� �������!���� ��� ������������������������

%��8���� ��� ������� ����� �� �� � ������� ������������������ ���������� � G ������!� � ������ ������!� � ���� ����������� ����������

(������� ���� � �� ������� G ����� ���R� ��� �� � ����� �� ����� �������

8�8�"��������!�����

4 �� ���� ��� � ����� �� ��������!� ��� ��������� ��� ���� ������� ��� � ��� ��������� � � ������� �� �� ������������ G������ ������������������� ��������� ����-� ��������� �����������7#� �������� ����������� ����������� ������������������������������!�� ��� ��� �� ����� ����-� ������������� ������������������������������ ���� � �������������������������� � � ���+�� �� � �� �� ������ ����-� �� ������ �������� �������� �� ���� ��� ��� � ������������������� ������� ������������ � ���������� � ���

1���� ������-� �������� ���������� ������������ ������� �������������� ���� .�� ������ �� �� ����� ������ ���� �*������ ������������-� �������� ������ ��������������������� ��� �� G �������� ������� �� ��������!��������� ��� ��������.���������� ���� ���������������� ����� ����������!��������������� ���� �����G���8���������� �� ���� .��� � ����� ������������ ����� �����������*������ G������ ����� �������� ����� ���

,�� ����� � � ��� � ������ ������ ������ ��� � � ���� ���!� ���� ���� ����� �������� -� � ����� ��� �� �� ��� ��������*�������� ������� �����G�� ���� �������� �������

�������� ��� ����������������� � ���������* ��-� � ������������������� ���� ������������ ��������� ��-� �� ����� ����� � ����� � ��������� ������ ��

,���������*������ ������������������ �� ���� ���� � � ����������������� ����������������

,���� ����� C��� ��������� �G��������� ������ ���� �*������� ���!� ��� ��������������������������� ��������������

Page 63: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%0�

��� ����������� �� ����� C��� �� �� ������������������������� � ������������!� ������������ � �������� ������ ����������������� �������� ������� .�������������

B��������! �������!���������������,�����������D�9��&����!�����������H�������!���9�������������������!����� ��� '��!,0�!����� B�� ��'��!���� 9� ��������� ���� �!��������������� ��!��!���� ���� ������&���!�!����������'��9������

�������� �� ��� ����� ���� ������������������ ���� ����-� � ������������ � �� ��� �� ������������������������

,�� ���������� ������� � �� ����������� ������ ��� �����������!� ���� ������ ��������!�� �� ��� ��� � ����� ������� �����������G����� � ����� ���

,����� �������� �� � ������� ������ ����� ����� ���������� ������� ��� � ����� �!� ������� !������������ � ����������������� ������� ���

Page 64: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%@�

4.5. Robot Pionero 1B

��� ��G ����� � � �� �����G�� � ������ �� �� � � � � ��� .�� ��� ��������� ���� ������ ����� ������ �������� � � �����������!������������������������� ����G ������

8���$�����������! ��

������������� ���2��-� ������ ����������� ����� ���� ������ � � �������D������� ������� �0�C�0��F!����������� �� ��� �������*�� ��������� �������� ������ ������ ��������!���� � ����� ������� ���������� �������� �� ���*����������� ��������� ���������������� ������� ����� ���������� �� �������������� �� ����!�� ��������� �������������� ���>����������� �� � ����� ����� �����������

��������! ��$?)�K������������-�������!������$L

$ ��� � ��������������G ������ � ��������� ������G�+��

7�� .�������������������� ���������� ���� �*��������������� ������������-� � ���������������������� �� �������������������� � � �������� �� ��'�����>����

7 ���������������� ����� ���������� ��������� �������I����������������� � �������� �� ���

7 ������������� ������������������������������� ����� ���������

7 �������� �������J� ��� � ��������������� ���������� � ���� ������ ��. �

������������� ����������� ��� �� ��������������� ���� ����� ���������������

8���#���!���������I�!���

$��� ��� � ���������� �� �*����� � D? $F+��� ���� � � ��� ����G����� � � � � �����!� ����� �� ��E�� �� ����� ��� ����������� � � ����������G����� �*������� � ��������������������������� ����� ����� � �����������

$��� ���� � � ����������+� ���� ���� � ����� �� � ������ � � � � ���� � ���� �� � � � � ������� � ����-�� � � ���� � � �������� ������ � ������� � � ���������� ���� ������������G��� �*�������

4����������� � � ������-� ������������ �������!��� �� ��� ���������������� ������������������ ������������� ������� ��������!� ���������� �� �����������+�

$��� ���� ���.��+� ��������� ������������������� ��������� ��� ���� ���� ����������

���*����������� ����������� ���7#����� � �������� ���������.�������������� ����� ���������G���� ���������� ��������������� �����������

Page 65: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%B�

��������! ��$@)��!������$L�

8���3��:���C����

#������� � � �������+� ���G ��� � � � ���� � � � ���� ��� ������ ���� ������� ��� �� �� �����!��������� � �� ���� ��� ����� �I����� � � � � ��� ���������� ��� ��� � � � ������ � ��� � �������� � � �������������� � �������� � �� � ���!��������������������$"5@??������!����=!'!��-� ������G������������� ����� ��������� ��������

$ ��� �� �� �������+� ����� ����� ��� ����������� � ������ ��� ��� ���� �I���G���� ������!� ����� ����� �������������������� ����� �������� ����� ���� �� ������� �������� � ��� �������������������� ������ � ��� �� ��������

��������! ��$J)���������������!������$L�

$��� ����� ��� ��� ��������G��+������������������������� ����������� ���� ������ ��������������� ���� �� � ����������G�!����������� ��������� ��� ���I���G��� ������������!��������� ����������������� ���� �������� ����� ����������������� �� � ��������������� ������

8���8����,�C����

$��� ����� ��������+�� ��� ���������������������� ���� �������������� ������ ����������� .�� ���� �������� ��� ����#�������� �� ��� ���� �������������������������-� � ��� ����������� �� �������������������� ���� � ��������������������������G��� � ����������

Page 66: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%%�

��������! ��#G)���9�����!��'��(�������

8�������!����������!F�9���!������! ��

$��� ����� ������ ����������+������ ����������� �����I�.�� ������������������!������������������������������ ������� ������� ���I���G��� ��������������7 � ����������� ������������� ������������� G ��� �������������� ������� ����� ���������

2������� ����� ���+������� ������������� ������*��� ���������� ���������??���������������� ����� �������������� ����� ��:���������!������ ������� ���������G����*���������������� �������� ��������� �I���G��� ���������������

��������! ��#$)���&�������������!������! ��

8���"���������4��!�����0��!����

,��� � ���������� ���*��������� ��� ����� .�����������+��

7�� ����� �+��,����0��B������

������?������B������

������?�����0@�������

� ���������� ���+��B%����������

?��� �������+�'���� ���� ��*��������??�������� ��� ��*��������:�����������

Page 67: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%(�

7������� ��� ���� �� � ����� ���� ���� � ��� � ����� � ���� �� � � D�B� �������� ��������F+� � � � �� ����� �@>����������� ��� �����������������

5 ��������� ������ +�@�'���E� ����

*C����������� �������������� �������+�0�B>�����

4���� ����������������+���������,�7�� �(��� �� ���������������������� �����������������

#���������� ������ �� � ����� �������+�0%B��?��

M������ ���� ���+�0���

�� ������� �� ������������+������������

8���?��������! ��

��������������������������� ���� � �� �������� ��� �� ��

# ����-� � �� ���������� �������� ������� G��������������������� ������������ ����

1���� G���-� ��� ����� � ������� �������������� ������������� ����� �������� ���������������������� ��� �� ���� ��� �������� ����������� �����������

8������� ����� ���� ���G���������������� ����� ������� � � ����!��������������� ����������������

Page 68: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%'�

4.6. Puñalada amarilla

����������.����������������� �������� .��������������������� ������ � �� �������� �?�������-� �� ��������*� ���������������� �� ��������������������� ���*� �������� �������� ��� ������ ����������������� ����� ������ ��� ��-� ��� ��� ������� �� ���� ����

8�"�$�����������! ��

��� ������������� � ������ �������� �������� ����������� ��5#� �������� �����������-� �������������������������� � �����-� �� ����G�� �����$"5@?"���������� ������� ��� �������������������� ������ ��� ��-� ��������� �� ����������� ��� ����������� ������������ �� ����$ ����� ��������������� ���� ����5!�-� ������������������ �� �������, ('>B������ ������� �B�5!�������� ���������������������������!��� C� ������ ��������� ��-� �����G��������5��

��������! ��##)�<!��������������

8�"�#�������,��������I�!���������

��������G �� ������� ������� ���������������� ��5#���������� �������� ������������������G ��� ��������� �� ������ � ������ ������� ����������� �� ������������� �������� �%����������������������� ������� ���� ���� �����������

��� ���� ���� ���� ���� �������!�� ���G������������� !�-� � �����-� ��� ����������� � ��������� ��������-� � ���������������� ���� � ������

���������� ���0�� ���!���������� ��-� �����#�\��*�����-� �� �� ���������������������� �����-� ������������������������������� ������ ��&$�>>�������� ��������-� ����������� ���� ��� ���������-� �� ������G������� �������������� ���� ��5#�D�������������F��

��������! ��#3)�<!���������������������

Page 69: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

%:�

8�"�3��:���C����

����������.�������������� ���@�� ��� ��� ������G��!����-� ���� �� ������ �� ��������� ������������������� ���� ������*����������������������������������������������������� ��� ������������G���-� � �� G����� � ��������������� ����������� �����-� ����������� ������� ����� � �� C������7 � ��������!�� �� � ���� ������� ���� �������� ���

��4�1����"�����������������&����������5�61�

����������������� ����!�-� ��������������������������-� � ��� �� ���������������!� ������ ������� ������� ������ �������� �� �����!�� ����� ����� �� �� ��������� ��-� ��� ��� �������� �������������� ������������ � ���� �� �� � ����� �����������*��� ���������������� ����������������������������H ��

����-� ���� � .����� �� ��*�� ������������ � � ���� �������������������� ������ ���4��� �$���������� ����������������������� �������

��������! ��#8)���&���������������������������

��4�1����78"��42�-4�

��� � �� ����������������-� �� ���������������������������� ����������� ������� ������������������������������ �� � � ���� ���� �� ����� ������� ����� ����� ����!� ���� �������� �H !� �� ���� ����� ?E7� ��������������� ����� ��������!� ����7 ��� ����� ��������������-� �� �� �������"#��� ����������41�>� D����������������� �������������F�� ��� ������� ��������������������������� �����-� � ������ �� � ���� !������ ��� ����� ������������������ ������������ ��� ��� ��� � �� �������������� ���

��������! ��#�)����$",@?"�

Page 70: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(>�

8�"�8����,�C����9��������(!��������������

������� ������������ ����� ����� ���� �������������� ������� �� ���� ��� �������������� ��� ������������� �� ������ ���� ��� �������������� ��������������� ���� ����������� ����������� �!�

,�������� ��� ������������������������ ���� ���������*C������������ ������������������������� ��� ��� � ������ ��!� �� ����� ����-� ������ ���������� ��� ��� � ����������� ��-� � ���������� G��� �� � ���!� ����� ������������� ������������������������ ������� ����� �������� �������� ��� �����������������-� ����������������� ������ ������������ ����� �������

,���� ��� ��� � ��������������������������������� ��� ���2�����������������-� ����� ����������������� ��� � ��������������� ��� ���#��

,������������� ���� �������� ��� ����G � ��������������� ����� ��������"#���1M�� ��������� ���� �� � ������������ � ������� �-�������� ����������

8�"�����������4��!����,4�!����9���0���!����

$ �� � ��������� ����������D� ���������*C������������� !� �������� ����� �!� ���F��� ���������D� ������� ����� �������!��������!� ���F��

��������! ��#")��������4��!����,4�!����9���0���!����

8�"�"��������!�����

,������������� � �� ���������������� .���������� ��� �������� ������� �� ��������������-� �� ������� ����� ��� .�� � � ���������� �������� ����� � ����� �� � �������G !����� ��!���� �� �� �������� ������ ��������������������� �� ��������� ��

Page 71: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(��

4.7. GOS7

,�������� �M1$$�4� ����������������� ������ ���� -� .�� ��������������� ����� ������� �� ���������� �������������

7���� �� ��������������������������� ������ ���� �������� �����������������������?� �*������� �� ���������������������� ���������� ������� ����������������� �������

8�?�$�����������! ��

6�� ����� �"�� ��� �����?��������������������� ����� �M1$$�4�� ������ ������-��� ��������I������������ �� ����� ����������������� ������ ��-� �� � ���������� ��� ��� ���������

6�� ��0�� �#������� ����$�������� �� ������������� ����� �M1$$�4����� ������ ��$�������� �� ���������� ��� � ���*������� ������������ ������������"�����?��������

��-������5�����8����� ����(�

8����������� � �� ������������ �������!������-�� ��������������

8�������� � ��� � � ��� � �������� ���������!���� ����-� ����� ����������������� ��� ���

8�������� � ��� � �������� C��� ����!� C� ���������� ����������������������� ����� ������ ����� ������� ���

8�?�#�������,��������I�!���

��������! ��#?)���'��������! ��3������������2��?�

������ .��� ����� ����� � �����(������� ���� ���+����������� ��� ������������ ����-� ��� � ������ � ������� �� ���� ���� �����-� ������������� ������� ��� ���������� ����� ����� ����

Page 72: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(��

��������! ��#@)�<!������'��!����������!�!������������'�����

��������! ��#J)�<!������������������'��������2��?�

��������! ��3G)�<!�������'��!������������!�!���������������2��?�

Page 73: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(0�

$ �� ������ �������� ����� �������M1$(+�

8�?�3��:���C��������������2��?�

���$"5@?"�D�> A�!�0%'���? !��B%��7��������1 !�'T������������1 F���

��� ����������������� � � ���������� ������ ����� ��M1$(�

��-�1����#��������������������������+!#-�

$ ��� ��� ��C��������������G���

�$ ��� ��� ������� ������������ �������G���

$ ��� ��� ����������D � ������� �����F��

$ ��� ��� ��� ����

��-�1���� ���������

��� ����� �������� ����� ������� �� �� � � � ���� � � ��� �� � ����.�� �� �!� ������������� �� ��� � ���� ������4�� ����

��������! ��3$)�������

8�?�8����,�C����

��������M1$(� ���������������-� � ������� ���� ��� ���� �������� �!������ ������������������� � ��� ����� ���� � ���� �� � ���� ��� ����� �� ���� ������ ������ ,��� � ��� �� � � �����G��� ���������������� � �� ������ �� ���� � � � �� � � �� ����� �� �� �������������� � � ������ � �R�� �������������-� ����������������������-� ������� ����� � �� �����

��� �� � ����R ��� ��� �� ��� ������� � � ������� � � ��� ����������� ������� �� ��� ������������� � � ���������������� �������� ����� ���� ������������ ������������������������ �������� C �� ����� �� ���� ������� � ���� �������� � � ���� � � B>� ��� D��������� �� ��� ������F!� ����� �� ��� �� ��� ������ C �� ����� �� �D@>���F��6� � �71&����� ���������� � ���������� �����*������ ������ ������������

Page 74: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(@�

�������������� ���������� ������������������ ���� ��������������$��� �����!� ����� .�� ��*���������� ��� ������ ��������� ����� ��(>���E����

����"#� �����������������������#�������� ��� �� � ��$I�0�� ����������� ��� ������� �������� ���������������������������������� ��������������� � ������

8�?�����������4��!�����0��!����

2�� ���� �@!'5�D��0>>��?�F�6�#����

�����+����>>��������

2�� ���+��:>���������

8�?�"��������!�����

A�������� ��������� ���������������� ��������������������� .���������������� ��� � �� � ���� ��������"�� ������� �� ����������A������������������� ����� � �� � -� .����������������� ��������� �����.������ �������� .������� � � ������f� ������� G ����������� ���������� ������ ��� ����� ���������������� ������ ��� ����

,��������� ���� ���� �� ����������� ����� ������������ �������������-� � ��� � ����������� ��������R������ ��������� ������ �� ���� ������!���� ������� ������ ����������������� ����� �����G ��� ���� �������� �������� �����

,��� ��������� ������ ������������������ ��������*���������� � �����-� �� � ������������������ ��������

,��� � ��� �� � � ������ ����������� �� �� ����� � � ���� �������� ���� � ����� �� �� ���� ��� � ������ � �������������!����-� �����������!���� � �!��������� ����� *������� ��������

�������� �� ������������������������ ��� ��������� ���!��������������������-��������=���!�����!�!F�����������������������������'���!�!��������(�����M�����������'�����!�����������!�����

Page 75: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(B�

4.8. MICRO ROBOT "Voyager"

8�@�$�����������! ��

�,�����������5���� � ������� .�������� ����������� ��������� �� ���� ����� �� � �������������� ��� ����� �������� ��

��������! ��3#)�<!��������������<�9�(���

8�@�#����������������I�!���

,����� �� �*������ ������!�������� � �������*������ ����������� ���� �0����� �������,�������� �������-� ������ �������������� ��� �� ���� �� ������� ��-� � ��� �� ���� ����� ����������������,������� ���G��-� ����� ���������������� ����������������� ������������������� �������������� ���� ������ ��

��������������������� ����� .��� ������� ������� �������-� �������������������� C������ ��������� ����������� � ������� � � ����!� ���� ������������� C��������� ��� ���������� ���� ���� �������� � ��� ����� ������������� !�-� �������� ������������������������������ ������ .�� ����������������� ����� ��������������� ���������������� ��� ���������������������� ����-� ������������� � ����������� �� ��� ���

,��� � ���� ������� ���� � ���� � � ���� � � � �������� � � ��������� DT������ �%>E@>X��'F�� 7������ � ����������������������� ��,���� ����� ����������� G �� �������� ����� ������ ���� C������!����-� � ��� �����������G��������� G ��

8�@�3��:���C����

������J� �� �������� � ��� ���� ������������ ����������� ���� ���� ����� ����C'��������C�@��������������� -� .�� ��*� �����J� ���� ��� �� ������ ��� ������������������ � ���������� �����J� �� ��������� ��������� �������#�8�� ������ ����

,��� � ��� ��-� � � � ����������� ��� ��!� ��*�� ���� ����� ��������������� � � � ��I ��� �������������� ���� �@����������� �B���!�� ������-� ����� ����������� ����� �� G �� ������ ������!� ���� ��� ������������� ��� � ��������!� ������������� � ��� ������� ��� � �������������� � � *������� � ������ ��,���������������� ��,���� ����� ������ ��� �������������������� ������� ����� �� �������� ������ ������D������ ��� ��,���� ���F��

�������� ���������������������� ��� ������������������ ����������� �������� �������������� ��� �G��� � ��� D4������ ���� ���� M �� 2�C� $ ��F�� ������ ���� �� �� � �� ��� ������������ -� � ��� �� ���� ����������������� ��� ��������!�� �� ��%+��������@>>+���7 � �� �����!����� ��������� �������� � �� � �G������� � �R������ ��������� � �� ���� � �� ����������#�� �� ������ �� ��������� ���� � � ����������� ��D��� ��@l����������F��

Page 76: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(%�

������������������ � ����� ����� ���������� ������� �������!�-� � ����*�� � � ��������� ��������������������R������*������

��� ����� �� ���������� �� ��� �!��������������� ��$"5@?8� � � ��� �������� ������� g�h�� 7������������������� �� � � ��� �� � �� '� ����� �� ��������� �� �> A��� #� ���� ���� @T��� �� � � � ����� &����!��:���� �� � � �? � �� �B%2�� �� � � ����1 !� ������ �� �� ��� �� ���� ����������� ,�� �������� � �������������� ���%&'(C��� ��������������� ���� �������������� ������� ������ ����#����������!�� �������� ���� ������ ���� C� ��� -� � ��� ���� ���� ������� �� ���� ����� C� ��� -� !� ��� ������ ��� �#!� ��� ��������������� ����������������������������

,��� ���� �� ���� ����������� �� ���� ��� �� ,�:'g�h� �� ��� ���� 7����� ������������� � � � � � �� ��� ���� ������ ���������������� ����� !���C������ �� ���m!�-� � � ��������� ��� ������������������������ ���������� ���� ������!����-� �������� � � ���C������ �� ����@>n�� ������ ����� �� ����� � �������� ��������?������� �����,�:'� ����� ������� ����������������������������� �� ����� ����������� �����������������������Bn��,������ ���� ���������������� ���

,���� ��� ��-� � ��� ������ � ������� ������� ��� ������������������#6/I(>�g0h!�-� ���� ���� ������� � ��� ����������� �����������7������ ������ ����������������������� �� �� � ��!�-� ����-� ������������� ������

������������������������ ���� �� � ���������������� ��*���������G ��,���� ��� ��� ��������������� ����� � ���� ���� ����� � � ��>m�� ��� � ��� ��*� ��� ������ �� ��� ����������� � �������� �� �������������� ��� ��� ���� ���� � ���������� � � ����� � ���� � ������ � � ����������� !� -� � ���� ��� � ����� � � ��������� �� ������� �� ��������E�� ����,���������� ��������������� ���� �� ���� �������������� � � "E1� � ����������� � � ��������������� ������������������������������� ��������� �G��� ������� �� ��

8�@�8����,�C����

������� ��������� �������� ������������� ������� �������� ������ ��� ���� �������� ����� ����� ���� � �������� � ����� ���� �� ���������� � � ��� �������� � � ������ � � ��� ,���� � ���� ,��� � ��� �� � � �������� ������������� �����������-� � �������� ������������ ��� ��� � ����������,����������*� �� �� ������������������@���� � ��� �� � ����������������������(�� ��� ������������� �������� ��� ������� ������ �����������i������������ �����Q��#� ���������� ��������� ��������� ��� ��������������������� ������� �� ��� � ������ ������� ��� ������ �� ���������� � ���� �� � ��������������� ������ ��� ���� �������� � ������������ ���������� �����#��� ������� � �������� ����� ������ ������������� ���������� ������� �������������������������� ������������ ���!������������ ������� �� ���7����-� � ���������� ������ �������������������� �'������ �������������!�� ���������������������� ����� ���

7������������ ��������� ������!� ������� �-� ���� �������� ��������� ��� ������� ����-� ������� ����������� ��� �������� ��� � ����������� ������ ��� �� ��

����� G����������� ���!�� ��������������� �� �������7 � �� ������ �������� ���� ���� ���������-� ����������D ���� ���� ������� ����F��� ����� ����������� ���!����-� ��������� ��������,������������ ���� ��������� ������������� ����� �����H �D���� IH����� ������ �F����������� ��� ����������������� �H � �� � � ���� ���� ���J� � �� �� �������������!� ��� ������ � � ����G�� �� ����������� �� ��������� ���������

8�@����������! ��

��� ������� ���-� � ����� .��� �����J� ���� �������� �� ��������� �� ���� ���� �������� ������-� ����������� ���,��R�����-� ��� ����� �-� �� �� � ���������� ����� �������� C� �������� � ������ ����� � ����������������� ���� � �� �� ���� ���� ���� �� ���� ����������-� ���������� �������� � �� ������������ ���� ��� ������������ �� ����� ���� �� ������ ���� �� ��

Page 77: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

((�

4.9. Robot SUMO” MAMPO”

8�J�$�����������! ��

��� �������� i ���Q� ��� ����� ������ �� ��� .���� ��� ������� �� ��� � ��� � � ������ ,�� ������� ��������� � �� ��������������������� �������� �� ����������� �0������������ ����� �������:�C��:������������� ���� ��� � ���� ��� � � � ���G�� �� ���� ������������� ������ %����� �� � ������������������ � ������� ���������

�8�������� �������������� � �� � ������ ����������������� � ������ ���� ������������!� � �����i����Q������������-� ���������� ��� ���������� ���������� ��!�� �%5���@!B?!���������� ����������� ������������"#!�����%&'(%!��������%&'(���7 �� ������� �� �� ��������������� ���� ����������� ������� ����������� �������� ��

��������! ��33)�<!������������

,������������������������������ ���������� ��������� �������-� ������� �� ��� ���� � ��������������� ����������� � � ������������ ����� ���G ����!����� ���!� ����,���� ����� ������� ����*�� ������������ �������0%>]������ ������ �� ����� ������������������ � ��������� �������������G������������������ ����� ����� ���� �������������������������� �� �� ��� ������� �� �����

7 � ���� ����� -� ��� ����� -� � ���� ��G ������ -� � � � ���� �� ���� ���� � � ����� ��� �������� � � ���� ����������!������������������������������ ������

8�J�#�������,��������I�!���

/��� �������� �������������� ����� �� � ��������������������������������� �����������!������*��� ���� ��� ������� ��� ����������������00���������������� ����� � � ����� ������� ���� ��!�� �� � ��� ��������%����� �����������������,������������� ��� ������������������� ����� ���������������� .������������� ��������������������������� ��:���� �������������B���� ���� ����

��������! ��38)�<!����!�,��!���

2�G�� � ���������� � ����� ���������������� �� �������� G �� � ����� ���������������� ���� � � @!B����� � ���*� ������������� � � @!B����� �������,�� ��G ����� � ��������� �� � � ������� ����� ������� ��� 0!� � �

Page 78: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

('�

��� ��-� �� ����*���� �� �� �������� �� �������� �� �� � ������������������,���� ��� ��� �� � ������� ���� � ��*������������ ��G��� ��������!����� �� ����� ������������������� ����� �����>!�������

,������ �� �� ��*���� ������������������ � � ���������-� ����������������� �� �� ��!� � � ��������� ���������������-� ���������R������� �������!� ������� ��������� �������� �������������-� ���� �� ����!���� ������������� ���������������������� �������*���

,�������� ���������� � ��������� ����� ��� �(�C�����!����� ����� G�������������G��� ��G��� � ������������ ���D�>�C�(�C����F� � ���� �� ������� ��-� � ��� � ���*������� ��������������� � � ������� ������ �����

8�J�3��:���C����

������J� ���� � �������������� �������� ������������� ����������� ���g0h+����� -� .���������� ������� ���� ��������� ��������������� �����!�������������� �� �� ������������*������� ������ ������ �� !�������-� ������ � ������ ������ ���� ���������������� ������� ������� ����

���� ���� � ��� �� ������� � � ��� ���������� �� ��������� #6/(>� ��� � � ���� �� ��� � �� ��� ������ ������ ������ ����������������M��7����������� ������G����

#���� � � ����� ��������� ������ ���� ���� � ���������!���������������g@h��%&'(%�� � ������������� ����� ��� �������������� ���������!�����G����� ����� ��������������. �� ��$"5@?#�gBh!���������������������������������� G�� ���*��-� ������� �� ������� ��� �����������

8�J�8����,�C����

������������� �������� ����G �-�������� ������-� ������� ������ � ����� � ����!������ ������ �����������#6/(>��� ��� ��*������������ ������R������� � ���� ��M��7>�!� ��� ����� �������� �� ���� �� �� ��� � � ��������� ���������� ������������� � ����� ���� ��������� ���M��7�!� ����������*� ��������� ������ � � 0%>]� �� �� ����� � � ��� ������� ����R�� ��G ��� �� � ������� ����� � ���� ���� �� �� � ���� �������

���������� � ���� ���*�������*���� �� �������������� ��������� ������*���4�������� ������������������������������� ���������G ������##7�� ���'U��'��C � ���������������������� ���G ���� �� �� ������������ ����� �������������

8�J�����������4��!����,4�!����9���0���!����

��������! ��3�)���������4��!����,4�!����

��������! ��3")���������4��!������0���!����

Page 79: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

(:�

5.Estructura de un robot móvil.

5.1. Evolución del proceso de diseño y construcción��

��������������� ��������� ���������������������� ������������ �� ��������������!� ����������� �� � ����� �������%�� � � ��������������� ����� ���������� ���� ���� ���� .����������������� ����������

�I�6�� ��������+�

#�� �� ���� ��������������!����������� ��������!������� ������ ��� �������������� � �������� �� ����� ���� ����� �� � � �������� �������� �� ��� R����� ����!� ������ ��������� ����� �� � ���� G��� -� �������� ����������������� ��� �*������� ������������ ������

�I�6�� ��� � ������+�

���*� ������� �� �� ���G����� � � � ��� �!� ���� ����� ���� ���� ���� �*������ ��� ��� ��� G�� D��������� � �����������F����������������� ����� �������������� ��� ����������� �!������� ���� �������� �� ����� ����������D����� ��� ��� �F������������*������������ ���������� ����� � �������� ������

8�� ����� -� � ����� �� ���� �� ������� �� ��� ������������ ������ �� ��� �� ������� ����� �� � � ������!� � �� �������������������(������ ������ ������� ������G�������� ���� ���������� �����/����������/������ �� �����!����� � ��� �� ���������������������� �� � ����������� ��������!� ��������R������ � ����������� � ���!� ����� � ���� �� ���� � ��� �� ������ ���� �� ���� �� �� � � �� ����!� ���� ����R�� ���� � ��� ���� ���������������

0I�6�� ��� �#�����+�

"����� � ���� ��������� �*�� �*������ -� � ��������� ���� �������� � � ���� � ��� �� ���� ���� ����� �� ������ ������� ���� � � ���� ���� � ������� �������� ������ �� �� �� ������������� �!� � � ������ ����� ��� ����� � � ����������������� �������������������� ������������ ��� �!����������������� �������� ��������������� ����������� ����������

@I�6�� ��� �"�� ��� ����+�

?������������������������������������� �� ���� ��� �������� ��������G ������� �������-� ��� � �� ���������� �� ������ ������ ��� ������ � �� ���*���������� ��� ���� ��� �����-� �� � ���������������������������������������������

BI�6�� ��� �#��������+�

$ ������� ����� ���� ������������ ����� ��*��� ���������� ����� ���������� ������� ������������*� ��������-� ���������� � ������ ������������ ����� C��������� ���� C��� ������ ������ ����������� ������?� ����� �������� ������ ����������G����

,��� � ����� � � ��� ���������� ��������� ���� ���G��� ����� ������� � � ��� ������� � � ���� ������� 7������ ����� ���� ����� � � �� ������ ���� ���� ���� ������������� -� � ������ �� ��� � ���� ���������� ���������� ����� �������������������������� ��������������� �� C� ����� ������ ���D�� �������*�����!������������ � ����!� ���F��

%I�6�� ��� �#�� �����+�

#�� �� ��������� �������� !�������� ������� ��� ����������!�� ���������������������������������-� �� ������������� ����� ���� C��� ������ �����!�� ���� ��-� ��� ���������������� ���� ����� ���� ��� �������� ������� ���

8���� ��� �������� ������������������������ ��� ���� C�������� �� � �� ���������������� ��*���������� ������ ���������� ����� ������ ��������������

Page 80: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'>�

5.2. Nivel Físico

��#�$����������9��������������

7 ����� ����� ������������ ��� ���������������� ���?��������� � � ����������������������� ��� ��������� �����!� � � ���� � � � �� �� ���� -� � C��� �� ������ ����� �� ����� ���� ��� � �������!� �� �!� ��� ����!������ ������ �������� ���������

$�����-� �-� ���� ������������������� ���� �� ���������� C��� ������������������ �� �� ��� ������

����������������!���������!�����

�7 ����� ����������� ����� ������ C��� �� �� �� ��� ����!������*�� ������������������-� �� ���������� ����������G��� � �!� ���� � �� �������� �� �� �� �-� ������� ��� � �������� ����� ������D��$F� ������ � ����!����-� ����� ����� ������������������������������� ���������-� !��� G ���������������� �!�������� ���������� ����� ����������� ����������� ���� � ��������� � ���������

���������������������������������� ��������������!��������������� ������������������"�#�$�����

Page 81: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'��

���������������������������������� ���������%�����������!����������&�#������

���������������!���������!��������������������

�������G��� � ��� ������&��������5�������� ���� ����������� ������ ����� �������� ���� ����� ��������������������� �������� �������� ������������� ������ �� � ����!� ��������������!� C��� �� �� ��� ����� ���� �� ����� �� D����� �� -� � � � � ���� �� ������������F� -� � �� �*�� � � ��������� ���� ��������� ������*���� ������������������� � !��������� ���������������� ���D-� ���������� �� � ��������F����������G ���������������� �� � ���������� �� ����� �������� ����� ����-� ��

������������������������'���( )��������*����&��

��+"�����,- �.���""�

Page 82: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'��

������������������������'��,)��������*����&��

��+"����� �.� ��""/������'��������*�&��������

�-01��2���,1�

����������������������������'���)��������*����&��

�����+"����� �.�,��""/������'��������*�&��������

�-01��2���,�1�

Page 83: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'0�

������������������������'����)��������*����&������

��+"�����,�.�,��""/������'��������*�&���������

�-01��2�� -01�

���������������

7 ���������������� ����� ������������������!�� ������� ���������� ����������������� � ���������������� ������ ������ ����������� �������-� �� ����� ������ ���������������������� ��� ����������!���� ������������ ����� �������!��� ����������� �� ��������������G ������������� ��!���G���� ���!��������� ��� ���� �0!B�T�E��!������� ������������ ���� ����������� ���G�������� ������������!������� ����� ������������� ��*������ ����������������� �������G����������������

� ���� � ����� -� .�������� �� �� ��� ��-� �����-� ������������-� � �� G �� �������� �����������0%>]!����-� ������� �� ����������*��� ��'>]������������ �� ������� ��������������� ���������-� � ��*����� .������?��������������� ��� ���������������� ������������� �������� ������ �� ������ ������ � ������������ �!� �� � ��!� ������������ ������ ���-� ������� ������� �� � ���������:!������ ����� ��� �� ��:�63GGLL��

Page 84: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'@�

,��� � ������ �� � � ��� �� �������� ��������� �� � ���������������� �'>]������ �� -� �������������������� �� ��� ���� -� � ��*�� ������� �������� �� !� ���� ��������� �� � � ��� ���� �� ����� �� ��� �*������ -� � �������� �� ���� �� �'>]� �� ��� �������� � ��������� $�� ���������� ���� ���� ������ � �� �������� ���� ������� �0%>]��������������-� �� ������ ��������������7#�������G�� ��������

$ �-�������������������������� ����������� ��������-�������� �� � ��� ������������ � �������!�-� � ��*�� ������� ����!������ �-�����������-����� ����������-� ���G ��� �� G ��� ����� ���������� �� ����� �����G ��-� � ��*�� ����������� ���������-� �� ������� ���

<�������� ����������-� ���G ��� ������ �� ����� ������������� G �-� � ����� ������!������-� ����*�-� ��������� ������� ������

Page 85: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'B�

7 ������������ ����� ������!�� �� ������������������� ���� � ���������� � ����!� ������ ��������� -� .�� G �-� ����� �� ������ ������� � ����!� ������������� ����� �� ������� �������!� �� �� ������ ��*���G���� �� ��� �������� #��� ����� ������ �� � � ����� ������� ���� -����� ����� ��� �� ��� -� � ��G ��� ���� ����� ����

��#�#�������������

�������������������� ����������������� ������������������������� � ��������!�-� �� �� *��� ������������-� �-� ����� �����!���� �������������� .������������ ���-� ������� �����

8��� � ����� ��������� �*�� ����������� ����� � �����G� ���� � �, ��!� ����� �� ��� ������ ���� ���� ����� C��������!���� ��������������*���� ����������� ���������� �����&���� � ����[�-� ��� ������ .�������������� �� ������������� ����������������� ��*������������ � ���������� �*���������������� �����

���������������������5!��=�����=�!N�

Page 86: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'%�

����������������������������

?��������� ���� .�������������� ������������������� ���!��� ���� ���� ������������� ��-� ��� ������������� ��� ����� ��������������-� �� �� �-�� ��������������?���� ���� �������������� ����������������� ����� ���� ������������� ��� �� ��������� ����������������-� � � ��� ���� ���������������� �� +�

Page 87: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

'(�

�������� ��������� ���������������� ������������������ �� ��������������� ����� ���������������� ��� ��������� ��� �� �+�

�������� ������������������������� ������������ ���������������� ������������������������ ������ ������������� ������������������������-� �� ��� ��������������������

&����� �� �� � �������� ���������������������� ����������������������������������������� �������+�

Page 88: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

''�

,��� ����� �� ������� �� � ���� ��������� � ����������������������� � � �����*�� ������ � � �����R������ ��������-� ������ ��*�� ���� �������������������� ��������

��#�3�����!�!���������������������

,�� ��������-� �� ���� � ��������� ����� �������������������������� ������������������ ����*� ������������ ������������� ���� !���������*�!����������� ���!������������-�� ���������� ���� ���������������� ���������!������������� � �� � � ����������� �� ��������+�

Page 89: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

':�

5!(����%)� ����� ������������*�!�� ���� ������������������ �� ������������� ��������������*��D� �����������������������G���� �� ��GF���������������������� ���� ������ ������� ����-� ������������� ������ C����� �� ������ ���

5!(����L)� ����� ����������� ���� !� � ���� ������������������ �� ������������� ������������� ���� �D� �����������F���������������������� ���� ������ ������� ����-� ������������� ������ C����� �� ������ ���

5!(����)� ����� ����� ������������-�� ��!�� ���� ������ ���������-�� ��� ��� ����������������D��������*�F��� �������� ����� ���� ��� ������������D�������� ���� F���������������������� ����� ������������-�� ���� ���� ���������

5!(�����)� ����� ����� ����� ����� � ���!� � ���� ������ ���������-�� ��� �� � ������������ D������� ���� F��� �������� ����� ���� ��� ����������������D��������*�F��N�� ���������������� ����� ����������� ����� ���� ���������

��#�8����������������������! ��

����� ������� �����������������D�� G ����� ���� ��� ��F��������������������� ��� ������������ �>� ���� � � ����� �-������ ����� ��� �� ���� ���� -����� �� �*������ �� ���� ������ ��.����� -� � �� ���� �������� ����������������� ���� ��� ��!�� � ������� �!�� �����-� ��*��������� �� ����������������.������

�����$)�4������� ������������ ���� ��� ����8���� ����������������������� ����������������������� ���������������������������������8������ ����������������� ����� �0�������-� � ����������������������G����� ��� �� ������� ���� ��� �*������� ���������������������G������������� ����������� ��������������������G����

�����#)�4������� ��������������������������������� ���� � �������������� ���� � ������ ���G��� ������G�� ���� �� �������� �� �� �� �-� ����� ��������-� ���������� ������ �������������������*��������� ��� ����������

�?�� ��� � ������ �������G !�� � ���� ������������������� ���� C��� ��������� ����� ��� ������!����-� ������ ���*���*����-� �������� �������������

Page 90: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:>�

�����3+� �������� ������� ����� � G ���� � ��-� �� ����� ����������������������������G ������������������� ��������� ��������

�#����� � ������� ������� ��� ���� ����������������������������i� �������Q�� �����-� �� �� � �� ������� ������-�� �� � ����#����� ��������� � ����������������� ���������� �� ������� ������������������������������G���� ����� ���������

�����8)��� ������������������� �� ����� ����G���������� �������� ������������ ���� ���������������������������!� �� ��� ����� �-� �������������������� � ���� �����������!��� G ����� ��������0!� � � �������� �� ���� ��� ���������� �� �� �*�� � � ���� ����� ���� ���� ����� ����� �� ���� ��� � ������ �������������

������������� ��������������� �������� ����

Page 91: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:��

������)� ��� ����������� ���������� ����������G���������� ����������� ���� ������������������ �������� ���� �������������� � ���� ��� ��������������������������������� ���������G������������������� �*���������������� ��������� �������� �0>������ ��������������������� ���� ��� ��>������������������� ��>������������� ����� �� ������������ ��>����>�����

����� ")�,��� ���� ���������� ��������� �� ������ ��� ������ ��� ��� ��� �� ��� ���� � �� ����� �� ��������� ��� � ���������

Page 92: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:��

��#���������! ����������!���'����������������! ��������������!������������ �!��

��������� ��� �������� ��� ��� � ������������������������� ���������������� G� ���� �������� ������ �� ������������ ������������ ��������� ���������������� ���*������� �������+� ��A�)L�171��

$������������������ ����� ������D���-� ���������G��� � ����������� ���� F� ����� �������� �������� �������������� ��� ��� � �������������������D����� � � ���� ��������� � � �������F��

Page 93: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:0�

������������(�!��

,�� ������������� ���� ���������� �5#� � � 0����8���� ��� � ����������������������� �������� � ��� C*������� ���������������������� ��5#��

��������������������������=�;I'������!�!F���������,�����������������������0�!���

���� ������ ����� �� ���������������*��������� �������������������#?7��������*-������ ���������������!� ���������� � � � � ������������� � �� ��� �� ���� �*-����� �������� ��������� �������� ��� ������������� ��������������� ���� � ��������� ��������������8���� ��������������� ���!�� �� � �������� �������G �� �������������

Page 94: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:@�

��������-��'������'����

��� ���������� �� � �� ����������� ���� ��������� �������G��������� ������ ��� ������������������� ���� ���� ���� ��������� ��� C*�����

?��������������� � ��� � ������ ������ ��������� ��� ���� ���� ��������������� �������G��������� ���� �� ������-� �� ���G ��*���������������������������������������� � ��� � ���������� ������� !������-� ����� � ��� ��� ������������������ �������� �� � �� � ��������������� �� !�� �� � ������� ���� ����������������� ���� ���������������������� �������������� ������G��������!� ������ � ����� ���G��� �-� � �������������� �� � �����*��

Page 95: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:B�

$ ������ �� �� ��� � *��������G������� ����������� ���� ������ ������!�����-� ������-� � ������� ���� �� ��� ����� �� ��������-� �������������� �� ��������������� �� �� ���� ����

$ �� � �� ���������� �������G������������������������������������ ���������������������� ��� ���

Page 96: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:%�

7 ����� � � ���� -� .�� � �������� � � ����� �� ��������������� � C*���� �� ���� ��� ��������� �������� ���� ���������������������+�

�����! ����������!���'����������������! ���������

���������������=�;I'����

���������� ��5#�� �0����� � � ��������>C�:(�����

�@�4���������������0�� ��>�����

2 4���������������0�� ��B�����

�%�4���������������0�� ��>���.

o��@�4� �����������0�

o�@��� �����������0������������ ��

o��'����� ��������������������� ��������0�

o������ �������� ��� ��� ���B����� ���*� ���

o�'��� ����� ����������� ���

o���� ������� ����������� �%>C�'�����D��C�F �

Page 97: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:(�

6. Conclusiones

� #��� �� ������G���������� ����� ���������� �������������� ������������������������� �� �� ���*��������� ��� �������A ����������-� �������-� ��������������������� �������������� ���%&'@)������ ��*���� �� ������������������������������%&'()����������������� ������������ ������� �� �������� ����������� �� �� � ����!� ���� �������� �� ��� �'&)))�� A��� -� � � ��� -� � � ���� ������ ��� ��� �������������-� ��� � � ������� �� ����������G �!����-� �� � � .������������ ��������� ��-� ��� � ��-� �� ����� �������� ������� ��������$ ������ ���� ��� ���������������� � ������� ��� �� ��� ��������-� � �� �������� ������������ ������������������� � ������������������R� ��� ��������� ������ �*���������� �����G������������������ ��������� � �������R� ��� �������� �!� ����� �!� ��������� ������*��������� ���� �������� �������-� �� � �� � � �� �������� ���� � � ����������� ��������������� ������������ ����� ��� ���������

Page 98: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

:'�

L�LB��2�%5�%�

�����������!�0��!����������� ��

%������������!�����������������=����(9���

����� ��#���� ������ ��� �����#����� ��

��������� ��M�J�A������

���� ��� ��������

�:'0���

���!��!'!�������������� �!�����

�?�� �������� ��������

���������� ��M�J�A������

<������ ��������::%���

�"#��%E�(� "#�1#164�1I,,���7?4?��

211T��::BE�::%���

���!�������!���������R� ����'@!��'B!��'%!��''!��:>!��:0�

Page 99: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

::�

�!�!���E ���

���(������������'!�$",@?;�

���+EEJJJ�� ����� �����E��'>>E�

���+EEJJJ����� � ��������'[����E �-� ����������

������=�����

���+EEJJJ�CI�����������E����J� �����

���+EE�� ����� �E ����E������������

�������4��!������'��!�����

���+EE���������E ���������n�>�n�> ��������E�������

��,�����! ��(�������

���+EEJJJ������������E��� C����

��,�����! ����������������

���+EE��������� �E���E �E� ���E�����E���E���������

Page 100: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�>>�

���+EEJJJ�������� �����

���+EEJJJ�� ����������������

���+EEJJJ�J������������E�����

���+EEJJJ� ��������������E����������

���+EEJJJ�������-� ����

%'�!���!����

���+EEJJJ�������������� �����E��������������

���+EE[��� � ������CE������ ��E �����EG�C���� G���

���+EE[��� � ������CE������ ��E �����E������������

���+EEJJJ�� ����� �E�������E��������� �E����������E�������������

���+EE� ����G�� ����� �����E�����E��� C������

���+EE� ����G�� ����� �����E�����E�>>�I�E������������

���+EE������������ ��

���+EE��������� �E���E �E� ���E�����E���E���������

���+EE ���J������� �E������E��� �E� ��� ������

Page 101: MICROCONTROLADORES EN ROBÓTICA MÓVIL · “microcontroladores en robÓtica mÓvil” autores: nÉstor ferrer imaÑas xavier parladÉ rios juan antonio josÉ gimeno titulaciÓn:

�>��

JJJ� ���� ��

���+EEJJJ�����������

JJJ�� �� �E �����E� ����

JJJ������������ ��

���+EEJJJ�������������� �����E��������������