Go to Post My guess is that soon, everyone will see the merit of a 4-axis self-controlled robot arm on their robot. - JohnSchneider [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-19-2017, 04:23 PM
granjef3's Avatar
granjef3 granjef3 is offline
Code Ninja
AKA: Matt
FRC #2383 (Ninjineers)
Team Role: Programmer
 
Join Date: Sep 2015
Rookie Year: 2016
Location: Florida
Posts: 16
granjef3 is on a distinguished road
Question New CANTalon MotionMagic control mode documentation?

At worlds in 2016, the CTRE booth had a demo utilizing a new control mode called "Motion Magic" on the Talon SRX to control a robotic arm.

Some functions relating to this control mode are present within the docs for the 2017 CTRE FRC library docs, however details as to the exact function of this new control mode are absent from the Talon SRX Software Reference Manual.

Is the new Motion Magic mode present in the 2017 v2.20 Talon SRX firmware, and is there any documentation on how it works, the algorithm it uses, etc?
__________________

2016 Galileo Division Semifinalists with 341 Miss Daisy, 3683 Team Dave, and 4525 Renaissance Robotics

Thanks to all of our past alliance members!

Last edited by granjef3 : 01-19-2017 at 08:20 PM.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-22-2017, 12:34 PM
abcurrie abcurrie is offline
Registered User
FRC #2619
 
Join Date: Mar 2009
Location: Midlandm MI
Posts: 1
abcurrie is an unknown quantity at this point
Re: CANTalon MotionMagic control mode

I just asked CTRE the same question and I am posting the response here for others:

"
There's a new manual version going out soon, but I can give you the basic information in the meantime.

Motion Magic is a new control mode for Talon SRX that provides the benefits of Motion Profiling without needing to generate the profile data. You use the MotionMagic control paramter when setting the Talon Control Mode.

The first step for Motion Magic is setting up your position PIDF values as normal (see the Soft. Ref. Manual). You then use two additional calls (setMotionMagicAcceleration(double) and setMotionMagicCruiseVelocity(double)) to set the desired acceleration and cruise velocity parameters.

Once this has been done, you can use set() calls as normal to set the position that Talon will move to, and the motion will follow a trapezoidal motion profile (as described in the motion profiling documentation).

That's it! It gives you flexibility to have all movements follow a trapezoidal motion profile without actually generating the profile points.

Let me know if you have any additional questions.

Regards,

Jacob Caporuscio
Software/Hardware Engineer
CTR Electronics
"
Reply With Quote
  #3   Spotlight this post!  
Unread 02-11-2017, 02:51 PM
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 604
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: CANTalon MotionMagic control mode

The control mode documentation was added a while ago, but today I just posted a Java walkthrough in section 12.8 for complete tuning of motion magic.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-11-2017, 03:21 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,674
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: CANTalon MotionMagic control mode


Omar,

Does Motion Magic use trapezoidal acceleration or trapezoidal velocity?


Reply With Quote
  #5   Spotlight this post!  
Unread 02-11-2017, 06:56 PM
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 604
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: CANTalon MotionMagic control mode

Checkout the graph on section 10.7. I think that will make it obvious how it works.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-15-2017, 05:53 AM
Joe Derrick's Avatar
Joe Derrick Joe Derrick is offline
Mentor - Programming
FRC #0319
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Prospect Mountain High School
Posts: 53
Joe Derrick is a glorious beacon of lightJoe Derrick is a glorious beacon of lightJoe Derrick is a glorious beacon of lightJoe Derrick is a glorious beacon of lightJoe Derrick is a glorious beacon of lightJoe Derrick is a glorious beacon of light
Re: CANTalon MotionMagic control mode

Just a note:

We used the Motion Magic sample code from CTRE yesterday.

Overall opinion - A relatively easy way to implement motion profiles for simple motions.

Details:
We used a 775 pro on a 100:1 versa planetary with a Integrated encoder to consistently turn our gear collector 70 degrees and then back to home.

Using the outputs from the example code we were able to set our F-gain quickly as well as tune our PID. (with a 100:1 our error was down to +/-5 native units with just P)

Modifications: there are two Smartdashboard outputs that we had to comment out of the code as they are unsupported currently, i guess they will be in the next release.

Still to come:
We have yet to use the index feature but are planning on it.

We have yet to test under situations which may provide some abnormal loads, eg. loading while up against a wall or something that pushes back.

While we don't have a lot of position control features on our robot this year, I am inclined to think this method may replace our PID position control. We will see how it holds up to the rigor of a full FRC season.

Best of luck
__________________
2010-2017 Mentor Team 319
2012 - Rockwell Automation Award Winner
2014 - Xerox Creativity in Engineering Winner, Archimedes Division
2015 - Rockwell Automation and Gracious Proffesionalism Winner, Tesla Division
2016 - North Shore and UNH District Event Winner, Carson Division
http://www.frc319.com
Reply With Quote
  #7   Spotlight this post!  
Unread 02-16-2017, 05:17 PM
darrellt darrellt is offline
Registered User
FRC #2635
 
Join Date: Oct 2009
Location: Lake Oswego, Oregon
Posts: 14
darrellt is an unknown quantity at this point
Re: CANTalon MotionMagic control mode

We are using MotionMagic and it is really nice. It can still be tricky to determine the PIDF values. I posted a blog that might help:
https://www.systemvision.com/blog/co...ebruary-1-2017
Reply With Quote
  #8   Spotlight this post!  
Unread 03-12-2017, 09:00 PM
TigerVision TigerVision is offline
Registered User
FRC #3654
 
Join Date: Feb 2017
Rookie Year: 2016
Location: Connecticut
Posts: 4
TigerVision is an unknown quantity at this point
Re: CANTalon MotionMagic control mode

I am experimenting the MotionMagic code in LabView (released 2 weeks ago) and also looked at the Java walkthrough. Two issues I encountered: 1) cannot programmingly determine when the MotionMagic execution ends. In Labview, "Mot Prof Active Is Last" in Talon Get Status is always False even after the robot reached target and stopped long ago. I have to rely on loop count to terminate the loop. 2) In LabView example, many tasks like SET REF, SET PID are placed in Teloop which is called every 20 ms. Should these type of tasks placed in Begin ? In addition, it would be really helpful to have another example to show how to code for multiple Talon SRXs and single sensor(section 7.6 in software manual). We use single-side of a tank drive powered by two motors and could not find any example code. Thanks!


