Project
| # | Title | Team Members | TA | Documents | Sponsor |
|---|---|---|---|---|---|
| 34 | Purrceptron |
Meg Naidu Neel Rajesh Vinny G Smith |
Denghan Xiong | design_document1.pdf proposal1.pdf |
|
| **UPDATED:** # PURRCEPTRON **Team Members:** - Vinny Smith (vgsmith2) - Megna Naidu (megnan2) - Neel Rajesh (neelrr2) This revision responds to the feedback that the project lacked sufficient mechanical complexity. The pet now includes a differential drive assembly consisting of two encoder-equipped gearmotors and a free-spinning ball caster, adding movement as a fourth expressive channel alongside light, sound, and articulated servo motion, together with an H-bridge drive stage and closed-loop control on our PCB. Three additional success criteria cover closed-loop movement accuracy, handling safety, and noise rejection under motor load. ## Problem Companionship and consistent, positive interaction have emotional and psychological benefits, which is why emotional support animals are widely used to help with stress, anxiety, and loneliness. However, owning a living animal is impractical for many people. Housing restrictions, allergies, cost, travel schedules, and the sustained daily time commitment of caring for a pet all act as barriers. Existing alternatives do not fill this gap well. Virtual pet applications have no physical presence, so there is nothing to hold and nothing that persists outside of the screen. Most consumer robotic pets run scripted, non-adaptive behavior loops that become predictable within a few sessions, so no sense of an evolving relationship develops. Adaptive assistive-care robots do exist, but they typically cost hundreds to thousands of dollars. Our goal is to create a low-cost robotic companion that responds to physical touch in a tangible way and develops a history-dependent relationship with its user. The pet's behavior should depend not only on how it is being handled at the moment, but on how it has been treated over the preceding hours and days. ## Solution The proposed system will be a single self-contained robotic companion pet. It will sense how the user physically handles it, maintain an internal emotional state that evolves over time based on that handling, and express that state through light, sound, articulated motion, and movement. The central design decision is that the pet's behavior will depend on its interaction history rather than only its present input. A unit that has been handled regularly over several days will behave differently from an identical unit that has been left alone, even when both receive the same touch at the same moment. Frequent positive interaction will produce energetic, responsive behavior. Extended neglect will shift the pet toward subdued, low-activity behavior. This creates a feedback loop that rewards regular engagement, similar to the reinforcement structure of caring for a real animal. Because behavior is history-dependent, state persistence is a core functional requirement of the system. The pet must survive being switched off, fully discharged, and recharged without losing its accumulated relationship with the user. All emotional state will therefore be owned and stored on the pet itself. The system will not depend on a host computer, a network connection, or an external server for any required functionality. The system will consist of five subsystems: a sensing subsystem that detects touch and handling, an embedded control subsystem that classifies interactions and runs the emotional state machine, an expression subsystem that conveys state through light, sound, articulated motion, and movement, a mechanical subsystem comprising the enclosure and drive assembly, and a power subsystem that supports untethered operation with a controlled shutdown path. ## Touch Interaction and Classification Touch will be the primary input channel, so the sensing design will be built around resolving how the pet is being handled rather than simply whether contact is present. Capacitive electrodes will be distributed across the enclosure at the head, back, sides, and underside. The system will therefore be able to determine where contact occurs and how that contact moves across the body over time. The spatial and temporal pattern across electrodes is what distinguishes a stroke from a tap, and a single finger from a full-hand hold. Contact location will also inform the response, allowing the pet to turn toward the side on which it was touched. The system will classify four interaction types: - **Pet** — Sequential activation across adjacent electrodes, sustained over time, with low motion variance. - **Tap** — A single electrode activating briefly, with no propagation to neighboring electrodes. - **Hold** — Multiple electrodes activating simultaneously and remaining active, with low motion variance. - **Pick up or shake** — Motion-primary. Detected from a change in the measured gravity vector or a spike in acceleration magnitude, with or without accompanying touch. Detection of a pick-up disables the drive motors. A typical interaction sequence would be: 1. The user places a hand on the pet's back. 2. Adjacent electrodes activate in sequence as the hand moves. 3. The microcontroller classifies the event as a petting stroke. 4. The state machine applies a positive delta to mood and attachment. 5. The expression subsystem responds within 100 ms with a brightened expression, a chirp, a tail movement, and a brief turn toward the contact side. 6. The specific response depends on current state, so the same stroke produces an energetic response on a well-cared-for unit and a slower, more muted response on a neglected one. ## Emotional State Model The pet's internal state will be represented by three continuous variables on a 0 to 100 scale. **Mood** will be fast-moving and will respond to individual interactions, with a time constant on the order of minutes. **Energy** will be medium-term. It will deplete during activity and recover during rest, with a time constant on the order of tens of minutes. Energy will also gate movement, so that a low-energy pet responds to touch through light, sound, and articulated motion while remaining stationary. **Attachment** will be slow-moving. It will accumulate through repeated positive interaction and decay under neglect, with a time constant on the order of days. Attachment is the variable that makes long-term care legible to the user. Each classified interaction will apply a bounded delta to one or more variables. Bounding the per-event delta prevents a single burst of interaction from saturating the state and ensures that consistent care over time produces a different result than a short intense session. Between interactions, each variable will decay exponentially toward its baseline according to its own time constant. The current values of these three variables will select the expressive behavior the pet displays at any given moment. ## State Persistence Across Power Loss Because the pet is intended to be handled freely and recharged as needed, the system must define exactly where state lives and what happens when power is removed. All emotional state will be owned by the onboard microcontroller. There is no external device that could hold a competing copy, so there is no possibility of the pet and a host disagreeing about the pet's mood after one of them is powered off. The pet does not need to run while powered off. On shutdown, the system will write a state block containing mood, energy, attachment, and a timestamp of the last update. On power-up, the microcontroller will read the current time from the real-time clock, compute the elapsed interval, and apply the closed-form exponential decay to each variable: ``` S = S_base + (S_0 - S_base) * e^(-dt / tau) ``` This requires a single computation at startup rather than a timer catch-up loop. It also produces an analytically predictable target value, which means the persistence requirement can be tested against a calculated expected result rather than a subjective judgment. Two failure modes will be addressed explicitly in the design. **Write endurance.** Microcontroller flash is rated on the order of 100,000 erase cycles, so state will not be written on every touch event. The working copy of the state will be held in the real-time clock's backup SRAM, and checkpointed to non-volatile storage on a periodic timer, on significant state transitions, and on shutdown. **Uncontrolled power loss.** A soft power button will latch the regulator enable line, so pressing the button triggers a save routine before power is actually released rather than cutting power immediately. A low-battery threshold detected through battery voltage monitoring will trigger the same save path, disabling the drive motors first so that remaining charge is reserved for a clean save. Both an intentional shutdown and a drained battery will therefore produce a valid saved state rather than a corrupted or default-initialized one. The system uses a single cell. Because the power switch is a soft latching enable rather than a series disconnect, the cell remains connected when the pet is switched off, and the real-time clock's backup supply is taken from that same cell downstream of the protection circuit. Timekeeping draws on the order of microamps, which is negligible against the capacity required for normal operation, so no separate backup battery is needed. In the case of complete cell depletion, the clock's oscillator stop flag will be set on the next power-up; the firmware will detect this, restore the last checkpointed state without applying decay, and resynchronize the clock rather than computing an elapsed interval from an invalid timestamp. ## Solution Components ### Sensing Subsystem This subsystem detects how the user physically interacts with the pet. - **Capacitive touch controller — MPR121**, I2C, placed as a bare IC on our PCB. Eight electrodes will be distributed across the enclosure at the head, back, sides, and underside, which is sufficient to resolve contact location and movement while leaving spare channels on the controller. Electrode geometry, spacing, guard traces, and series resistance will be determined experimentally, since capacitive sensing through an enclosure wall is sensitive to material thickness and dielectric properties. - **Inertial measurement unit — ST LSM6DSO**, with the TDK ICM-42688-P as an alternate. Provides three-axis acceleration and rotation. The measured gravity vector will distinguish orientation changes, such as being lifted or tilted, from vibration. This part was selected over the MPU-6050, which is a legacy part; the final choice is pending a distributor stock and lifecycle check. During prototyping, touch will be tested across the full enclosure surface, including near electrode boundaries, to determine appropriate thresholds and to confirm that adjacent-electrode propagation is reliable enough to separate a stroke from a tap. ### Embedded Control Subsystem - **Microcontroller — Espressif ESP32-WROOM-32.** Provides sufficient GPIO, I2C, I2S, and hardware PWM channels for all sensors and actuators, with adequate processing headroom for touch classification, the state machine, and closed-loop motor control. Wireless functionality is unused in the required design and is reserved for the reach goals described below. - **Real-time clock — DS3232.** Maintains accurate time across power loss, which is required to compute how much decay occurred while the device was off. The DS3232 is specified rather than the DS3231 because it includes 236 bytes of backup-powered SRAM, providing a low-wear location for the working state block directly alongside the timestamp it depends on. Its backup supply pin is fed from the main cell rather than from a separate coin cell, so the system carries only one battery. - **Custom PCB** integrating the microcontroller, sensor interconnects, motor and servo drive circuitry, audio drive, battery monitoring, charging, and power regulation. The microcontroller will be responsible for sampling all sensors, classifying interaction events, running the emotional state machine, managing state persistence, and driving all expressive outputs. Performing all of this locally means the pet has no dependency on an external device and no network latency in its response path. ### Expression Subsystem The pet will convey its internal state through four channels operating together, so that states remain distinguishable even if one channel is missed by the user. Each channel is modulated by the same three state variables. - **RGB LED matrix — HT16K33-driven 16x8.** Displays animated eyes and facial expressions. Both the expression itself and the animation rate will vary with state, so a high-energy and a low-energy version of the same mood are visually distinct. - **Speaker and amplifier — MAX98357A I2S Class-D amplifier** driving a 1 W, 4 ohm speaker. The amplifier operates directly from the battery rail across its full discharge range, so no dedicated supply is required. Output at this level is well above what chirps and tones from a device of this size need. - **Micro servo motors — SG90, two units.** Provide head tilt and tail movement, giving close-range articulated expression that remains available while the pet is being held. Both are driven from the battery rail rather than a regulated 5 V supply; reduced torque at the low end of the discharge curve is acceptable for a printed linkage of this mass, and will be confirmed by test. - **Drive motors — two N20 micro metal gearmotors with integrated quadrature encoders**, driven through a TI DRV8833 dual H-bridge. Two driven wheels and a free-spinning ball caster form a differential drive assembly capable of turning in place. Movement is bounded and expressive rather than navigational: the pet performs short forward and backward motions, turns toward the side on which it was touched, and spins in place, with travel distance limited so that it remains within the area in which it was placed. Gear ratio will be selected in the 100:1 to 200:1 range to produce a deliberate pace appropriate to an animal of this size, with the final ratio set once chassis mass is known. Encoder feedback enables closed-loop speed and angle control, which is required because two gearmotors with unmatched characteristics will not track straight or turn repeatably under open-loop drive. The DRV8833 was selected over a discrete FET bridge for board area and integrated protection, and over a motor-driver module because the driver, its decoupling, its current-sense network, and its snubbing form part of our PCB design. Example state expressions: - **HAPPY** — Eyes wide, fast blink, bright. Rising two-tone chirp. Quick tail movement, head upright. Short approach and small excited turns. - **NEUTRAL** — Eyes normal, slow blink. Single short tone. Occasional slow tail movement. Occasional slow reorientation. - **LONELY** — Eyes narrowed, dim, slow animation. Low descending tone. Infrequent movement, head tilted down. Short retreat, then stationary. The actuator loads share the battery rail and are separated from the capacitive sensing circuitry as far as is practical, since switching noise from these loads can otherwise couple into the capacitive front end and produce false touch events. Brushed DC motors make this the most demanding electrical constraint on the board, and it will be addressed at three levels: separated analog and power ground pours joined at a single point with a guard ring around the electrode traces; ceramic snubber capacitors across the motor terminals, ferrite beads on the motor leads, and bulk capacitance local to the H-bridge; and firmware synchronization of capacitive acquisition to PWM off-periods with a short blanking window around motor state changes. ### Mechanical Subsystem The enclosure will be a rounded, hand-sized form designed primarily for 3D printing, with an integrated chassis carrying the drive assembly. Wall thickness in the touch regions will be selected through testing, because capacitive sensitivity falls off with distance between the electrode and the user's hand. Sections directly over an electrode may be thinned relative to structural sections. Servo motion will be transmitted through printed linkages driven by standard servo horns. The two gearmotors will be located on a common axis with sufficient rigidity that misalignment does not introduce tracking error the control loop must correct, and the ball caster will be positioned to keep the center of mass stable under acceleration while leaving the overall form comfortable to pick up and hold. The machine shop will be consulted within the first two weeks of the project to determine which components, most likely the motor mounting plate and the caster mount, require machining, and to establish lead times before the end-of-semester queue builds. The battery, PCB, and speaker will be enclosed and mechanically isolated from the drive assembly and servo linkages so that normal handling does not stress solder joints or wiring. ### Power Subsystem The pet is intended to be handled freely, so it will run untethered on an internal rechargeable battery. Two gearmotors, two servos, and a Class-D amplifier can draw well over an ampere in combination, from a cell whose terminal voltage ranges from 4.2 V down to approximately 3.0 V. Every actuator on the device tolerates that range directly, so the power tree reduces to one switching converter for the logic rail and an unregulated actuator rail taken straight from the cell. - **Battery — a single 3.7 V lithium polymer cell**, with capacity to be determined by a measured power budget. We will produce a per-subsystem table of measured peak and average current before selecting the cell. This cell is the only battery in the system and supplies every rail, including the real-time clock backup domain. - **Real-time clock backup rail** — taken from the cell downstream of the protection circuit and upstream of the soft power switch, so timekeeping and the state block survive with the pet switched off. Backup current is on the order of microamps and is negligible against the operating budget. - **Charging — TI BQ24074**, placed as an IC on our board with thermal regulation and an NTC thermistor. - **3.3 V logic rail — TI TPS63020 buck-boost converter.** A buck-boost topology is required because a single cell falls below the input voltage a low-dropout regulator would need to hold 3.3 V across the full discharge range. - **Actuator rail — supplied directly from the battery**, feeding the motor driver, servos, and audio amplifier. All three tolerate the full cell voltage range, so no boost converter is required, leaving one switching regulator on the board. Local bulk capacitance sized for inrush keeps motor and servo transients from pulling down the logic rail. - **Battery voltage monitoring** through a resistor divider into a microcontroller ADC input, feeding the low-battery save-and-shutdown path described above. - **Soft power control** through a latching enable circuit so that the microcontroller controls when power is actually removed. ## Criterion For Success **1. Touch Interaction Classification** The system must correctly classify all four interaction types, pet, tap, hold, and pick-up/shake, with at least 90% accuracy over 30 trials per interaction type. All classification must run on the onboard microcontroller with no external compute device. **2. Touch Coverage** Touch must be detected at a minimum of 8 defined test points distributed across the intended interaction surfaces, including at least 3 points near electrode boundaries, with a false-negative rate under 5% over 5 trials per point. **3. Response Latency** The time from the onset of a touch event to the first visible or audible feedback must be under 100 ms, measured over at least 20 trials. **4. Closed-Loop Movement Control** With encoder feedback active, the pet must drive a commanded 1 m straight path with lateral deviation under 10 cm, and execute a commanded 90 degree turn in place within plus or minus 10 degrees, each over at least 20 trials. **5. Distinguishable State Expression** The expression subsystem must produce outputs for at least three internal states, such as happy, neutral, and lonely, that are distinguishable through combined light, sound, articulated motion, and movement. In a blind test, observers must correctly identify the displayed state at least 90% of the time. **6. State Persistence Across Power Cycles** After a full power-off of at least 30 minutes, the restored mood and energy values must match the analytically predicted decayed value within 5%. This will be verified over at least 10 trials spanning varied off-durations, ranging from 30 minutes to 24 hours. **7. Graceful Shutdown** State must be correctly saved and restored in both intentional shutdown, triggered by a button press, and simulated battery exhaustion, triggered by a forced low-voltage condition. Over at least 10 trials of each case, there must be zero corrupted or default-initialized state reads on the subsequent power-up. **8. Long-Horizon Behavior** Attachment must measurably increase under a scripted regimen of regular interaction and measurably decrease under a scripted neglect regimen. The two resulting states must produce visibly different expressive behavior in response to an identical test interaction, confirming that the pet's response depends on interaction history rather than only on present input. **9. Noise Rejection** Motor actuation, servo actuation, and audio playback must not generate false touch events. During a test in which the pet exercises all four expression channels continuously for 5 minutes with no user contact, the system must register no more than one false touch detection. **10. Handling Safety** Drive motors must stop within 200 ms of a detected pick-up event, over at least 20 trials, with zero cases of wheels continuing to turn while the pet is held. **11. Battery Life** The device must run untethered for at least 3 continuous hours of intermittent interaction, including movement, before requiring a recharge. **12. Custom Circuit Design** The custom PCB must contain the microcontroller interface, capacitive touch and IMU sensor interfaces, H-bridge motor drive with encoder inputs, servo drive circuitry, audio amplifier interface, battery monitoring, charging interface, and voltage regulation. The PCB must interface with all sensors and output peripherals with no more than a 5% sensor read failure or dropout rate over a 10-minute continuous test with motors running. **13. End-to-End Demonstration** During the final demonstration, the system must: - Power on and restore its prior emotional state, correctly decayed for the elapsed time. - Detect and correctly classify each of the four interaction types. - Update its internal state in response to those interactions. - Produce state-appropriate light, sound, articulated motion, and movement. - Demonstrate that the same physical interaction produces different responses at different internal states. - Perform a controlled shutdown and restore state correctly on the following power-up. ## Reach Goals The following extensions will be considered only after all criteria above are met. Each is additive to a complete system, and no listed success criterion depends on either. **Autonomous surface navigation.** Adding forward-facing time-of-flight ranging sensors and downward-facing reflective optical sensors would allow the pet to detect a nearby user, detect the edge of a raised surface, and move freely across a tabletop rather than performing bounded movements in place. This would extend the existing closed-loop motor control with obstacle avoidance and edge detection, and would require no change to the state machine, which would supply the same behavioral policy over a larger operating area. **Vision-assisted mood input.** A camera module would capture the user's face and stream the image over the local network to a separate host device running a lightweight facial expression classifier, which would publish a coarse mood category back to the pet. The state machine would treat this as an additional weighted input alongside touch. If the host is unavailable or powered off, the pet continues to operate normally with no change to its required behavior. This extension introduces a separate perception problem, an additional compute device, and a network dependency that does not exist in the base architecture, and is therefore not required for successful completion. ## Ethics and Safety **Handling and physical safety.** Drive motors are disabled whenever a pick-up is detected, so the wheels do not turn while the pet is in a user's hands. Movement in the base design is bounded in distance, so the pet remains within the area in which it is placed. Motor and servo pinch points will be enclosed, and the enclosure will have no small detachable parts, since a device that resembles a pet will attract children. **Battery safety.** The design uses a single-cell lithium polymer battery with charging, protection, thermal management, and a controlled low-voltage shutdown path. We will complete the additional battery safety training required by the course before charging any cell in the lab. **Privacy.** The base design contains no camera, no microphone, and no network dependency. All sensing is touch and motion based, and no data leaves the device. Should the vision reach goal be pursued, it would be confined to the local network, with a hardware indicator active whenever the camera is powered. **Emotional dependency and vulnerable users.** The product is aimed at people experiencing loneliness or anxiety. We will not represent it as a therapeutic or medical device and will make no clinical claims. The neglect behavior is intentionally bounded: the pet becomes subdued and withdrawn, but we will not design guilt-inducing or coercive behaviors, and the pet cannot be permanently harmed. This follows the IEEE Code of Ethics obligation to hold paramount the welfare of the public. |
|||||