Encode two analogue parameters into one digital channel?

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am looking at building a modular half bridge driver for various projects, and i would like to galvanically isolate that bridge from the controller, which is no problem for the digital control signals (gate firing signals) of course, but harder for the analogue ones.   It struck me that i could use something like a Tiny to read the supply voltage and the device temperature (from an NTC etc) and then encode those values into a single digital (square wave) data stream where the frequency is dependent on the voltage measured and the duty cycle proportional to the temperature.  That way, i'd get two channels for the price of one, so to speak!

 

 Neither of those signals needs to be measured at high speeds, as both change relatively slowly, and they could both be decoded by a single pin (ICP) on the controlling micro after coming across an optocoupler for isolation.  Neither need to be very high precision or resolution either.  The supply voltage is not that critical (it is just used to prechargeing control and to modify the output pulse width as the DC link slowly reduces) and the temp sensor is really only used for "oh c**p somethings about to catch on fire" so again, no great precision requirements.

 

 

Is this a sensible approach?  There will be some trade offs between duty cycle resolution and wave form frequency, but as the Tiny will just be doing this task only, it can run a tight software loop and not rely on any particular hardware timers etc.  (although i may be better to use the PWM hardware for jitter reasons)

 

 

 

(i could also just put an isolated RS485 bus between modules i guess, but there is some justification for using a simple V to F convertor made out of a cheap micro)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd just use any suitable ADC and any sensible digital isolator. This may not be cheaper, but it's certainly easier and might save you a lot of time.

 

But if you want to stick with your solution, I think it will work. The main problem might be the reconstruction on the receiving end.

I'd definitely use the receiver's dedicated hardware for that and run them at a higher than necessary frequency and resolution so you can cut off the uncertain bits.

"Some people die at 25 and aren't buried until 75." -Benjamin Franklin

 

What is life's greatest illusion?"  "Innocence, my brother." -Skyrim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Will it work, yes.

But it sure seems like a lot of work.

 

One pin for a digital signal is one pin regardless of how you encode it.

 

Why not simply use the Tiny to read your analog and digital data, put the data in a "packet", and send it out the USART to an opto-coupler.

On the other side you feed the signal back into a USART and have your data.

 

Fast, (depending upon your baud rate), easy, and accurate.

You can include a CheckSum in the packet to validate it.

The hardware modules do all the work, especially the "decoding".

 

The USART Receiver can trigger an interrupt whenever data is available to stuff it in a buffer.

So truly minimal processor overhead is required.

 

The data packet is a simple format that allows you to know which bytes are which data, e.g.:

< D1 D2 D3 D4 CS

 

< = Start of packet

Dx = Data Bytes

CS = Check Sum, = Sum of the data bytes

 

D1 & D2 = voltage

D3 & D4 = Temp,

etc.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bare USART is a non starter because i need to protect for multiple bridges, so it would have to be RS485 or similar to allow multiple nodes on one Serial Bus.

 

I also need to decide what to do with the current sensor, as that does require a highish band width (~5kHz) so is lot harder to serialise and then decode, especially as to do FOC, all the current sensors (2 of) need to be 'read' simultaneously.....  (probably use an isolated by architecure sensor, such as a hall effect type sensor)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

max_torque_2008 wrote:
It struck me that i could use something like a Tiny to read the supply voltage and the device temperature (from an NTC etc) and then encode those values into a single digital (square wave) data stream where the frequency is dependent on the voltage measured and the duty cycle proportional to the temperature.  That way, i'd get two channels for the price of one, so to speak!
A no software solution is two voltage-to-PWM converters; a tinyAVR would be a better fit for hardware.

Linear Technology

LTC6992 - TimerBlox: Voltage-Controlled Pulse Width Modulator (PWM)

http://www.linear.com/product/LTC6992-1

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Where is the "high speed" current monitor traveling to?  If it is going to more circuitry over the moat, you might consider just using analog isolation scheme.  

 

This simple scheme can handle a few hundred KHz & has good linearity:

https://www.digikey.com/en/articles/techzone/2012/dec/linear-optical-isolation-for-safe-sensor-operation

 

note the famous %%% 555 timer can be used as a poor man's PWM generator too, albeit without the performance of the Linear Tech device

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. May 2, 2017 - 12:51 AM