Quote:
Originally Posted by ozrien View Post
The control mode documentation was added a while ago, but today I just posted a Java walkthrough in section 12.8 for complete tuning of motion magic.
Reply With Quote
  #9   Spotlight this post!  
Unread 03-12-2017, 10:57 PM
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 604
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: CANTalon MotionMagic control mode

Quote:
Originally Posted by TigerVision View Post
I am experimenting the MotionMagic code in LabView (released 2 weeks ago) and also looked at the Java walkthrough. Two issues I encountered: 1) cannot programmingly determine when the MotionMagic execution ends.
You know what the target position is (since you are passing it into the SET).
You know what your current position is (there is Talon API for this)
Take the difference and make a decision.
Make sense?
Quote:
Originally Posted by TigerVision View Post
In Labview, "Mot Prof Active Is Last" in Talon Get Status is always False even after the robot reached target and stopped long ago.
This is for Motion Profile control mode (Motion Profile reference manual ).
This is not for Motion Magic control mode.
Quote:
Originally Posted by TigerVision View Post
I have to rely on loop count to terminate the loop.
Don't do this. See above.
Quote:
Originally Posted by TigerVision View Post
2) In LabView example, many tasks like SET REF, SET PID are placed in Teloop which is called every 20 ms. Should these type of tasks placed in Begin ?
Sure if those values are constant. If some of those signals are dialed in via front-panels, then you might want to set them periodically, but 20ms is overkill.
Quote:
Originally Posted by TigerVision View Post
In addition, it would be really helpful to have another example to show how to code for multiple Talon SRXs and single sensor(section 7.6 in software manual). We use single-side of a tank drive powered by two motors and could not find any example code. Thanks!
Start with section 9.1.1 to code it.
Then follow the procedure in section 7.6 to test it.
Use the self-test to diagnose if it behaves differently then your expectation.
Reply With Quote
  #10   Spotlight this post!  
Unread 03-12-2017, 11:00 PM
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 604
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: CANTalon MotionMagic control mode

Quote:
Originally Posted by TigerVision View Post
cannot programmingly determine when the MotionMagic execution ends
Also Section 10.7 (Talon SRX Software Reference Manual) Motion Magic Control Mode...

"There is no general requirement to “wait for the profile to finish”, however the robot application
can poll the sensor position and determine when the motion is finished if need be."
Reply With Quote
  #11   Spotlight this post!  
Unread 03-19-2017, 03:58 PM
TigerVision TigerVision is offline
Registered User
FRC #3654
 
Join Date: Feb 2017
Rookie Year: 2016
Location: Connecticut
Posts: 4
TigerVision is an unknown quantity at this point
Re: CANTalon MotionMagic control mode

Zrien, thank you for the detail answers! We got the Motion Magic working. Using the difference between target and sensor position is ideal. We want to add some safety mechanism in case that the sensor is malfunction or something unexpected. I still think it would be nice that Motion Magic set a flag in API to let other program know it is done. The LabView sample code at section 9.1.1 uses one motor as example, not much discussion how to use it for Tank drivetrain which has independent left and right motors. I can get the idea from the sample code and duplicate much of the code for another side of the motor. A real working example would be nice. Thanks again.
Reply With Quote
  #12   Spotlight this post!  
Unread 03-19-2017, 07:04 PM
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 604
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: CANTalon MotionMagic control mode

Quote:
Originally Posted by TigerVision View Post
...I still think it would be nice that Motion Magic set a flag in API to let other program know it is done.
Motion Magic is never "done" in the sense that it is always servo-ing position, but a fair question to ask is when does the generated profile achieve zero velocity. You can actually poll this by grabbing the ActTraj_Velocity signal and comparing against zero. It's plotted in the walk-through and should follow your measured sensor velocity closely.

See github example at
https://github.com/CrossTheRoadElec/...mple/Teleop.vi

Quote:
Originally Posted by TigerVision View Post
...The LabView sample code at section 9.1.1 uses one motor as example, not much discussion how to use it for Tank drivetrain which has independent left and right motors. I can get the idea from the sample code and duplicate much of the code for another side of the motor. A real working example would be nice. Thanks again.
But if we did that, what's left for the students to do?
Reply With Quote
  #13   Spotlight this post!  
Unread 03-23-2017, 07:45 PM
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 212
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
Re: CANTalon MotionMagic control mode

Quote:
Originally Posted by ozrien View Post
You can actually poll this by grabbing the ActTraj_Velocity signal and comparing against zero. It's plotted in the walk-through and should follow your measured sensor velocity closely.
Quote:
Originally Posted by Talon Manual
Active Trajectory Position(1,2)
Active Trajectory Velocity(1,2)

(1): These signals are calculated by the Talon SRX Motion Magic controller. These represent
the target position and velocity at a given moment in time.
(2): API will be added in future HERO/FRC release to retrieve these signals.
Has this been added to the API yet?
__________________







"May the coms be with you"

Is this a "programming error" or a "programmer error"?
Reply With Quote
  #14   Spotlight this post!  
Unread 03-24-2017, 04:44 PM
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 604
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: CANTalon MotionMagic control mode

Looks like it was added in CTRE Toolsuite 4.4.1.11 Installer @ 2/17/2017.

https://www.ctr-electronics.com/down.../RELEASE_NOTES

Search for 'getMotionMagicActTrajVelocity'...

http://www.ctr-electronics.com/downl...tml/index.html

http://www.ctr-electronics.com/downl...c40280 4d56c4

LV has it in the GET STATUS cluster.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:16 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi