Presentation is loading. Please wait.

Presentation is loading. Please wait.

The New FTC Platform (Connecting your legacy hardware)

Similar presentations


Presentation on theme: "The New FTC Platform (Connecting your legacy hardware)"— Presentation transcript:

1 The New FTC Platform (Connecting your legacy hardware)
By Team # The Lazybotts Season

2 Outline The new platform - What changes?
The new Modern Robotics modules Connecting legacy hardware The whole new system Programming the Legacy Module - App Inventor Programming the Legacy Module - Android Studio #TipsForFtcTeams Questions?

3 The New Platform - What changes?
No more NXT or “Samantha” Module Android ZTE - Snapdragon Processor Uses Wi-fi Direct All data connections are now USB No more RobotC or Labview Java with Android Studio IDE or MIT App Inventor Competitions will be different No software inspections No FCS No provided joysticks Sport Start ( GO)

4 The New Platform - Power Dist. Module (PDM)
7 USB ports for Motor & Servo Controllers A power terminal block allowing for easier power distribution The main hub for control communication via USB connectors All Anderson power connections We recommend changing power plug to an Anderson Powerpole connector Connects to Android ZTE phone through a mini USB port 6 power outputs for Motor and Servo Controllers Connects to the 12 volt battery

5 The New Platform - Motor Controller Module (MCM)
Anderson power connectors No longer capable of “daisy chaining” controllers More durable mounting bracket. Two motor encoder connectors Connects to the core power module through a mini USB port Connect two DC motors Power connection from PDM

6 The New Platform - Servo Controller Module (SCM)
Anderson power connectors No longer capable of “daisy chaining” controllers More durable mounting bracket. Connects to the core power module through a mini USB port Connect up to six servo motors Power connection from PDM

7 The New Platform - Device Interface Module (DIM)
AKA “Advanced Sensor Module” Allows you to use standard, off the shelf sensors No more need to use the “proto board” to attach limit switches and 3rd party sensors Powered by USB connection Connects to the Core Power Module via USB cable 8 digital I/O ports 2 PWM output ports 6 High speed I2C ports 8 analog input, 2 analog output ports

8 The New Platform - Core Legacy Module (CLM)
Used only to connect LEGO® NXT sensors, legacy Hitechnic Motor and Servo controllers, Lego Motors, and Protoboard. Powered by USB connection i2c ports connect to the legacy motor and servo controllers i2c ports Connects to the core power module through a mini USB port

9 Putting it all together (Legacy)
USB POWER DATA

10 The Whole System

11 Programming the Legacy Module - App Inventor
Get help at A Browser Based Programming tool A Component and Block Based Programming tool The user interface for App Inventor runs in the Chrome or Firefox web browser. Full instructions for installation and basic use are available from Intelitek at the URL shown here. One thing to note however is that at this point, there are not a lot of detailed instruction available yet. The best resource we found was this google group. It’s a “Drag and Drop” Component and Block Based programming environment. Components are visual representations of physical hardware devices like motors and sensors Blocks are visual representations of logical programming constructs like IF-THEN decisions and WHILE loops First you select and place your Components and place them on the Screen, then you build your program with Blocks It’s fairly easy to learn, and can be used without Internet access by following the installation instructions from Intelitek. Most of the FTC hardware components are listed in the left pane. You select the one you want and drag it to the Viewer pane with your mouse. You can then set the property values for each component in the Properties pane on the right. Visual components will be displayed on the Screen pane, while non-visual components will be displayed below the Screen pane. Once nice thing is that all the changes you make are saved immidiately. There is no Save button.

12 Programming the Legacy Module - App Inventor
FtcDcMotorController FtcLegacyModule Additional Components Some interesting components currently available in the SDK for App Inventor In early releases of the FTC SDK, some functionality was only available through the FtcDcMotorController component and not through the FtcDcMotor component, but in the latest release FtcDcMotorController is only needed if you want motor encoder information. If you are using the legacy Hitechnic Motor Controllers, through the CLM you must rename it from the default “Motor Controller #” to “drive_controller_#” If you have a hardware device that is not directly supported by a provided FTC component, you may need to use the FtcLegacyModule component and its ReadAnalog block. Note that you DO NOT need to use this component to program the legacy Hitechnic motor controllers. This component is specifically for some of the more obscure Lego sensors like the Temperature sensor, or for programming the Prototyping boards we had to use last season for limit switches and other 3rd party sensors. The support for i2c via the CLM is evolving and the beta versions of the SDK and App Inventor don't have the final API yet There have been reports on the FTC and Chief Delphi forums of legacy devices not working with port 5 of the legacy module, so keep that in mind and be sure to read the FTC forums for the most up to date info. Just use the FtcServo and FtcMotor components the same way that you would if they were servos and motors connected to the new Modern Robotics controllers. In general, if there is a specific FTC component, it should work with legacy and new hardware. The FtcMotor will work for legacy and new motors. The FtcServo will work for legacy and new servos. Same for sensors. The FtcIrSeekerSensor will work for legacy and new IR seller sensors. Just make sure that the components DeviceName property matches the name used when configuring the robot. Below the FTC Components, there are many additional components you can explore. The Sensors collection contains all the sensors built in to many Android phones, including the Accelerometer and Orientation sensors. The Media collection gives you access to the sound and camera capabilities of the device. We’ve done some work over the summer with the camera on the ZTE and pattern recognition, identifying squares and circles. Very exciting and powerful stuff we only dreamed about last season.

13 Programming the Legacy Module - App Inventor
FtcRobotController FtcOpMode FtcDcMotor FtcGamePad This is a general overview of what you need to do to develop a simple program in App Inventor. The FtcRobotController component establishes communication with the driver station and loads the robot configuration file. Be sure to enter the same config file name here in the “Configuration” field that you enter when you set up the hardware config on your Robot Controller phone. You can see that for this demo I named my config file lazy_bott. You need one FtcOpMode component for each OpMode in your app. OpMode is really just a fancy word for Program, and the name you give it here is how it will be displayed on the Driver Station phone. For this demo, I named the OpMode Teleop. Note that you DO NOT have to create a new Project for each OpMode. You can add several to one project and then select which one to run from the Driver Station. To control motors, add FtcDcMotor components. When you set up the hardware configuration on the Robot Controller phone, you have to name these the same as what is in the DeviceName field here. I set the DeviceName and the ComponentName to the same thing to make it easy to understand. RightMotor and LeftMotor For Teleop programs, you’ll need to add an FtcGamePad component. This is what provides all the information about what buttons are being pressed while the program is running.

14 Programming the Legacy Module - App Inventor
Once you have added these components, App Inventor will look like this. The non-visual components, FtcOpMode, FtcDcMotor, and FtcGamePad are shown below the Screen pane. All components you’ve added will be displayed to the right of the Screen Viewer pane. The next step is to switch to the Block view by clicking the Block button in the upper right corner.

15 Programming the Legacy Module - App Inventor
Chrome v m Heads UP!!! The current version of Chrome does not display the Blocks! There is some issue with the way this version renders the App Inventor UI So… This is where I had to switch to the Firefox browser.

16 Programming the Legacy Module - App Inventor
THIS is what is supposed to be displayed. As you can see, there are many different Logic and Variable blocks, as well as blocks for each component you added. When you select a Block, the Viewer will display all the options available for that block. When you click one of the Block options, the rest of them will disappear, you then drop the selected Block in the viewer pane.

