0

Creating a variable voltage pulse
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Creating a variable voltage pulse

by kphenson on Wed Mar 14, 2018 3:50 pm

I am trying to figure out if the MCP4725 will solve a problem I have.

We are using an Arduino Uno and need to get 2 separate outputs:
Each output is DC pulses of 18us PW and 3.6ms apart that have a voltage determined by a separate input in the range of 0 - 1.06VDC.

Would this component be able to provide that?
Am I correct in assuming that two MCP4725 components would be required?

Thanks in advance

kphenson
 
Posts: 11
Joined: Wed Mar 14, 2018 3:41 pm

Re: Creating a variable voltage pulse

by adafruit_support_bill on Wed Mar 14, 2018 4:46 pm

The MCP4725 can create a variable output voltage. But it is not capable of achieving the pulse timing you are looking for. Since it has an i2c interface, the i2c communication speed will limit how fast you can change the output level. The default i2c bus speed is 100KHz. That translates to 10us per bit. Even if you boost the clock rate to 800KHz, you would not be able to send two commands within 18us.

A better approach is probably to use the MCP4725 to generate the required voltage, then use a transistor to switch it on and off to create the pulses.

adafruit_support_bill
 
Posts: 66745
Joined: Sat Feb 07, 2009 10:11 am

Re: Creating a variable voltage pulse

by kphenson on Thu Mar 15, 2018 5:33 pm

Thanks for responding.

Can you tell me if there would be any concerns about voltage drops or anything else that would deminish the resultant analog value and whether 2 of these could handle setting two analog values from the same Arduino Uno?

What I am dealing with is two low voltage inputs to an Arduino (via UDP) in the 0 - +1.06VDC range.

The granularity is very significant because the resultant DC pulses that I need to create based on those voltages is used by another device as input to an exponential formula.

Thanks,

kphenson
 
Posts: 11
Joined: Wed Mar 14, 2018 3:41 pm

Re: Creating a variable voltage pulse

by adafruit_support_bill on Thu Mar 15, 2018 7:34 pm

The Arduino ADCs are 10 bits and the default voltage reference is 5v, so with that you would get an effective resolution of only about 200 steps over your input voltage range. You could use an external voltage reference closer to your maximum input voltage to give you better resolution. Or you could go to a higher resolution ADC such as one of these:
https://learn.adafruit.com/adafruit-4-c ... s/overview

adafruit_support_bill
 
Posts: 66745
Joined: Sat Feb 07, 2009 10:11 am

Re: Creating a variable voltage pulse

by kphenson on Thu Mar 15, 2018 8:02 pm

Thanks again,

I am not sure I fully understand, but I will restate with more detail just in case I was confusing since I am a software engineer not an electrical engineer.

I have one system that needs to provide 2 low positive voltage analog signals in the 0 - 1.06VDC range to a a second system (device) in the form of 18us PW pulses at .5% duty cycle (277.778 Hz or 3.6ms PI) with the appropriate amplitude to match the signals.

The plan is to send the values as floats in UDP packets to an Arduino Uno with an ethernet board and a protoboard which will be connected to the 2nd system.
The current design sends these values as analog output signals (+5VDC PWM with appropriate duty cycles for the values on D5 and D6 980Hz) to the protoboard along with a +5VDC pulsed DC signal with 18us PW and 3.6ms PI which.

The protoboard will smooth the PWM signals into steady analog signals and use them to modify the DC pulses amplitude.

The problem is that nothing that has been tried so far works, mostly because the input voltages are so low and introduced voltage drops make the outputs not reflect the desires values. Even a .01V variance is significant.

That is why I was looking at your component.
Even if I could not use the Arduino to provide the appropriate 18us pulses, I thought that at least I could reduce some of the voltage loss and variance in the PWM smoothing.
I still do not have a solution for generating the 18us pulse with the appropriate amplitude based on the inputs.
In multisim, I have tried various options including timers, but again the low voltages cause problems.

If you have any suggestions, they would be appreciated.

Thanks,

kphenson
 
Posts: 11
Joined: Wed Mar 14, 2018 3:41 pm

Re: Creating a variable voltage pulse

by adafruit_support_bill on Fri Mar 16, 2018 6:46 am

I'm sorry, but I don't understand which parts of the above are the requirements and which are the proposed solution.

I have one system that needs to provide 2 low positive voltage analog signals in the 0 - 1.06VDC range to a a second system (device) in the form of 18us PW pulses at .5% duty cycle (277.778 Hz or 3.6ms PI) with the appropriate amplitude to match the signals.

This much sounds like a solvable problem.
The plan is to send the values as floats in UDP packets to an Arduino Uno with an ethernet board and a protoboard which will be connected to the 2nd system.

That sounds like part of a solution to a different problem. How did those analog values get turned into floats and why?

adafruit_support_bill
 
Posts: 66745
Joined: Sat Feb 07, 2009 10:11 am

Re: Creating a variable voltage pulse

by kphenson on Fri Mar 16, 2018 8:58 am

I will try to clarify (sorry if I am making it more confusing, but this is the situation that I am trying to solve),

Below is the current setup:

1. System A outputs 2 low positive voltage analog signals in the 0 - 1.06VDC range (I will call them output AO1 and AO2 from System A).

Below is the requirement:

1. System B (a device) requires 2 signals (BI1 and BI2) in the form of 18us PW pulses at .5% duty cycle (277.778 Hz or 3.6ms PI) with the appropriate amplitude to match the voltage values output by System A (AO1 and AO2).

The solution requires a "black box" between System A and System B:

The current proposed "black box" includes an Arduino Uno (System C) with an ethernet board connected to System A via UDP, a protoboard (System D) with custom circuitry connected to the Arduino and connected to System B.

The current proposed solution is as follows (what I was provided):

1. System A sends the voltage values of the 2 signals (AO1 and AO2) as floats in UDP packets to an Arduino (I will call them CI1 and CI2 to Arduino)
2. Arduino sends these values as analog output signals (+5VDC PWM with appropriate duty cycles for the values on D5 and D6 980Hz) (I will call them CO1 and CO2 from Arduino) to the protoboard (I will call them DI1 and DI2 to protoboard).
3. Arduino generates and sends a +5VDC pulsed DC signal with 18us PW and 3.6ms PI on D9 to the protoboard (I will call it CO3 from Arduino and DI3 to protoboard).
4. The protoboard smooths the (DI1 and DI2) PWM signals into steady analog signals and uses them to modify two DC pulse signal's (DI3) amplitude to produce 2 output signals (DO1 and DO2) and sends to System B (BI1 and BI2).

The problem is this current proposed solution or anything else that has been tried so far does not work.
The input voltages are so low and the introduced voltage drops of circuit components make the outputs not reflect the desires values.
Even a .01V variance is significant.

That is why I was looking at your component.

Even if I could not use the Arduino to provide the appropriate 18us pulses, I thought that at least I could reduce some of the voltage loss and variance in the PWM smoothing.
I still do not have a solution for generating the 18us pulse with the appropriate amplitude based on the inputs.
In multisim, I have tried various options including timers, but again the low voltages cause problems.

If you have any suggestions, they would be appreciated.

Thanks,

kphenson
 
Posts: 11
Joined: Wed Mar 14, 2018 3:41 pm

Re: Creating a variable voltage pulse

by adafruit_support_bill on Fri Mar 16, 2018 9:25 am

1. System A outputs 2 low positive voltage analog signals in the 0 - 1.06VDC range (I will call them output AO1 and AO2 from System A).

Below is the requirement:

1. System B (a device) requires 2 signals (BI1 and BI2) in the form of 18us PW pulses at .5% duty cycle (277.778 Hz or 3.6ms PI) with the appropriate amplitude to match the voltage values output by System A (AO1 and AO2).


Looking at just the requirements, I think the solution could be much simpler. With fewer 'moving parts' involved, there is less opportunity for things to go wrong.

Given that you need to produce output pulses of the same amplitude as the inputs, I think the most straightforward approach is to skip the ADC and DAC conversions and keep the voltages in the analog domain.

Most likely, you would want some sort of op-amp to buffer the signals from system A. That would feed the switching circuitry which would be controlled by a microcontroller. An Arduino or most other microcontrollers should be able to handle the timing.

adafruit_support_bill
 
Posts: 66745
Joined: Sat Feb 07, 2009 10:11 am

Re: Creating a variable voltage pulse

by kphenson on Fri Mar 16, 2018 1:58 pm

Thanks again for your input.

I am not sure that I understand your last comment or know how to implement it.
I cannot do anything with the outputs in System A, I can only provide the values via UDP or possibly as analog signals to something else.

I have tried various circuits (in multisim) to either create the DC pulse with the appropriate amplitude or chop the generated pulse to the appropriate value or to modify the DC pulse with the appropriate value but nothing seems to work. The components can't seem to deal with the low voltages or possibly I don't know enough to find or create the correct circuit or choose the right components.

Thanks anyway,

kphenson
 
Posts: 11
Joined: Wed Mar 14, 2018 3:41 pm

Re: Creating a variable voltage pulse

by adafruit_support_bill on Fri Mar 16, 2018 2:30 pm

I cannot do anything with the outputs in System A, I can only provide the values via UDP or possibly as analog signals to something else.

Turning an analog signal into UDP data involves an analog to digital conversion. And you would need to perform a digital to analog conversion on the other end.

I think it is simpler to keep them as analog signals. And use them as an input to a microcontroller-controlled switching circuit that simply buffers that input voltage and uses it to creates pulses of the same amplitude.

There are chips specifically designed for switching analog signals. I'll check with our analog expert to see if he has any recommendations.

adafruit_support_bill
 
Posts: 66745
Joined: Sat Feb 07, 2009 10:11 am

Re: Creating a variable voltage pulse

by kphenson on Fri Mar 16, 2018 2:43 pm

Thanks for taking the time.

While analog output from System A is a possibility, it creates a problem for testing in a lab environment since the real System A is a different machine that does a lot of other stuff (and is a big deal to change software on) and another major piece of equipment is actually in between System A and anything else for analog signals.

I would prefer it and it may be part of the best solution, but in a lab test environment System A can be a simple laptop with a simple test program running and outputting a range of values via UDP based on user controls.

Thanks,

kphenson
 
Posts: 11
Joined: Wed Mar 14, 2018 3:41 pm

Re: Creating a variable voltage pulse

by adafruit_support_mike on Fri Mar 16, 2018 6:35 pm

A few questions that will influence the design of a working system:

The pulse has four physical parameters that can change: amplitude, width, frequency, and phase. I know the amplitude needs to change, and think that the width and frequency will remain constant. If I’m wrong about that, please correct me.

- Do you need to control the phase of the pulse.. putting it another way, do you need to start or stop the pulse train with time accuracy narrower than +/-18ms? A free-running pulse generator is easy to design, build, and tune. Making the rising edge of the pulse occur at a specific time takes more parts.

- What is the input resistance of device B, which will receive the pulse? Putting that another way, how much can the current flowing into device B change while the pulse voltage must remain accurate to within less than 10mV?

- How quickly does the pulse voltage need to change? Is it reasonable to assume that the pulse amplitude needs to go from 0V to 1.06V or from 1.06V to 0V between two consecutive pulses? That isn’t difficult, but it does set some limits.

- Can the pulse voltage remain constant during the 18us interval, or does it need to be able to change during that time? As a related question, if new values arrive from device A during the 18us pulse, does the system need to be able to store that information until the pulse’s falling edge, or should it change the pulse voltage the instant a new value arrives?

- What output resolution do you need? Is it acceptable for the pulse voltage to rise and fall in 1mV steps, or do you need smaller steps?

- If you can only have one, is absolute accuracy more important than relative accuracy, or vice versa? Is it more important to be within +/-1mV of a specific voltage, or more important for pulse 2 to be CHANGE +/-1mV of pulse 1?

- What’s the temperature range where the system is expected to operate? Electronics are temperature sensitive, and that becomes more of an issue as the amount of acceptable variation gets smaller.

adafruit_support_mike
 
Posts: 50052
Joined: Thu Feb 11, 2010 2:51 pm

Re: Creating a variable voltage pulse

by kphenson on Sat Mar 17, 2018 7:56 am

Thank you very much for taking an interest.

“A few questions that will influence the design of a working system:”

I will try to provide as much information as I know with my limited amount of expertise.

“The pulse has four physical parameters that can change: amplitude, width, frequency, and phase. I know the amplitude needs to change, and think that the width and frequency will remain constant. If I’m wrong about that, please correct me.”


You are correct, the pulse width will remain the same (18us) and the frequency will remain the same (277.7778 Hz or 3.6ms interval).
The amplitude is what can change from 0V to approximately +1.06V.
I assume when the amplitude is 0V there is no actual PW.

“Do you need to control the phase of the pulse.. putting it another way, do you need to start or stop the pulse train with time accuracy narrower than +/-18ms? A free-running pulse generator is easy to design, build, and tune. Making the rising edge of the pulse occur at a specific time takes more parts.”


I am not sure I fully understand this question, but I will try to answer.
The only time that I would anticipate any change to when the pulse starts or stops is when power is applied or removed and when the amplitude goes to or from 0V.

“What is the input resistance of device B, which will receive the pulse? Putting that another way, how much can the current flowing into device B change while the pulse voltage must remain accurate to within less than 10mV?”


I don’t have an answer for this question.
I will try to research any documentation that I can find.

“How quickly does the pulse voltage need to change? Is it reasonable to assume that the pulse amplitude needs to go from 0V to 1.06V or from 1.06V to 0V between two consecutive pulses? That isn’t difficult, but it does set some limits.”


I hope that I can answer this.
I anticipate that the amplitude will not fluctuate rapidly or even slowly.
The only time it would change between two consecutive pulses is when the amplitude actually changes.
In general, the amplitude can be any value in the range, but will stay a particular value until it is changed as a result of an operator action within System A (I have no control over).

“Can the pulse voltage remain constant during the 18us interval, or does it need to be able to change during that time? As a related question, if new values arrive from device A during the 18us pulse, does the system need to be able to store that information until the pulse’s falling edge, or should it change the pulse voltage the instant a new value arrives?”


The pulse voltage can remain constant during the 18us interval.
It does not need to change within the pulse.
I would not anticipate that a change in amplitude would the pulse amplitude until the next pulse.

“What output resolution do you need? Is it acceptable for the pulse voltage to rise and fall in 1mV steps, or do you need smaller steps?”


I am not sure about this.
I was assuming something close to a true square wave, but I am not sure how Device (System B) is triggering on/off based on the pulse.

“If you can only have one, is absolute accuracy more important than relative accuracy, or vice versa? Is it more important to be within +/-1mV of a specific voltage, or more important for pulse 2 to be CHANGE +/-1mV of pulse 1?”


Absolute accuracy is more important.
The Device (System B) which I have no control over takes the signals and does its thing to figure out the voltage and uses those values in a computation that increases them exponentially and then displays the computed values on a LED number display.
So, in the worst case, a difference of 0.00098 can result in a displayed value difference of 0.01 which would be significant.
It is more important for the amplitude to be as close to the input value as possible.
I am sorry, but I not sure about the Pulse 2 and Pulse 1 references.
If it refers to the 2 separate input signals that each have to become the amplitude on a DC pulse, it would not apply as they are separate/independent signals each require their on pulse.
If it refers to pulse 1 as the input voltage and pulse 2 being the output pulse with the amplitude of the input voltage, the voltages should be as close as possible.

“What’s the temperature range where the system is expected to operate? Electronics are temperature sensitive, and that becomes more of an issue as the amount of acceptable variation gets smaller.”


Unfortunately, I do not know the answer to this.
I am not sure if any documentation for System B would tell me, but I will look when I get a chance.
I can tell you that there is not a lot of circuitry in System B, it operates on 5VDC, and its two 3-character LED displays.


Thanks,
P.S. I did not know how to properly quote your text.
Last edited by adafruit_support_bill on Sat Mar 17, 2018 8:10 am, edited 1 time in total.
Reason: fixed quotes

kphenson
 
Posts: 11
Joined: Wed Mar 14, 2018 3:41 pm

Re: Creating a variable voltage pulse

by adafruit_support_bill on Sat Mar 17, 2018 8:20 am

“What output resolution do you need? Is it acceptable for the pulse voltage to rise and fall in 1mV steps, or do you need smaller steps?”

I am not sure about this.
I was assuming something close to a true square wave, but I am not sure how Device (System B) is triggering on/off based on the pulse.


I believe what Mike is asking here is not the shape of the wave, but the resolution of the output voltage. If you will be converting to digital and back to analog, the resolution will be limited to the resolution of the ADCs and DACs - whichever is lower. A 10 bit ADC with a range of 0 to 1.024 volts will give you 1024 increments of measurement for a resolution of 1 millivolt.

So, in the worst case, a difference of 0.00098 can result in a displayed value difference of 0.01 which would be significant.

That seems to imply that you are interested in changes of less than 1mv, so you would probably need higher resolution ADCs and DACs.

adafruit_support_bill
 
Posts: 66745
Joined: Sat Feb 07, 2009 10:11 am

Re: Creating a variable voltage pulse

by kphenson on Sat Mar 17, 2018 8:31 am

Thanks,

I believe that 1mV accuracy might be sufficient, it would certainly be better than anything we have been able to come up with so far.

At some of the lower displayed values, the .01 difference results from a .1V difference.
It is at the higher displayed values that a .01 difference results from a smaller V difference.

Thanks,

kphenson
 
Posts: 11
Joined: Wed Mar 14, 2018 3:41 pm

Please be positive and constructive with your questions and comments.