Go to Post Mentors are the guardrails: Show the students how to do what they need to do, Step back and let the students do what they need to do, Nudge them back on course when they need a nudge, Insist, when necessary, that no one tries to juggle the chainsaws - gblake [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
  #1   Spotlight this post!  
Unread 06-02-2013, 23:45
Greycrazygamer's Avatar
Greycrazygamer Greycrazygamer is offline
Registered User
FRC #2761
 
Join Date: Jan 2013
Location: Fresno
Posts: 6
Greycrazygamer is an unknown quantity at this point
CAN Encoder Programming problem

we are designing a pivot drive system this year for our robot, however i am running into some problems with the code. We integrated the example CAN position.vi example from labview into teleop, however, when running the code, our AMS as514sb encoder will go to a certain value, then reset to 0. for example, if i set its position to 2 rotations, it may go to 1.78, then reset back to 0. this produces an effect of the motor continuously running, attempting to reach 2.00, but failing. interestingly, the encoder pulses seems to control the range of value we can move between before the value resets to zero. We are also running a US digital encoder to turn our wheels forward/back and we are having no problems with this encoder. i know the the AMS can utilize must higher pulses per minute than the US, but im not sure if that should effect the code.
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2013, 23:55
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: CAN Encoder Programming problem

The AS5145B is intended to be used as a rotational position encoder, not a quadrature encoder. How do you have it connected? How are you reading its value?
Reply With Quote
  #3   Spotlight this post!  
Unread 07-02-2013, 00:14
ILikePizza555's Avatar
ILikePizza555 ILikePizza555 is offline
Registered User
AKA: Isaac Avram
FRC #2761 (CN Ironhorse)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Fresno, CA
Posts: 63
ILikePizza555 is an unknown quantity at this point
Re: CAN Encoder Programming problem

I'm from the same team as CrazyGamer and we are working together on this.

This is how we wired it:
Spoiler for Wiring:



__________________
PONIES ARE STOOPID MAGIK -Heavy
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2013, 00:15
ILikePizza555's Avatar
ILikePizza555 ILikePizza555 is offline
Registered User
AKA: Isaac Avram
FRC #2761 (CN Ironhorse)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Fresno, CA
Posts: 63
ILikePizza555 is an unknown quantity at this point
Re: CAN Encoder Programming problem

This is how we coded it:
Spoiler for code:

Begin.vi:

Cust M. - Open vi:

Cust. M. - EncodeMotor:

Teleop:

__________________
PONIES ARE STOOPID MAGIK -Heavy
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2013, 08:08
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: CAN Encoder Programming problem

Quote:
Originally Posted by ILikePizza555 View Post
This is how we wired it:
On the sensor, I see six wires: two red, two white, and two black. On the Jaguar, I see five: one each of red, white, and black, and two gray. What happens to the wires between the two devices?

You apparently have something connected to the "I" (index) pin of the Jaguar's encoder input. A signal on that pin will reset the count. Try just removing that connection and see if the count starts doing what you expect.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2013, 23:01
ILikePizza555's Avatar
ILikePizza555 ILikePizza555 is offline
Registered User
AKA: Isaac Avram
FRC #2761 (CN Ironhorse)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Fresno, CA
Posts: 63
ILikePizza555 is an unknown quantity at this point
Re: CAN Encoder Programming problem

Quote:
Originally Posted by Alan Anderson View Post
On the sensor, I see six wires: two red, two white, and two black. On the Jaguar, I see five: one each of red, white, and black, and two gray. What happens to the wires between the two devices?

You apparently have something connected to the "I" (index) pin of the Jaguar's encoder input. A signal on that pin will reset the count. Try just removing that connection and see if the count starts doing what you expect.
The wire leading that plugs into (-) on the Jag gets split into two and goes into gnd and Csn on the encoder.
__________________
PONIES ARE STOOPID MAGIK -Heavy

Last edited by ILikePizza555 : 07-02-2013 at 23:15.
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 23:00.

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