Go to Post Just like any good hardware or software product, "insert foot before putting mouth in gear"..... - dhitchco [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 15-02-2015, 16:52
Levansic's Avatar
Levansic Levansic is offline
Registered User
AKA: Len Evansic
FRC #0585 (Cyber Penguins)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Tehachapi, CA
Posts: 185
Levansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud of
Re: Use a button to make a motor move a certain number of rotations

Quote:
Originally Posted by RoboBucs View Post
How do they have no way of understanding encoders if the encoders are built in?
Encoders, built in or otherwise, have to plug into something that can understand their signals. The Victors have no such facility. They are not "intelligent", meaning they don't take any external feedback.

The motors themselves don't have any intelligence. Their inputs are only the voltage applied to the wires. The encoders are not linked in any way to the windings in the motor.

You have setup some DIO channels to take the A and B data from the encoders. This information goes straight into the roboRio, which has to do something with it, to control the input to the victors. The roboRio is the brain in this case.

The new Talon SRX's are intelligent, and can do the work onboard with no involvement of the roboRio. The older Jaguars had promise of this, but in practice, they rarely worked as designed for encoder-driven closed loop feedback. I have trouble finding the right words to describe how much I LOVE the Talon SRX's closed loop modes.
Reply With Quote
  #17   Spotlight this post!  
Unread 15-02-2015, 16:56
RoboBucs RoboBucs is offline
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 67
RoboBucs is an unknown quantity at this point
Re: Use a button to make a motor move a certain number of rotations

Quote:
Originally Posted by Levansic View Post
Encoders, built in or otherwise, have to plug into something that can understand their signals. The Victors have no such facility. They are not "intelligent", meaning they don't take any external feedback.

The motors themselves don't have any intelligence. Their inputs are only the voltage applied to the wires. The encoders are not linked in any way to the windings in the motor.

You have setup some DIO channels to take the A and B data from the encoders. This information goes straight into the roboRio, which has to do something with it, to control the input to the victors. The roboRio is the brain in this case.

The new Talon SRX's are intelligent, and can do the work onboard with no involvement of the roboRio. The older Jaguars had promise of this, but in practice, they rarely worked as designed for encoder-driven closed loop feedback. I have trouble finding the right words to describe how much I LOVE the Talon SRX's closed loop modes.
Man this stuff is so beyond my level of experience with this stuff. I may just have to work this with the joystick like we have been so far, unless you have some way around this:/
Reply With Quote
  #18   Spotlight this post!  
Unread 15-02-2015, 16:58
RoboBucs RoboBucs is offline
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 67
RoboBucs is an unknown quantity at this point
Re: Use a button to make a motor move a certain number of rotations

Quote:
Originally Posted by RoboBucs View Post
Man this stuff is so beyond my level of experience with this stuff. I may just have to work this with the joystick like we have been so far, unless you have some way around this:/
Ok, I think we're just gonna have it where when we press the button it will just run for however long we need it to run, will that work?
Reply With Quote
  #19   Spotlight this post!  
Unread 15-02-2015, 17:57
RoboBucs RoboBucs is offline
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 67
RoboBucs is an unknown quantity at this point
Exclamation Re: Use a button to make a motor move a certain number of rotations

Quote:
Originally Posted by Levansic View Post
Encoders, built in or otherwise, have to plug into something that can understand their signals. The Victors have no such facility. They are not "intelligent", meaning they don't take any external feedback.

The motors themselves don't have any intelligence. Their inputs are only the voltage applied to the wires. The encoders are not linked in any way to the windings in the motor.

You have setup some DIO channels to take the A and B data from the encoders. This information goes straight into the roboRio, which has to do something with it, to control the input to the victors. The roboRio is the brain in this case.

The new Talon SRX's are intelligent, and can do the work onboard with no involvement of the roboRio. The older Jaguars had promise of this, but in practice, they rarely worked as designed for encoder-driven closed loop feedback. I have trouble finding the right words to describe how much I LOVE the Talon SRX's closed loop modes.
Do you know any realistic way that I could make this work with the encoder? I honestly don't have the slightest clue about anything to do with PIDs. All I need it to do it run an exact amount of rotations each time, there has to be some way to do it, could I maybe use a case structure?

Last edited by RoboBucs : 15-02-2015 at 18:01.
Reply With Quote
  #20   Spotlight this post!  
Unread 16-02-2015, 00:25
Levansic's Avatar
Levansic Levansic is offline
Registered User
AKA: Len Evansic
FRC #0585 (Cyber Penguins)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Tehachapi, CA
Posts: 185
Levansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud of
Re: Use a button to make a motor move a certain number of rotations

OK, there are a few things that you can do to get it pretty close without doing a full PID. No matter what, you need to get your logic right, which means that pressing a button will toggle a persistent state. You need to flop between deployed and not deployed, and the state has to be retained from one pass through your code to the next. Feedback nodes (at the bottom of the structures palette) are helpful for this. After you get this worked out, this logic can switch your case structure (or selects) to start moving in the right direction.

Once you have that part figured out, you can use the PID vi's that are included in LabView. Since the output shaft is so slow relative to the count, you can probably get away with using only a well-chosen P gain, setting the I and D to zero.

If you don't want to use the PID function, you can implement the P part on your own. Basically, you calculate the difference between where you are (current encoder count) and where you want to be (final encoder count), and multiply this number by the P gain that you choose. This number is then fed to the motor set vi.

As you approach the desired final encoder count (called the setpoint), the resulting number will get smaller, and the motor will slow, eventually stopping.

If your P gain is set too low, it will never reach the setpoint as the commanded voltage will eventually not be enough to move the motor. If the P gain is too high, the motor will oscillate about the setpoint. Because of this, you could purposefully choose a P that is slightly too low, and bump up your setpoint to a number that lets your motor rest where you want it to end up.

This last paragraph is an adequate way to accomplish your goals, only because your design is essentially toggling between two points. You fudge the setpoint numbers for deploy and retract, until it acts the way you want it to. This may not be viewed as the correct way from a control system perspective, but it will be good enough.
Reply With Quote
  #21   Spotlight this post!  
Unread 16-02-2015, 14:13
mshafer1 mshafer1 is offline
Programming Mentor
AKA: Matthew Shafer
FRC #3937 (Breakaway)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Arkansas
Posts: 53
mshafer1 is an unknown quantity at this point
Re: Use a button to make a motor move a certain number of rotations

Quote:
Originally Posted by RoboBucs View Post
How do they have no way of understanding encoders if the encoders are built in?
They do not correspond to each other, the drive expects values from -1 to 1 on each axis corresponding to a joystick, you could use a pid loop (use the target encoder value as the setpoint and the current reading as the processing variable (pid.vi) which would give you a fine control (if you do this, also set the range on the pid from -1 to 1).
Other option is to implement a proportional gain yourself. Take the current encoder value, subtract the current reading and multiply it by a constant (you'll have to play with the constant to get it where the robot gets close without oscillating)
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 03:55.

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