Positional Motion Profiling for FRC

Similar documents
SPARTAN ROBOTICS FRC 971

DELTA TAU Data Systems, Inc.

TALON SRX / Victor SPX Software Reference Manual

Program your face off

Replicating Chaos Vehicle Replication in Watch Dogs 2. Matt Delbosc Team Lead Programmer Ubisoft Toronto

UItiMotion. Paul J. Gray, Ph.D. Manager Path Planning Front-End Design R&D

Part A: Monitoring the Rotational Sensors of the Motor

FRC LABVIEW PROGRAMMING

Appendix E: Software

I C ROBOTICS FRC ROBOT PROGRAMMING GETTING STARTED WITH LABVIEW

CS 395 Fall 2000 Behavior-Based Robotics Pracitce Quiz 1

Control Technology. motion controller and power amplifier

Lab 1: Move the Mobile Robot Wheels: Motor Velocity Control 2.12: Introduction to Robotics Fall 2016

Indra Works DS Tuning Procedure

Studuino Block Programming Environment Guide

Command and Control Tutorial

Objectives. Part 1: forward kinematics. Physical Dimension

Omnidirectional Drive Systems Kinematics and Control

Advanced Debugging I. Equipment Required. Preliminary Discussion. Basic System Bring-up. Hardware Bring-up, Section Plan

C i t o. AMCS-S-0x-MS. Advanced Motion Control Server For Microstepping Motors. S y s t e m s. Product Description

C x Hexapod Motion Controller

Basic Drive Programming PowerFlex 755 Basic Start Up

EV3 Programming Workshop for FLL Coaches

Lab 4: Trajectory Following 1

EPOS2 Positioning Controllers

PHY 351/651 LABORATORY 1 Introduction to LabVIEW

SPRITES Moving Two At the Same Using Game State

Robot Code Review. Welcome!

C Language Reference for ActivityBot. Driving the robot a specific distance or a specific amount of turn

Sample LabVIEW 5.1 VIs for Vernier LabPro

Lab 7: PID Control with Trajectory Following

List of ISO supported G-Codes and M-functions

RMCWin. WalkThrough. This document is intended for walking through RMCWin with customers over the telephone/internet.

COMMAND BASED PROGRAMMING

TALON SRX Software Reference Manual

Remote Control & Cloud DVR User Guide

ROBOTICS AND AUTONOMOUS SYSTEMS

ME 224: EXPERIMENTAL ENGINEERING. Lecture 2

Making a One Degree Motor Arm with Potentiometer and PID

Release Date Positioning with C2000 and S7 Siemens in Profibus-DP

THE DIGITAL AGE. Motion control in. Not long ago, analog electronics. Motion processors have the ability to do for machines what

Robotics and Autonomous Systems

Robotics and Autonomous Systems

Hexapod Motion Controller with EtherCAT

Process Control: Learning It and Doing It Through LabVIEW Based Design

Date 18/05/17. Operation and maintenance instructions for driver configurator QSet

Autonomous Programming FTC Challenge Workshops VCU School of Engineering September 24, 2016 Presented by: Team 8297 Geared UP!

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

FRC LABVIEW PROGRAMMING

Practical Training with the EPOS Studio

Sphero Lightning Lab Cheat Sheet

Technical Learning. To Get Started. 1. Follow the directions in the Constructopedia to build Robo 1.

Design and Verification of Motion Control Algorithms Using Simulation

Cecilia Laschi The BioRobotics Institute Scuola Superiore Sant Anna, Pisa

Application Note: MatLab data processing for Motion Capture. Zhichao Lu Team 8 Documents Prep. Date: April 5, 2013

Lab Assignment #10: Mechanisms

Lab Exercise 08 DC motor PID position control

Galil Motion Control. DMC - 42x0. Datasheet

INSTALLATION. UNDERSCORE is a sample library for Native Instruments Kontakt 5.3 and later. It will NOT work with the free Kontakt Player.

WideQuick Remote WideQuick Designer

Learn to use the vector and translation tools in GX.

Math 2250 Lab #3: Landing on Target

Encoder applications. I Most common use case: Combination with motors

Stepper Drive Setup Guide

Trajectory Planning for Automatic Machines and Robots

Omni-Directional Drive and Mecanum: Team 1675 Style. Jon Anderson FRC Mentor

Technological Data. How Can the Technological Data Coupling Be Used with the Drive? (Available for SIMOTION SCOUT V3.2 or later)

SD17098IX Specifications Networked Stepper Driver & Indexer Revision 0.0

Capstone Appendix. A guide to your lab computer software

Mobile Robot Kinematics

Application Note #3412

PEERNET Document Conversion Service 3.0

Software User's Manual

CSCI 204 Introduction to Computer Science II Lab 7 Queue ADT

Motion Graphs. Plotting position against time can tell you a lot about motion. Let's look at the axes:

Robots are built to accomplish complex and difficult tasks that require highly non-linear motions.

Physics 101, Lab 1: LINEAR KINEMATICS PREDICTION SHEET

(Refer Slide Time 00:01:09)

Event-based tasks give Logix5000 controllers a more effective way of gaining high-speed processing without compromising CPU performance.

Controller Pro Instruction Manual

Brushless IDEA Drive. Software User Manual PBL4850E. All Rights Reserved

Motion Detector. Lab Pro. Fig Lab Pro Interface. Motion Detector. Power Supply Basketball Ramp and Block Cart

Computer Interfacing Using LabView

Channels & Keyframes. CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2017

Using of HMI panel MT6071iE with SMSD, BLSD and BMSD controllers

Advanced Motion Solutions Using Simple Superposition Technique

LabView Add-On Manual

Snap Crackle Pop. Peter M. Thompson, Ph.D. Systems Technology, Inc. Hawthorne, CA

[ mini-project ] Create standard MIDI files with LabVIEW *

Electronics Design Contest 2016 Wearable Controller VLSI Category Participant guidance

ustepper S Datasheet Microcontroller, stepper driver and encoder in an ultra-compact design! By ustepper ApS

2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)...

Adaptive Cruise Control

Controller Pro Instruction Manual

Motion Analysis. Motion analysis. Now we will talk about. Differential Motion Analysis. Motion analysis. Difference Pictures

Clearpath Communication Protocol. For use with the Clearpath Robotics research platforms

Galil Motion Control. DMC - 18x6. Datasheet (US ONLY)

Rotary Motion Servo Plant: SRV02. Rotary Experiment #00: QuaRC Integration. Using SRV02 with QuaRC. Student Manual

ROGA Control v1.0. User Manual Release 2

Ch En 475: Introduction to Instrumentation and Signal Processing with Labview

Transcription:

Positional Motion Profiling for FRC Ryan Greenblatt A Zebramotion Labs White Paper: Brought to you by Team 900: http://team900.org

Motion Profiling Overview This tutorial is intended for use of the CAN Talon SRX with LabVIEW running on the roborio. There is an example github project at https://github.com/frc900/motion Profiling Example. Specifically, to test and execute motion profiles run the Motion Profile Tester VI on the roborio. More details about the project can be found in this document. We initially decided to investigate motion profiling because we were impressed by the Motion Planning & Control in FRC conference presented by team 254 and team 971 at the 2015 championship. If you haven t already seen the presentation we would highly recommend you watch it. Motion profiles consist of a series of points with a time value, a velocity value, and a positional value. The points are generated to always be physically possible for the mechanism. Motion profiles allow for very consistent, smooth motion. Having a tank drivetrain turn to a specific angle is difficult to execute quickly, precisely, and repeatedly because of wheels slipping. The method of generating a motion profile used here allows for control over the maximum jerk, acceleration, and speed of the motor so that it will not overshoot. Also, the jerk and acceleration can be set so the wheels never skid. Effectively, motion profiles allow an action like turning a drive train to an angle to be consistent and as fast as possible. This example of motion profiling is run using LabVIEW on the roborio controlling Talon SRXs through CAN. This setup allows for sending the trajectory points of the motion profile to the Talon which sequentially executes the points when activated. Many other setups can be used but this one has several intrinsic advantages. Having the motor controller execute the points independently from the roborio allows for greater resolution and more reliable point execution. The loop timing on the Talon is far more reliable than a loop running on the roborio so the execution is more consistent. Up to 128 points (the durations of the points are variable) may be preloaded while the motor controller is being used for another purpose or disabled. This makes it possible to execute a motion profile immediately at the start of a match or at the press of a button. There are many limitations with this system as well. Some number of points must be preloaded to start the execution and make sure the buffer doesn t run out of points to execute. There is a limit to how fast the buffer can receive points so if

