Go to Post Any team that started with a random word generator can't be bad. - Sperkowsky [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-03-2016, 08:19
acastagna acastagna is offline
Registered User
FRC #1493
 
Join Date: Jan 2012
Location: Albany High School
Posts: 38
acastagna is an unknown quantity at this point
Play-Record Macro

We are trying to implement the play-record macro described by teams 4009 and 2220 for our autonomous (thank you!) - see
http://www.chiefdelphi.com/forums/sh...ht=play+record

We have it programmed in Java using iterative robot, and it is mostly working except for two issues. When we shoot the ball, we send a shooter.set(1) command to the shooter motor, and then have a 1.5 second delay to wait for the shooter wheel to get up to speed. When we record this, the macro stops recording during the delay, and on playback the shooter wheels get a shooter.set(0) command immediately after getting the shooter.set(1). The shooter wheels are also used as a ball intake without a delay and that function works fine on playback.

The other issue is one that others have reported - accuracy isn't perfect with respect to the path driven. If we record driving in a loop and then play back from the original starting point the robot's final position is off by a few inches or more, and orientation also off.

I'm thinking of having the recording and playback modes run in a separate thread, that way it would keep recording during the delay and we can also increase the read frequency (and hopefully increase accuracy) which right now I believe is limited to by delay between driver station and robot. Has anyone tried this before? Any thoughts?
  #2   Spotlight this post!  
Unread 04-03-2016, 11:05
Oromus's Avatar
Oromus Oromus is offline
Lead Programmer, Community Liaison
AKA: Ryan
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Florida
Posts: 83
Oromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to behold
Re: Play-Record Macro

1). The solution to the first problem is definitely moving the macro code to a separate Thread. The only other way is for the creators of the macro to add a wait function that both freezes the Thread and notifies the macro code of the delay.

2). The inaccuracy problem is due to how the macro works at it's core. The macro records the motor speed values and how long they were maintained. The problem is that at different battery voltages, motor speed values change. For example, on a fully charged battery, a motor running at 0.8 might go at "10 speed". On a slightly less charged battery, a motor running at 0.8 will go at "7 speed". This causes the Robot to drive different distances and turn to different angles based off it's current battery charge. This variance will be present even between two different fully charged batteries, just to a lesser extent. This problem isn't really solvable on your end; your options are wait for a change in the macro, write your own code that tracks more trust-able data (i.e. encoder and gyroscope values instead of motor speeds), or just write a normal autonomous that doesn't work off of recording teleop actions.
__________________


2016 Roles: Manipulator, Strategy Co-Lead, Programmer
2016 Orlando Regional: Quarterfinalist (Captain w/ 1557, 5557 and 4352)
2016 Rocket City Regional: Quarterfinalist (w/ 283 and 34), Regional Chairman's Award Winner
2016 Championship: N/A (had fun and was inspired, that's what counts)
-------------
2015 Role: Programmer
2015 GSCR: Quarterfinalist (w/ 4189 and 4026), Regional Chairman's Award Winner
2015 Orlando Regional: Semifinalist (w/ 456 and 86), Imagery Award Winner
2015 Championship: Pit Safety Award Winner

Last edited by Oromus : 04-03-2016 at 11:24.
  #3   Spotlight this post!  
Unread 04-03-2016, 11:48
acastagna acastagna is offline
Registered User
FRC #1493
 
Join Date: Jan 2012
Location: Albany High School
Posts: 38
acastagna is an unknown quantity at this point
Re: Play-Record Macro

We are using Talon SRX motor controllers and are going to try the voltage compensation mode this weekend to get around the supply voltage issue. As long as we don't try to drive the motor at a voltage greater than what's available we should be OK, and I don't think we want to run that fast anyway in autonomous. I'll report back on if that helps.

We'll also definitely put the macro stuff in a separate thread.
Closed Thread


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 07:06.

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