Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot...

26
Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009

Transcript of Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot...

Page 1: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Leveraging the HiTechnic Prototype Board for FTC

Team 2875 - MITiBot

CT Robot Rally

07 November 2009

Page 2: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

What You Will Learn

• You can build many types of sensors that don’t come in the Lego kits. For example:

– Rotation sensors for robot arms– Extra switches and knobs to control your robot– Proximity sensors

• This presentation describes– How the HiTechnic protoboard works– How to build sensors with the protoboard– How to program with protoboard sensors

Page 3: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Motivation

• Last year was rookie season

• Interested in Electrical Engineering– Mentors with EE backgrounds

• Interested in basic sensor design– Sponsored by MIT Lincoln Laboratory

• One of two teams to utilize HiTechnic prototype board

– Within MA, CT and Atlanta competitions

Page 4: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Configuring Autonomous Modes

Red ramp, blue box

Blue ramp, red box

• Two programs• Two modes each

•Half the programming

Page 5: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Arm Positioner

Potentiometer

• Potentiometer attached to pivot point on arm • Monitors real time position of arm • Allows for pinpoint arm monitoring after gearing

Page 6: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Motivation

• ROBOTC drivers were not well supported

– Found on Xander Soldaat’s blog– Not official sponsored by Lego,

FIRST, or HiTechnic

• Attempted to become driver developer– Contacted Xander– Contacted HiTechnic– HiTechnic already officially

sponsoring Xander’s driver

• Now available on HiTechnic website!http://mightor.wordpress.com

Page 7: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Outline

• The prototype board

• Designs with the prototype board

• Programming the prototype board

• FTC rules for the prototype board

Page 8: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

HiTechnic Prototype Board Options

• Three possible options to purchase– Solderless – Solderable– Experimenters Kit

Solderless Experimenters Kit

Solderable

Page 9: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Breadboard vs Solderable

• Bread boarding is great for experiments– Rapidly design and test circuits– Traces are built into the bread board

• Soldering components allows for permanent installation– Components will not fall off– Usually looks nicer– Traces do not exist

Page 10: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

HiTechnic Prototype Board Features

• 1 sensor port

• NXT voltages (3.3v, 4.3v, 9v, 5v)

• 6 digital lines– Configure as input or output

• 5 analog to digital converts– 10 bit, 0v – 3.3v– Allows NXT to understand sensor

readings

Page 11: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Power

• 3.3v – Most important– Full scale of A/D converters

3.3v4.3v9.0v5.0v

GND

• 4.3v

• Unregulated 9v– Taken from battery– Can range from 9v – 6v

• Regulated 5v– Battery 9v regulated to 5v

• Ground

Page 12: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Digital Lines

• Six digital lines– Can be only on “On” or “Off”, like a

switch– Configured for input or output– Each line is configured independently

• Internal pull-up resistors– no connection = logic HIGH

Prototype Board

Digital LineTerminal

3.3V

Page 13: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Analog to Digital Converters

• Five analog to digital converter lines– Can read a range of values

• 0v – 3.3v operation– makes 3.3v very important– Circuits feeding A/D should use 3.3v

for full A/D resolution

• 10 bit resolution– Counts range from 0 – 1023– 0 counts = 0v input– 1023 counts = 3.3v input

Page 14: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Magnetic Proximity Sensor

• Use a magnet as a sensor– Magnet mounted on an arm comes in close proximity to Hall-

effect sensor– Hall-effect sensor switches on

Page 15: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Ground

DIP Switch

Prototype Board

Digital LineTerminal

3.3V

DIP Switch Robot Control

• Toggle input of a digital line– Flip a switch of “on” or “off”

• Reading input with software– Can enable or disable

features

Page 16: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Rotation Sensor

• Provides one-to-one positioning – Position remains after power reset– Allows for software limits

Page 17: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Trim Potentiometer for shooting power

• Tune shooting power in real time– Allows power adjustment without

changing code

• Scaling issue– A/D scale is 0 – 1023– Motor power scale is 0 – 100

