Adjusting squatre wave pulse time delay with a pot - Page 1
Forum section: electronics / beginners

author: Parashurama
author_rank: Newbie
timestamp: September 17, 2014, 09:45:37 am
content: 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

author: Simon
author_rank: Unknown
timestamp: September 17, 2014, 10:38:17 am
content: 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

author: Psi
author_rank: Super Contributor
timestamp: September 17, 2014, 11:36:23 am
content: stm32 is a good level up from arduino, but dont expect any hand-holding like you get with arduinoThe stm32 timers are more powerful than your standard arduino AVR timers, and even the cheap stm32F0 runs at 48mhz vs arduino's 16mhzYou can get a stm32f0 dev board for like $15

author: Simon
author_rank: Unknown
timestamp: September 17, 2014, 11:42:51 am
content: same as saying get an arduino due

author: Parashurama
author_rank: Newbie
timestamp: September 17, 2014, 12:30:02 pm
content: 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!

author: Simon
author_rank: Unknown
timestamp: September 17, 2014, 12:32:59 pm
content: They are all MCU's but based on different processor cores.

author: fcb
author_rank: Super Contributor
timestamp: September 17, 2014, 12:52:30 pm
content: 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.

author: max_torque
author_rank: Super Contributor
timestamp: September 17, 2014, 04:22:23 pm
content: 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!)

author: Parashurama
author_rank: Newbie
timestamp: September 17, 2014, 07:16:11 pm
content: 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