the profile can t be pre generated and preloaded there will be a significant delay between when the profile generation is started and when it begins to run. This approach is less CPU intensive than most other methods of executing motion profiles. However, this approach can still be somewhat demanding on the CPU. If a high resolution profile is required the loop on the roborio that sends new points while the profile is running must be run quite quickly. Motion Profiling API for the Talon SRX For more detailed information about the Talon SRX API used for motion profiling please see the Talon SRX Motion Profile Reference Manual on the Cross the Road Electronics website. The only additional VI needed in LabVIEW to use the Talon s motion profiling feature is WPI_CANTalonSRX_SendMotionProfile.vi which is found here: C:\Program Files (x86)\national Instruments\LabVIEW 2015\vi.lib\Rock Robotics\WPI\CAN\TalonSRX. Inputs CAN Talon SRX Ref: The reference for the Talon Clear: If this input is true the entire buffer of points on the Talon will be cleared Push: If this input is true the New Point input will be added to the buffer of trajectory points on the Talon. A new point may be pushed regardless of what mode the Talon is in.

New Point (cluster): Elements (which are actively used when testing and executing motion profiles) Velocity: The velocity that the motor should run at this point in either RPM or native units depending on the selected feedback reference of the motor. See the Talon SRX Software Reference Manual on the Cross the Road Electronics website for more information. The Talon will use feedforward to attempt to achieve this velocity. More detail about feedforward will be later in this document. Position: The position where the motor should be at this point either in rotations or ticks depends on the selected feedback reference of the motor. The Talon will use the PID at the 0 parameter slot to attempt to achieve this position using the position output of an encoder to do this. Zero position: All other points loaded to the buffer after this one will be treated as relative to this point. Often this is set to be true on the first point. Velocity Only: If this is true the position input for this point will be ignored and only feedforward using the velocity input will be used. Please note that velocity only mode is not an effective way to use a motion profile to try to get a motor to a specific velocity. The mode doesn t use any feedback at all so any environmental differences will cause a significant change in the velocity which is reached. Is Last: This will cause the Talon to continue trying to get to the target position using positional PID even after the duration of the point has expired. Duration MS: This will tell the Talon how long to run this point. 10 MS is a typical value but any value between 1 and 255 MS can be used. The loop which runs the motion profile on the Talon runs every millisecond. Outputs: CAN Talon SRX Ref Out: The reference for the Talon. Count: The number of points in the motion profile at the moment. Ready For Next: Whether or not the Talon is ready for the next point. Check that this is true before adding another point.

Execution A loaded profile can be executed by putting the Talon into motion profile mode and setting the motor output to 1. This can either be set using the motor set output VI or Talon change mode VI. An output of 0 will disable the output of the motor controller and an output of 2 will cause the motor controller to hold the current point using positional PID. The Velocity set for the held point should be 0. After finishing executing the motion profile set the output back to 0 while in motion profile mode to make sure that the motion profile is finished correctly. Point Generation There are a multitude of different approaches to generating velocity and position points for a motion profile. The method used in the provided example project, which the Motion Profile Generator Demo VI pictured above runs, was created by Paul Copioli with a few modifications. Specifically, a limitation was placed on maximum velocity and acceleration so that the maximum speed and acceleration are always

