FEAR is powered by a PIC32MZ2048EFH100 microcontroller. We have chosen this product for its superior clock speed, number of I/O, and ease of use. This is the heart of the platform and is responsible for almost all of the robot functions. It parses all of the sensor input using its 6 ADC channels, controls both motor controllers via PWM and conducts all movement operations through the programmed code.
In this project we have used no pre-constructed libraries, bootloaders or any other kind of outside code. Instead, we have programmed the MCU from scratch. This allows us for very fine and intricate control of all the functions within the MCU.
We have constructed the code into three distinct categories:
This is the low level code responsible for interfacing with the outside world and configuring internal modules. These functions gather information from externally connected devices and drives output pins to control peripherals.
This is the intermediary code that creates easy to understand functions that high level code can use. For example, a function called setMotors(FORWARD, HIGH_SPEED) would be able to take two parameters to control speed and direction and then set appropriately use the driver code and functions to perform this action.
This is the highest level of code that makes logical decisions. It looks at the data gathered by the sensors to direct the robot through obstacles and interprets IR signals to determine if they re true flame sources or not. Additionally, it decides how fast the robot should be moving and attempts to map the course through its own measurements.