DOC PREVIEW
Columbia CSEE 4840 - Remote Controlled Car

This preview shows page 1-2-3-4-5-6 out of 17 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

“Uncrashable”Remote ControlledCarThomas ChauBen SackPeter TsonevOverviewThe original inspiration for this project came when Peter and Thomas, stepping out of their favorite burrito joint into a chilly October evening, witnessed a Nitro RC Car blazing down Amsterdam Avenue. The initial idea was to take one of these cars, override its original hardware, and to interface a truly remote control via the 3G network; they had imagined attaching a camera and driving an RC car from New York to Atlantic City via the cell network from the comfort of their dorm room.Of course, the feasibility of doing this within a semester reduced the project to developing a car controlled by FPGA and sensors. The new goal is to have a car that drives quickly at an obstacle and halts just in time to prevent a collision.An RC car was purchased from the Radio Shack. The ultrasonic sensor, which samples every 50 milliseconds and returns the distance to an object in inches, is used by the FPGA in its calculations that control the car hardware. We hacked the car hardware in order to use the Altera board rather than the original RF controller; the board is connected via Ethernet cable to a breadboard on the car.We used an oscilloscope and discovered that the car used PWM to manage both steering and throttle at a frequency of 50 Hz. As the FPGA is capable of 50 MHz, we could supply a PWM signal to the car by converting a PWM width with a hardware counter. With this module in place, having proven that the board can control the car hardware, the next step was to program the car to slow down as it approaches an object, preventing a collision. We integrated sensor output into a software algorithm that computes a new throttle level with each sensor reading. The resulting feedback loop accounts for distance and speed in order to regulate the engine output.DesignHardwareNeedless to say, the hardware system consists of a NIOSII processor, memory, jtag uart (for debugging), and custom peripherals to interface with the sensor and the car hardware. We needed two custom SOPC components:PWM The system has two servos which control the steering and the direction in which the range sensor is pointing to and one throttle control. To enable control over these subsystems, we used PWM signals.The PWM units are VHDL components that are connected to the Avalon bus independently from the sensor unit. The module uses a counter that increments on every “PWM Clock” cycle which is a signal that is derived from the main system’s 50mhz clock. When the clock reaches a count that corresponds to the end of the PWM period of one cycle, it resets. A register representing the width of the pulse is compared to the counter value and if the counter is less than the register the system generates a logic high signal. The duty cycle can be varied in discrete steps representing less than .1 % and is directly related to the counters resolution.-- Create a PWM clock. 500,000HZ. Counter : process (clk) begin if rising_edge(clk) then if reset_n = '0' then count <= 0; pwm_clk <= '0'; elsif count = 49 then count <= 0; pwm_clk <= not pwm_clk; else count <= count + 1; end if; end if; end process Counter; --Count 10000 steps for each clock cycle. for 0.01% increments of duty cycle. pwm_clock : process (clk) begin if rising_edge(clk) then if pwm_clk = '1' then if reset_n = '0' then pwm_count <= 0; elsif pwm_count = 9999 then -- should be 9999 to generate 50Hz PWM. pwm_count <= 0; else pwm_count <= pwm_count + 1; end if; end if; end if ; end process ; --Based in the Duty cycle register (RAM(0)) create a wave for the steering controls. steering_pwm_generate : process (clk) beginif pwm_clk = '1' thenif pwm_count < RAM(0) then -- duty cycle : 0 - 9999, so can control .01 of a % steering_pwm <= '1';else steering_pwm <= '0';end if; end if; end process ; the module contains two additional processes to create PWM signals for throttle and servo controlling the direction the range finder points to. Sensor The peripheral for the sensor is implemented as a SOPC component in VHDL. The sensor provides distance measures every 50ms and it does so in three ways. 1) analog 2) UART serial 3) pulse width modulation. We used the third way. At the beginning of each 50ms sensor cycle, the sensor pulls the signal high. While high, and every 147us duration correspond to 1 inch measured. Once the until the sensor pulls the signal down, the distance can be determined by counting these 147us time periods.. The furthest detectable distance is about 250 inches which corresponds to about 37 ms of high pulse. During the rest of the cycle the pulse is guaranteed to be low and the sensor uses the remaining time to send the readings via UART and adjust the voltage levels for the analog output. Our sensor peripheral counts how long the pulse described above is high and converts this count to inches. As soon as the pulse goes low, i.e. we have a new reading, the peripheral dumps the new distance reading into a register and raises an interrupt to be serviced by the NIOSII processor. At thispoint, the processor can go and fetch the most recent distance reading from the register and once done it clears the interrupt signal. In terms of timing, the worst case occurs when the sensor holds its pulse high for the maximum allowed duration in one 50ms cycle – 37ms. The remaining 13ms are more than enough to carry out any reasonable processing in the interrupt handler without missing further readings from the sensor.Physical Hardware of Car and Board Interface Besides the FPGA setup, we needed a lot of low-level hardware interfacing. Since the car is intended to move around, we thought of sending the control signals and receiving the sensor readings wirelessly, but doing so would require another processor on the cars end. Thus, we used an Ethernet cable with 4 twisted pairs to transmit the two pwm signals for steering and throttle, the power for the sensor (3.3 v from the FPGA), the pulse generated by the sensor, and the common ground. The GPIO ports from the FPGA were taken to a bread board via a ribbon cable to preserver the pins. The wiring on the car itself used a small breadboard too (We cut a piece from a regular


View Full Document

Columbia CSEE 4840 - Remote Controlled Car

Documents in this Course
SPYCAM

SPYCAM

91 pages

PAC-XON

PAC-XON

105 pages

lab 1

lab 1

6 pages

memory

memory

3 pages

Structure

Structure

12 pages

Video

Video

3 pages

pacman

pacman

4 pages

Lab 1

Lab 1

6 pages

Scorched

Scorched

64 pages

lab 1

lab 1

3 pages

Video

Video

22 pages

Memory

Memory

23 pages

DVoiceR

DVoiceR

29 pages

MAZE

MAZE

56 pages

PAC XON

PAC XON

13 pages

PACXON

PACXON

13 pages

MP3 Player

MP3 Player

133 pages

Load more
Download Remote Controlled Car
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Remote Controlled Car and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Remote Controlled Car 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?