ME 218B W14 - The Bat Camper
Dan Colon
Adam Genecov
Will Greenbaum
Will Tucker
  • Home
  • Project Description
  • The Team
  • Electrical
    • The Brains
    • The Senses
    • The Muscles
    • The Power
  • Software
    • Hierarchical State Machine>
      • HSM Design Template
      • HSM Code Template
      • HSM Structure>
        • Top Level - Game Master
        • JSR Handler
        • Robot Control
        • Firing At Goal
        • Reloading
        • Jousting
        • Get Home
        • Powering Up
      • HSM Pseudo Code
    • Hardware Control
  • Mechanical
    • BallShooter
    • Chassis
    • Superstructure
    • Pictures
  • BOM
  • Wisdom

Hardware control

The Hierarchical State Machine was designed independently of the robot's interaction with hardware. Sensor reading, actuator control, and communication protocols were decomposed from the state machine allowing for easier debugging and development. This also allows anyone to use these files, as they are dependent only on the pins assigned on the microcontroller. The pin assignments were all separated into a single header file to avoid overlap which is also included.

There are two levels of hardware control files. The first are direct libraries that create the pulses, signals, and waves required to manipulate actuators like motors and servos. These files never use these functions. The second level are files that use the lower level libraries to control the actuators or read the sensors in such a way that is useful for the state machine. 

.C and .H Files for hardware control

Headers only 
  • AllEvents - List of all events used in the HSM

  • AllTimers - List of all timers, durations, and assignments

  • PinAndPortAssignments - List of all pin/port assignments


Headers and Source Files
  • ADS12 - Analog->Digital (AD) port library

  • CED_PWM_E128 - PWM for E128 library

  • DebounceControl - Button/Switch debouncing
 
  • E128_ServoLib - Servo pulse for E128 library
 
  • IR_DetectorControl - IR input capture period measurement
 
  • LanceControl - Lance servo commands using servo library
 
  • MotorControl - Motor commands using pwm library and control law for magnetic field following

  • ShooterControl - Servo and fan commands for shooting and reloading balls and LED control for emitter signal

  • SPI_FSM - SPI communication using a flat state machine
allevents.rtf
File Size: 63 kb
File Type: rtf
Download File

alltimers.rtf
File Size: 63 kb
File Type: rtf
Download File

pinandportassignments.rtf
File Size: 73 kb
File Type: rtf
Download File


ads12.rtf
File Size: 166 kb
File Type: rtf
Download File

ced_pwm_e128.rtf
File Size: 318 kb
File Type: rtf
Download File

debouncecontrol.rtf
File Size: 158 kb
File Type: rtf
Download File

e128_servolib.rtf
File Size: 161 kb
File Type: rtf
Download File

ir_detectorcontrol.rtf
File Size: 143 kb
File Type: rtf
Download File

lancecontrol.rtf
File Size: 88 kb
File Type: rtf
Download File

motorcontrol.rtf
File Size: 274 kb
File Type: rtf
Download File

shootercontorl.docx
File Size: 27 kb
File Type: docx
Download File

spi_fsm.rtf
File Size: 310 kb
File Type: rtf
Download File

Powered by Create your own unique website with customizable templates.