obtainable. If this isn t done and the maximum speed and acceleration inserted into the VI aren t obtainable then the profile either won t get to the target position or the profile won t be completed as quickly as is possible. This approach allows for control over the maximum speed, acceleration, and jerk. See this http://www.chiefdelphi.com/forums/showthread.php?s=821dac53446a6368545632e5cc 108d9d&t=98358 chief delphi thread for more information about the Copioli method of motion profiling and see this http://www.chiefdelphi.com/forums/showthread.php?t=147293 chief delphi thread for more information about why maximum acceleration and speed must be limited. Please note that the math used in the code for limiting max acceleration is now slightly different than the math in the thread. Setting Up and Running a Motion Profile First, one should obtain an F value for the motor. This may either be done manually or using the Calculate Feedforward VI contained within the example project in the Calculate Feedforward folder. The VI should only be used if the motor can be allowed to spin quickly for an extended period of time. Open up the feedforward project contained within the folder and then the VI. Within the VI the target throttle should be set to 1 for the purposes of motion profiling, the size of the averaging array should be set to roughly 100, and the valid delta should be set to around 15. More information about what these numbers do is in the VI. If the feedforward value output by the VI is negative the motor should be inverted.

Now you will need to obtain positional PID values for the motor. Keep in mind that the PID shouldn t be very aggressive and it doesn t need to be particularly well tuned; the feedforward should do most of the work. For more information about effective positional PID tuning please see the Talon SRX Software Reference Manual on the Cross the Road Electronics site. After that, open up the Motion Profiler Tester VI found within the Motion Profiling VIs folder. You will need to copy over your motor IDs, inverts, and PIDF values. Additionally, make sure you select the appropriate encoder type; it will affect some of the unit conversion math. If any encoder other than a Cross the Road Electronics magnetic encoder (analog or digital) is used, many of the units will no longer be valid,

but the VI will still work. (In the 2017 season units will likely be standardized. Section 21.25. FRC2016 LabVIEW: API Unit Scaling Inconsistencies within the Talon SRX Software Reference Manual contains detail about current inconsistencies and the manual will contain details about units in the future.) For example, maximum speed won t actually be in rotations/sec it will be in ticks/sec. The first step is determining the correct maximum speed, acceleration, and jerk. Start off by running the motor at 100% voltage while the motor is under typical load. Please note that the motor will spin very quickly. If the motor can t be allowed to spin freely, another method must be used to determine the correct maximum speed,

acceleration, and jerk. Abort this operation when the motor has reached maximum speed. The VI should look like this at this point: Next, use the graph of the motor velocity under 100% power to determine what max acceleration, speed, and jerk should be. After guessing or calculating the

maximums, generate a motion profile which has a large enough target position such that motor will reach maximum speed. Compare the velocity line from the generated motion profile with the velocity line while running at 100% speed. The velocity of the motion profile should always be below the velocity while running at 100% power. This could require adjustments of maximum speed, acceleration, and jerk. After you have obtained valid maximums go ahead and test your motion profile by generating it, loading it, and (as soon as it is done being loaded) running it. The maximums or PID values might need to be adjusted if the motor has difficulty keeping up or the applied throttle is higher than desired while running the profile. An effective execution should look something like this: The actual velocity lags the target velocity slightly, because the sensor velocity output is averaged over a small duration. Motion Magic Motion magic is a new and unimplemented control mode for the Talon SRX. The mode will automatically generate and follow a motion profile to achieve a target location based on a specified cruising velocity, acceleration, and PIDF. This effectively means that the motor will follow a trapezoidal profile.

One example trapezoidal profile: Because all of the points are generated on the Talon, the profile can be started almost instantly and CPU usage on the roborio is negligible. However, trapezoidal profiles can be jerkier than S curve profiles. Following a trapezoidal profile perfectly would theoretically require the motor to experience infinite jerk at one or two points in time. Therefore, this control mode will be somewhat less accurate and consistent than executing a S curve profile using the motion profile mode but far more accurate than using PID.