• Find scaling factor– 1023 / 100 = 10.23 is scale divisor

• Samples– 1023 counts / 10.23 = 100.0– 767 counts / 10.23 = 75.0– 1 count / 10.23 = .097

• What happens with 0 counts?

Page 18: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Programming with NXT-G

• NXT-G – 1. sensor port number– 2. action (read analog, read or write digital)– 3. analog channel number– 4. six bit value to output on digital lines– 5. six bit control for writing digital lines

Setup for output or input

– 6. output of read analog action– 7. output of read digital action

Page 19: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Programming with LabView

Page 20: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Programming with ROBOTC

• HTPBreadIO()– Read digital input lines defined by the given bit mask

• HTPBwriteIO()– Write the value of digital lines defined by the given bit mask

• HTPBsetupIO()– Configure the lines or input or output– 0 = input 1 = output

• HTPBreadADC()– Read the value of the specified analog channel

• HTPBreadAllADC()– Read the value of all the analog channels

• HTPBsetSamplingTime()– Set the time between samples– 4ms – 100ms range

Page 21: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Programming Concepts

Address Type Field

00-07H chars Sensor version number

08-0FH chars Manufacturer

10-17H chars Sensor type

42H byte A0 upper 8 bits

43H Byte A0 lower 2 bits

44H Byte A1 upper 8 bits

45H Byte A1 lower 2 bits

46H Byte A2 upper 8 bits

47H Byte A2 lower 2 bits

48H Byte A3 upper 8 bits

49H Byte A3 lower 2 bits

4AH Byte A4 upper 8 bits

4BH Byte A4 lower 2 bits

4CH Byte Digital inputs (bits 0 – 5)

4DH Byte Digital outputs (bits 0 – 5)

4EH Byte Digital input/output control (bits 0 – 5)

4FH byte Sampling time

Decimal Value Ports          

  B5 B4 B3 B2 B1 B0

0 0 0 0 0 0 0

1 0 0 0 0 0 1

2 0 0 0 0 1 0

4 0 0 0 1 0 0

8 0 0 1 0 0 0

16 0 1 0 0 0 0

32 1 0 0 0 0 0

Digital line Example:

Ports B3 and B0

B3 = 8

B0 = 1

So 8 + 1 = 9 is mask used

Page 22: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

FTC Rules Regarding Prototype Board

• No external power – Any design is restricted to power on the prototype board

• Can only connect circuits to the labeled connections

• Communication must be through NXT connection

• Sensors can be physically separated from proto-board

• Additional circuit boards are allowed

• Prototype board processor cannot be reprogrammed

• Sensors created cannot cause interference with other sensors or robots

• Only visible light LED’s may be connected

• Soldering circuit components is allowed

Page 23: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Thank you

• Team 2875 MITiBot– Programming and assembling demos

• HiTechnic– Provided many images and concepts

• Brian Shucker for help assembling ideas for this talk

• Xander Soldaat– Creator of ROBOTC drivers for HiTechnic parts

• The Kingswood-Oxford School– Hosting a great event

Page 24: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Questions

• Please feel free to ask any questions

• Please feel free to share any experiences

Page 25: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

ROBOTC IR Seeker

• HTDIRsetDSPMode() – Set the DSP mode of AC carrier wave detector– For FTC we want 1200 Hz (carrier of the IR beacon)– Write a 1 to DSP_MODE register

• HTDIRreadACDir()– Read the value of the AC direction register

• HTDIRreadACStrength()– Read the value of one AC sensors

• HTDIRreadAllACStrength()– Read the value of all 5 AC sensors

Page 26: Team 2875 MITiBot Leveraging the HiTechnic Prototype Board for FTC Team 2875 - MITiBot CT Robot Rally 07 November 2009.

Team 2875 MITiBot

Protoboard Sensors for IR Beacon

• The IR Beacon works at 1200 Hz

• The IR spectrum used is 940nm

• Need a Photodiode to detect IR signal– Turn IR light into voltage or current

• Possibly have greater range over IR Seeker V2

• We apologize for not having a demo for this