17 Programming the Legacy Module - App Inventor
As you can see, each programming Block is like a puzzle piece, with matching connectors on components that can be connected. This sequence is basically like a DO LOOP in RobotC. While the Teleop OpMode is running, set the RightMotor direction to Reverse (like we used to do in the motor config in RobotC. Set the tgtPower variable equal to the negative value of the right joystick on gamepad 1 then set the power level of the right motor to the value of the tgtPower variable.

18 Programming the Legacy Module - Android Studio
Initial Setup Setup Phones Install Android Studio Download ftc_app-master from GitHub Install Driver Station from Google Play Store Connect phone to Android Studio Compile and Download Robot Controller App to phone Name and Pair phones using WiFi Direct Connect Robot Controller phone to a Wireless Network accessible from computer Users will need to setup and install Android Studio. There are many great tutorials online that cover these ftc_app-master is the name of the official Robot Controller App project on GitHub

19 Programming the Legacy Module - Android Studio
Wi-Fi Programming and Debugging Determine Robot Controller IP Address Open Device Settings Click on the Connected wireless network Hint: Put the settings icon on the quick launch bar … also settings can be accessed by swiping down on the home screen.

20 Programming the Legacy Module - Android Studio
Wi-Fi Programming and Debugging Connect RobotController phone to PC with a USB cable Click on the Terminal tab (Bottom row of buttons in Android Studio) Enter : adb tcpip 5555 Enter : adb connect <ip-address>:5555

21 Programming the Legacy Module - Android Studio
Wi-Fi Programming and Debugging Enter: adb tcpip 5555 Enter: adb connect <ip-address>:5555 After both commands are successful the phone can be disconnected from the PC Rebuild and download Robot Controller App in Android Studio to test wireless connection

22 Programming the Legacy Module - Android Studio
Create Hardware Configuration File After downloading and running Robot Controller App select the main menu Menu can be opened from the button on the top right or using the phone’s hardware menu button

23 Programming the Legacy Module - Android Studio
Create Hardware Configuration File After downloading and running Robot Controller App select Settings from the main menu A hardware configuration file is needed for user programs to access any of the controllers attached to the phone’s USB port. Every time a new device is added the configuration file will need to be updated or a new file created. The Robot Controller App remembers the last configuration file selected and automatically tries to connect to that hardware again. The menu can be opened from the button on the top right or using the phone’s hardware menu button

24 Programming the Legacy Module - Android Studio
Create Hardware Configuration File Click New and then Scan to search for connected USB devices Don’t forget to turn on the Core Power Distribution Module

25 Programming the Legacy Module - Android Studio
Create Hardware Configuration File Click on the Legacy Module and assign devices to connected ports On the minions the motor controllers are attached to Ports 3 and 4 In this tutorial the names of the Motor Controllers are not used in code

26 Programming the Legacy Module - Android Studio
Create Hardware Configuration File Click attached and name each connected motor. (These names will be used in our OpMode program) Here we simply named the motors 1-4. It is helpful during programming to give more descriptive names.

27 Programming the Legacy Module - Android Studio
Create Hardware Configuration File Several hardware configurations can be stored on the Robot Controller allowing one phone to be moved between robots. When the desired configuration is activated, click on the back hardware button to return to the main screen. The robot controller app will automatically initialize and connect to the new USB hardware. There may be a Android OS popup window when devices are first connected. Click to allow the Robot Controller access to the USB hardware and select the checkbox to prevent future warnings.

28 Programming the Legacy Module - Android Studio
Creating a new Op Mode OpModes are the name for user programs that can be started and stopped from the Driver Station App (both TeleOp and Autonomous) The Robot Controller App project folder can seem intimidating but there are really only a few files we need to update.

29 Programming the Legacy Module - Android Studio
Creating a new Op Mode The easiest way to start is to copy and paste an existing OpMode Android Studio will prompt for a new class name In Java class names will be the same as the file they are in.

30 Programming the Legacy Module - Android Studio
Creating a new Op Mode Update the Init() and Loop() methods with custom logic.

31 Programming the Legacy Module - Android Studio
Creating a new Op Mode Telemetry data can send messages back to Driver Station

32 Programming the Legacy Module - Android Studio
Creating a new Op Mode Add the new OpMode class to the list of registered OpModes to make it show up on the Driver Station App

33 Programming the Legacy Module - Android Studio
Connecting Driver Station Press Start and A or B on the gamepad after starting Driver Station App Joysticks have to be paired with the Driver Station app when it is first started and sometimes when it restarts. Press Start and A for Joystick 1 and press Start and B for Joystick 2 A little more telemetry data room can be seen by swiping up on the screen.

34 #TipsForFtcTeams USB Plugs can wear out quickly, and may be generally sketchy to begin with. Design and 3D print a harness for each module Static discharge may still be an issue Avoid multiple USB connection joints Amazon.com. Search for “Hittime 3 in 1 USB OTG Cable Adapter” USB Plugs can wear out quickly, and may be generally sketchy to begin with. Make sure to secure all plugs with zip ties. An even better design is to design and 3D print a harness for each module that includes a spot for the USB plug. Many teams are already doing this and uploading their CAD files to You can download their CAD file and print it on your 3D printer if you are fortunate enough to have access to one. Because all of this technology is new to FTC, we don’t know yet if static discharge is still going to be an issue. To play it safe, mount all your electronic components on a high resistance material such as Kydex, Lexan, or wood. The current kit comes with a 2 piece cord system and 4-way USB splitter for the driver station. This “extra” cord connection may cause connectivity issues during matches. This splitter does it all with only one cord. It is available on Amazon.com.

35 Questions ?


Download ppt "The New FTC Platform (Connecting your legacy hardware)"

Similar presentations


Ads by Google