Go to Post everyone in FIRST has to do the cha cha slide at least once per season to get it out of their system. Now I can go back to doing it in the privacy of my own car (if you see a red Jeep in CT swerving back and forth don't worry, it's just me doing the slide...)! - KathieK [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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
  #16   Spotlight this post!  
Unread 27-12-2013, 23:55
nuttle nuttle is offline
Registered User
AKA: Allen Nuttle
FRC #4080
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: United States
Posts: 104
nuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud of
Re: 3V3 digital signal to the cRIO

A couple of other possibilities:

-- Use an analog input, instead of a digital one (via the analog breakout board, I mention this mainly in case someone comes along, reads this, and wants something easy and quick)

-- Use an opto-isolator (this not only level shifts, but avoids potential problems with ground loops -- you probably don't need to worry about this, but it is very good to be aware of and on the lookout for this type of problem)
  #17   Spotlight this post!  
Unread 28-12-2013, 00:05
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,413
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by nuttle View Post
-- Use an opto-isolator (this not only level shifts, but avoids potential problems with ground loops -- you probably don't need to worry about this, but it is very good to be aware of and on the lookout for this type of problem)
Quoting this because I'd recommend it in most generic situations.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
  #18   Spotlight this post!  
Unread 28-12-2013, 02:10
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by nuttle View Post
A couple of other possibilities:

-- Use an analog input, instead of a digital one (via the analog breakout board, I mention this mainly in case someone comes along, reads this, and wants something easy and quick)

-- Use an opto-isolator (this not only level shifts, but avoids potential problems with ground loops -- you probably don't need to worry about this, but it is very good to be aware of and on the lookout for this type of problem)
An opto-isolator is a splendid idea that will almost always work. Why did someone not already bring it up?!?! Kudos to you .

Using an analog signal would be getting a little off from what we want here. For something like the raspberry pi or propeller would be hard to interface with a DAC/ADC couple. On the RPi, I don't know if you'd even have enough GPIO!
  #19   Spotlight this post!  
Unread 28-12-2013, 08:34
magnets's Avatar
magnets magnets is offline
Registered User
no team
 
Join Date: Jun 2013
Rookie Year: 2012
Location: United States
Posts: 748
magnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by yash101 View Post
An opto-isolator is a splendid idea that will almost always work. Why did someone not already bring it up?!?! Kudos to you .

Using an analog signal would be getting a little off from what we want here. For something like the raspberry pi or propeller would be hard to interface with a DAC/ADC couple. On the RPi, I don't know if you'd even have enough GPIO!
I think the idea behind the analog inputs is to use the analog module on the cRIO because it doesn't have a pull up resistor like the digital ones do. You can make the analog input behave like a digital input and return true if the voltage is above 2v, and false if it is below, without having to worry about the pullup resistor to 5v.
  #20   Spotlight this post!  
Unread 28-12-2013, 12:23
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: 3V3 digital signal to the cRIO

Ah. I get it. However, that seems a little complicated because you will need to craft the code to emulate DI/O. I'm just wondering but has anyone succeeded in using the analog communications with the Jags?
  #21   Spotlight this post!  
Unread 28-12-2013, 12:55
magnets's Avatar
magnets magnets is offline
Registered User
no team
 
Join Date: Jun 2013
Rookie Year: 2012
Location: United States
Posts: 748
magnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by yash101 View Post
Ah. I get it. However, that seems a little complicated because you will need to craft the code to emulate DI/O. I'm just wondering but has anyone succeeded in using the analog communications with the Jags?
The code? Easy- Replace the 2 with any voltage you need.
Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.AnalogChannel;

public class AnalogAsDigital {
    AnalogChannel analogInput;
    
    public AnalogAsDigital(int channel){
        analogInput = new AnalogChannel(channel);
    }
    
    public double getAnalog(){
        return analogInput.getVoltage();
    }
    
    public boolean getDigital(){
        return analogInput.getVoltage() < 2;
    }
}
As for the analog on the jaguar, you can use a gyro/other analog sensor if the output is 0 to 3 V, or any type of potentiometer or variable resistor.

From the datasheet
Quote:
Analog Input
The analog input accepts a 0-3 V sensor signal for implementing position control mode. Position control can
also be implemented with a single- or multi-turn potentiometer. Potentiometers with continuous rotation are not
supported. The Jaguar contains a built-in bias pin for use with 10kΩ potentiometers. If another potentiometer
value or analog source is used, it must have a 0-3 V range.
If the P, I, and D parameters are positive (or zero), the Jaguar expects that a forward condition (+ voltage on
White terminal, - voltage on Green) will generate an increasing voltage on the analog input.
If the P, I, and D parameters are positive (or zero), the Jaguar expects that a forward condition (+ voltage on
White terminal, - voltage on Green) will generate a decreasing voltage on the analog input.
The analog input is not electrically isolated.
Table 5 on page 6 lists the electrical requirements of an external control signal.
  #22   Spotlight this post!  
Unread 29-12-2013, 18:01
steinra's Avatar
steinra steinra is offline
(KG7KEO)
AKA: Randy Steiner
FRC #5461 (V.E.R.N.)
Team Role: Coach
 
Join Date: Nov 2008
Rookie Year: 2007
Location: Meridian, Idaho
Posts: 56
steinra is on a distinguished road
Re: 3V3 digital signal to the cRIO

I guess I want to take a step back and ask the intent.

Are you simulating digital input to test programing on the cRio, or are you using it to pass information the Pi has already determined to the cRio to take action?

I ask because if you are looking to pass information it may be much easier to use i2c if you don't want to use hub points on the radio, or just pass the data between the two on an ethernet connection (UDP or TCP).

But if you are looking to simulate other sensor data then the other discussions here definitely apply. I would look at the logic level shifters from spark fun. That would be the safe way to do it.
__________________
Randy Steiner
2014-2015 FIRST Team 5461 - Coach
2011-2014 FIRST Team 4106 - Head Mentor
2007-2011 FIRST Team 1891 - Mentor
  #23   Spotlight this post!  
Unread 30-12-2013, 14:34
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: 3V3 digital signal to the cRIO

Network isn't the best approach when you want to get the newest data with the least delay. Also, if you are processing a sensor a thousand times a second, offboard, you want a very fast and reliable connection. While ethernet can get close, it isn't exactly the "best" way to go!

It is also relatively easy to code i2C on the Pi compared to another technology because of the libraries out there and the documentation that they have!

Last edited by yash101 : 30-12-2013 at 14:37.
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 12:35.

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