APPENDIX 3. The Derbot AGV – hardware design details – Designing Embedded Systems with PIC Microcontrollers, 2nd Edition

APPENDIX 3. The Derbot AGV – hardware design details
Figure A3.1 shows the circuit diagram for the full Derbot build, using the 16F873A microcontroller. Figure A3.2 shows the hand controller circuit diagram. A full build is pictured inFigure A3.3. Further build details, including PCB layout, are given on the book's companion website. Additional build options and examples are given on the book web site.
Figure A3.1
The Derbot circuit diagram
Figure A3.2
The Derbot ‘hand controller’ circuit diagram
Figure A3.3
A Derbot with hand controller fitted (hand controller connector is disconnected to show mating connector detail)
Due to the pin compatibility between the 16F873A and the 18F2420, the Derbot is almost immediately compatible with the 18 Series device. Section 13.17 describes, however, the need for one change, as the 16F873A ADC input configuration used in the Derbot is not available on the 18F2420. Several solutions are possible, but for minimal changes the following is chosen. As Port B bit 2 is only lightly used, this is reallocated to the right-hand motor control function, previously on Port A bit 2. To achieve this in a Derbot build, a small wire link should be inserted between these two bits. Port A bits 0 to 3 are then configured when needed in the 18F2420 for ADC input, although bit 2 is not used. The LDR PCB connections do not then need to be changed. This modification is implemented as appropriate where the 18F2420 is used.

The Derbot incremental shaft encoder

Chapter 8 describes how a reflective opto-sensor is used to create a simple incremental shaft encoder. Three patterns are shown in Figure A3.4, with 8, 16 and 32 black/white cycles. All can be used, although the spacing between wheel pattern and sensor must be very carefully controlled for the 32-cycle pattern. The wheel diameter used in all prototypes is 56.0 mm and circumference hence 176.0 mm. The wheel patterns therefore provide forward resolutions of 176.0/8 = 22.0 mm, 176.0/16 = 11.0 mm and 176.0/32 = 5.5 mm respectively. Furthermore, if the wheel is rotating at n r.p.m. and the 16-cycle encoder disc is used, then the shaft encoder frequency is 16n/60.
Figure A3.4
Patterns for incremental shaft encoder: 8, 16 and 32 cycles
Reference data [Ref. 8.8] for the motor used in the Derbot prototype, reproduced in Tables A3.1 and A3.2, indicates that the motors run at 210 r.p.m when supplied with 9 V. This is therefore the expected maximum motor speed for the Derbot. The resulting maximum shaft encoder frequency, using the 16-cycle disc, would be 16 × 210/60 = 56 Hz. In practice, the free-running in-circuit motor speed was measured to be 154 r.p.m., when supplied from 9 V. This translates to a maximum shaft encoder frequency of 41 Hz. The fact that the speed is less than the value predicted for a 9 V supply is primarily due to the voltage drops in the L293D drive IC.
TABLE A3.1 Published data for MFA/Como motor/gearbox type 918D30112 – RE280/1 motor characteristics
Operating voltageNo loadAt maximum efficiencyStall torque (g-cm)
Speed (r.p.m.)Current (A)Speed (r.p.m.)Current (A)Torque (g-cm)Output (W)Efficiency (%)
12 V84000.163000.325.01.6245100
TABLE A3.2 Published data for MFA/Como motor/gearbox type 918D30112 – with 30:1 reduction gearbox: speed variation with supply voltage
6 V12 V18 V24 V
140280420560