My camera can always tell when you're near.
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 22-08-2013, 17:02
Peleg2230's Avatar
Peleg2230 Peleg2230 is offline
Registered User
FRC #2230 (General Angels)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 26
Peleg2230 is an unknown quantity at this point
Re: Encoder problems

Quote:
Originally Posted by Phalanx View Post
We used the closed loop functions of the Jaguar via CAN.
Phalanx, to do that do you need 2CAN or any other thing more than the encoder and Jaguar?
__________________
General Angels #2230 :
2009 IS champions + chairman's award
2011 IS finalists

Last edited by Peleg2230 : 22-08-2013 at 17:31.
Reply With Quote
  #17   Spotlight this post!  
Unread 22-08-2013, 17:14
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,154
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: Encoder problems

Quote:
Originally Posted by Peleg2230 View Post
I want to get the RPM, according to the help from the get it is only seconds.
If you multiply seconds by 60 you don't get RPM. See below for proper computation.



Quote:
if you could help me it would be amazing
Try this:

Quote:
Originally Posted by jhersh View Post
You would be best served selecting Up/Down counter mode and only configuring and connecting the "Up" channel.

The LabVIEW example linked below shows how to do that, and how to convert Counter.get to RPM:

Quote:
Originally Posted by Mark McLeod View Post
You need to know the cycles per rev per channel for your encoder. Use that value instead of "99" in the above LabVIEW example.

Use your desired FPGA sample averaging value instead of "5".


Reply With Quote
  #18   Spotlight this post!  
Unread 22-08-2013, 17:26
Peleg2230's Avatar
Peleg2230 Peleg2230 is offline
Registered User
FRC #2230 (General Angels)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 26
Peleg2230 is an unknown quantity at this point
Re: Encoder problems

All has been changed.
Thank you very much!
__________________
General Angels #2230 :
2009 IS champions + chairman's award
2011 IS finalists
Reply With Quote
  #19   Spotlight this post!  
Unread 22-08-2013, 18:16
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,154
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: Encoder problems



Does anybody know what the default Cycles Per Rev per channel is for the AS5145B in incremental mode?

Attached Thumbnails
Click image for larger version

Name:	8.1.2.png
Views:	19
Size:	102.9 KB
ID:	15167  
Reply With Quote
  #20   Spotlight this post!  
Unread 22-08-2013, 18:27
Peleg2230's Avatar
Peleg2230 Peleg2230 is offline
Registered User
FRC #2230 (General Angels)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 26
Peleg2230 is an unknown quantity at this point
Re: Encoder problems

According to WPI (http://wpilib.screenstepslive.com/s/...control-system) it is 1024
Attached Thumbnails
Click image for larger version

Name:	AS5145B.PNG
Views:	12
Size:	9.3 KB
ID:	15168  
__________________
General Angels #2230 :
2009 IS champions + chairman's award
2011 IS finalists
Reply With Quote
  #21   Spotlight this post!  
Unread 22-08-2013, 20:27
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,154
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: Encoder problems



"The AS5145B is the equivalent of an optical encoder with a 1024 count disc, meaning it will output 1024 pulses per channel per revolution. In 4x decoding mode, this will yield 4096 ticks per revolution."


In that context, "pulses" seems to mean "cycles" (whereas US Signal uses "pulses" to mean "edge transitions").

Assuming that is correct, there are 1024 rising and 1024 falling edges per rev on each channel.

Let's do the math. There are 2*1024 = 2048 edge transitions per rev on each channel. So the edges are 1/2048 of a rotation apart, assuming the best case of perfect symmetry. So the max speed the FPGA can handle for a single channel of that encoder before it starts to get weird is (1/2048)/6.525e-6 = 74.8 rotations per second = 4490 RPM.

So that will not work for your desired 6000 RPM. Use a different encoder with fewer cycles per rev.


Attached Thumbnails
Click image for larger version

Name:	US Signal cycles vs pulses.png
Views:	25
Size:	120.2 KB
ID:	15169  

Last edited by Ether : 22-08-2013 at 20:47.
Reply With Quote
  #22   Spotlight this post!  
Unread 23-08-2013, 06:35
Peleg2230's Avatar
Peleg2230 Peleg2230 is offline
Registered User
FRC #2230 (General Angels)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 26
Peleg2230 is an unknown quantity at this point
Re: Encoder problems

So I will try again the E4P as a counter.
Thank you very much
__________________
General Angels #2230 :
2009 IS champions + chairman's award
2011 IS finalists
Reply With Quote
  #23   Spotlight this post!  
Unread 23-08-2013, 12:14
Phalanx's Avatar
Phalanx Phalanx is offline
Formerly Team 1089 (Mercury)
AKA: Michael Reffler
FRC #5431 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 1999
Location: Lewisville, TX (previously NJ)
Posts: 384
Phalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond repute
Re: Encoder problems

Quote:
Originally Posted by Peleg2230 View Post
Phalanx, to do that do you need 2CAN or any other thing more than the encoder and Jaguar?
You can use either the 2CAN or the SERIAL to CAN adapter. The instructions for making making CAN cables, terminator, and a SERIAL to CAN adapter can be found here beginning on page 23.
http://content.vexrobotics.com/docs/...e_20130215.pdf

In your case, I would use the SERIAL to CAN adapter setup for your testing, learning, developmental purposes.
There is a bit of a learning curve to get the environment setup. You'll need to load FIRMWARE and set ID's on the JAGS.
All the documentation you need can be found here: http://www.vexrobotics.com/vexpro/mo.../217-3367.html

There are also good examples in LABVIEW, for CAN Jaguar and Encoder that you can look at to get a better understanding of how to setup the environment.
__________________
Don't just ask the experts, become one!
Leadership is not about ability. It's about responsibility!
Diagonally Parked in a Parallel Universe. It's okay we do Quantum Physics



Last edited by Phalanx : 23-08-2013 at 12:27.
Reply With Quote
  #24   Spotlight this post!  
Unread 23-08-2013, 12:19
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,154
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: Encoder problems

Quote:
Originally Posted by Peleg2230 View Post
So I will try again the E4P as a counter.
If you already have the AS5145B wired up and ready to go, why not run it and see if it works as expected? Increase the RPM and let us know at what point the RPM starts to misbehave.


Reply With Quote
  #25   Spotlight this post!  
Unread 23-08-2013, 14:01
Peleg2230's Avatar
Peleg2230 Peleg2230 is offline
Registered User
FRC #2230 (General Angels)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 26
Peleg2230 is an unknown quantity at this point
Re: Encoder problems

Ether, I will check on Sunday and post what will happen..
__________________
General Angels #2230 :
2009 IS champions + chairman's award
2011 IS finalists

Last edited by Peleg2230 : 23-08-2013 at 14:17.
Reply With Quote
  #26   Spotlight this post!  
Unread 23-08-2013, 14:11
Peleg2230's Avatar
Peleg2230 Peleg2230 is offline
Registered User
FRC #2230 (General Angels)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 26
Peleg2230 is an unknown quantity at this point
Re: Encoder problems

Phalanx, do you have any tips / important notes for working with the CAN?
I will probably test that after our offseason competition and I want to make sure I will have all the information needed.
__________________
General Angels #2230 :
2009 IS champions + chairman's award
2011 IS finalists
Reply With Quote
  #27   Spotlight this post!  
Unread 23-08-2013, 15:28
Phalanx's Avatar
Phalanx Phalanx is offline
Formerly Team 1089 (Mercury)
AKA: Michael Reffler
FRC #5431 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 1999
Location: Lewisville, TX (previously NJ)
Posts: 384
Phalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond reputePhalanx has a reputation beyond repute
Re: Encoder problems

Quote:
Originally Posted by Peleg2230 View Post
Phalanx, do you have any tips / important notes for working with the CAN?
I will probably test that after our offseason competition and I want to make sure I will have all the information needed.
Sure... Here are top tips....

1) Make sure you have good termination. Poor terminating has been the cause of more nightmares and headaches than anything else.

2) Don't overtax the CPU on the CRIO. When than happens the serial port bogs down, responses get slow, CAN errors tend to crop up.

3) Don't send the run at xxxx speed every loop (20ms) in teleop. I find that that adds too much traffic and floods the serial port. Just set it once, and then check it in a periodic loop (I like the 100ms loop for that). The Jaguar will do it's best to maintain that speed for you. You only need to tell it when you want to change it. It's kind of like, set it once and forget it.
__________________
Don't just ask the experts, become one!
Leadership is not about ability. It's about responsibility!
Diagonally Parked in a Parallel Universe. It's okay we do Quantum Physics


Reply With Quote
  #28   Spotlight this post!  
Unread 23-08-2013, 18:11
Peleg2230's Avatar
Peleg2230 Peleg2230 is offline
Registered User
FRC #2230 (General Angels)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 26
Peleg2230 is an unknown quantity at this point
Re: Encoder problems

I will probably ask more questions when I will work on the CAN but thank you very much!
__________________
General Angels #2230 :
2009 IS champions + chairman's award
2011 IS finalists
Reply With Quote
  #29   Spotlight this post!  
Unread 25-08-2013, 08:40
Peleg2230's Avatar
Peleg2230 Peleg2230 is offline
Registered User
FRC #2230 (General Angels)
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 26
Peleg2230 is an unknown quantity at this point
Re: Encoder problems

I finally got a chance to test the encoder as a counter (you can see the images attached for the beahaviour of the counter and the begin and readings of the counter).
The math wasn't far from the truth but the tachometer reading showed that the shooter spined at 4800 - 5200 RPM which the counter couldn't read.
Should I replace back the encoder to the E4P that probably will work around those speeds?
Attached Thumbnails
Click image for larger version

Name:	Begin.PNG
Views:	9
Size:	6.5 KB
ID:	15177  Click image for larger version

Name:	Counter readings.PNG
Views:	14
Size:	22.1 KB
ID:	15178  Click image for larger version

Name:	Periodic tasks.PNG
Views:	12
Size:	6.4 KB
ID:	15179  
__________________
General Angels #2230 :
2009 IS champions + chairman's award
2011 IS finalists
Reply With Quote
  #30   Spotlight this post!  
Unread 25-08-2013, 12:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,154
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: Encoder problems

Quote:
Originally Posted by Peleg2230 View Post
Should I replace back the encoder to the E4P that probably will work around those speeds?
The E4P should work, if you physically connect only one channel and set it up as a counter. For a 360 CPR E4P, I recommend you try changing the blue "5" to "126" for high speeds (like 6000 RPM) to reduce the noise.


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

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