Overview

Overview

ESE519-FinalProj “Wrangler”

Demonstration

The Completed Wrangler looks like:

image

Gif in action:

Joystick Mode:

Use the joystick located on the left hand side of the horse to control the direction of the Wrangler.

ezgif com-gif-maker (4)

Sound Mode:

Make any sound would drive the Wrangler forward, at the same time, wave the whip and hit the horse once.

ezgif com-gif-maker (4)

How we made it

System diagram: Components list: Component Name Quantity car chassis 1 servo motor 1 DC motor 2 motor driver 1 joystick 1 sound sensor 1 distance/motion sensor 1 voltage switch 1 Development Attached below is the proposed idea of Wrangler(which is a bit different from the final deliverable). The proposed model is cute and interesting. We were thinking using a motion sensor APDS9960 to control the Wrangler to move in different directions.

Troubles we met

1. Problem 1: Servo motor Problem: the starting, ending angle of servo motor are not precise. The rotation rate of servo motor is not stable. It frequently clogs when not placed horizontally. Solution: implement an additional servo motor driver voltage level shifter breakout board that takes in a GPIO PWM and outputs a higher- voltage-protected PWM wave that feeds to the servo motor. With separate power supply and reworked PWM wave GPIO output, the behaviour is now stable.

What we learned

Method of dealing with multi-file C project based on embedded systems. Use of Cmake tool to configure and compile files involving multiple libraries. Real-world embedded system debugging including both hardware and software sections. Implement hardware-based circuits with software control.

About PIO

PIO was used for the LED(mode indicator) and to drive the APDS9960 distance/motion sensor. The general steps we programmed the PIO state machine are: Determine which PIO instance to use(out of 2) PIO pio = pio0; PIO pio = pio1; Assign instructions into instruction memory with sufficient space uint offset = pio_add_program(pio, &program_name_here) Find an available state machine uint sm = pio_claim_unused_sm(pio, true); some_kind_of_program_init(pio, sm, offset, PICO_DEFAULT_LED_PIN); Up to this point, state machine is ready and running.

Our Team

Yu Feng https://github.com/skyfall88888 Thea Yu https://github.com/Thea-E