Author Topic: Adjusting squatre wave pulse time delay with a pot  (Read 2711 times)

0 Members and 1 Guest are viewing this topic.

Offline ParashuramaTopic starter

  • Newbie
  • Posts: 3
Adjusting squatre wave pulse time delay with a pot
« on: September 17, 2014, 09:45:37 am »
Hi.

I've got square wave signal that I want to delay by 200ns - 2us and I want this to be adjustable with a pot, but I'm am uncertain how to achieve this. I've tried to do it in SW with an Arduino uno, and map a 0-5V ANI to a delay variable, but found this to be very unreliable and also the arduino was not able to do short enough delays.

The signal is going to be used to drive an h-bridge. And the time delay is going to be a block so that when one transistor pair turns off it will delay before turning on the second pair.

Does anyone have ideas about how I could solve this?

Parashurama
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Adjusting squatre wave pulse time delay with a pot
« Reply #1 on: September 17, 2014, 10:38:17 am »
you may want to use a dedicated driver chip for H bridges that has this built in, at 16MHz you need 62.5ns - 250ns per instruction to execute so your getting pretty tight there and that is on pure micro without looking at any arduino overheads.

Many PWM modes on mcu's can have a dual output with a delay especially for what you want but the arduino IDE does not offer accessz to this level of functionality.

So basically go get a chip that will do the job or ditch arduino and use a micro that supports the function you want and program in C
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9930
  • Country: nz
Re: Adjusting squatre wave pulse time delay with a pot
« Reply #2 on: September 17, 2014, 11:36:23 am »
stm32 is a good level up from arduino, but dont expect any hand-holding like you get with arduino :P

The stm32 timers are more powerful than your standard arduino AVR timers, and even the cheap stm32F0 runs at 48mhz vs arduino's 16mhz

You can get a stm32f0 dev board for like $15
« Last Edit: September 17, 2014, 11:38:44 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Adjusting squatre wave pulse time delay with a pot
« Reply #3 on: September 17, 2014, 11:42:51 am »
same as saying get an arduino due
 

Offline ParashuramaTopic starter

  • Newbie
  • Posts: 3
Re: Adjusting squatre wave pulse time delay with a pot
« Reply #4 on: September 17, 2014, 12:30:02 pm »
I'll have a look at the stm32f0 and the Arduino due. A MCU might be a good idea as I might need more calculation later in my project.

Thanks for quick answers!
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Adjusting squatre wave pulse time delay with a pot
« Reply #5 on: September 17, 2014, 12:32:59 pm »
They are all MCU's but based on different processor cores.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Adjusting squatre wave pulse time delay with a pot
« Reply #6 on: September 17, 2014, 12:52:30 pm »
If you don't want to do it in the micro (or can't do it in the micro), why not build an analog delay.  This could be as simple as an R-C, perhaps some logic if you want to match ON/OFF delays.  Schmitt trigger based inverters could help add to the predictability.

Also, perhaps have a look at some of the H-bridge or half-bridge drivers available, alot of them have 'shoot-thru' protection (i.e. delays) built in.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1275
  • Country: gb
    • bitdynamics
Re: Adjusting squatre wave pulse time delay with a pot
« Reply #7 on: September 17, 2014, 04:22:23 pm »
My vote is just to start with a micro that has "dead time" compensation in software, like the STM32F1 series.   This is because you are unlikely to be able to determine exactly what deadtime you actually need for your particular hardware layout until you have it running under load.  With software dead time, it's a quick and easy test to sweep dead time and look at shoot through currents etc to find the optimum value, and of course, being in software, having a "dynamic" dead time is then very easy.   If you "bake" everything into hardware, your options are very much more limited

(this is speaking as someone who's used the STM32F103 to successfully control a 400Arms 3 phase inverter!)
 

Offline ParashuramaTopic starter

  • Newbie
  • Posts: 3
Re: Adjusting squatre wave pulse time delay with a pot
« Reply #8 on: September 17, 2014, 07:16:11 pm »
As I'm not very experienced with MCU programming in C, I think Ill try out the Arduino Due. Its a bit more expencive but the "hand-holding" it gives to me as a beginner programmer makes it worth it.

Guess I have to send an order tomorrow  :D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf