Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   3V3 digital signal to the cRIO (http://www.chiefdelphi.com/forums/showthread.php?t=123755)

nuttle 27-12-2013 23:55

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)

efoote868 28-12-2013 00:05

Re: 3V3 digital signal to the cRIO
 
Quote:

Originally Posted by nuttle (Post 1317592)
-- 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.

yash101 28-12-2013 02:10

Re: 3V3 digital signal to the cRIO
 
Quote:

Originally Posted by nuttle (Post 1317592)
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!

magnets 28-12-2013 08:34

Re: 3V3 digital signal to the cRIO
 
Quote:

Originally Posted by yash101 (Post 1317605)
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.

yash101 28-12-2013 12:23

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?

magnets 28-12-2013 12:55

Re: 3V3 digital signal to the cRIO
 
Quote:

Originally Posted by yash101 (Post 1317653)
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.

steinra 29-12-2013 18:01

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.

yash101 30-12-2013 14:34

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!


All times are GMT -5. The time now is 12:35.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi