14M HPWM dead band?

boriz

Senior Member
I’m scoping the A and B HPWM outputs on a 14M (Half mode). I can’t see any effect of various different dead band delay settings. EG:

hpwm 1,0,10,128,256
hpwm 1,0,50,128,256
hpwm 1,0,120,128,256

… all produce identical complementary wave forms with no discernable timing differences.

If I understand the manual correctly, this setting is supposed to allow a delay between the falling edge of one wave and the rising edge of it’s complement, so that the two transistors driven by these waves can’t both be on at the same moment. A useful setting. But I’m not seeing any difference at all. Did I misunderstand the manual?
 

BCJKiwi

Senior Member
I agree with your interpretation of Manual2

However there is the obligatory rider:-
"The command delay value (0-127) gives a delay equivalent to (value x oscillator speed (e.g. 4MHz).
The value depends on the switch on/off characteristics of the FET drivers used."

Maybe the issue relates to the FETs (capacitance, switching time etc?).

Did you manage to find the hwpm motor driver data sheet?
"See the hpwm motor driver datasheet for more details."

Haven't seen one of these yet.
 

BeanieBots

Moderator
How are you measuring it? Do you have a "window" facility on your scope?
The difference will be EXTREMELY small compared to the period. Comparable to the Rise/Fall times of a FET switching.
 

boriz

Senior Member
@BCJKiwi
“Did you manage to find the hwpm motor driver data sheet?”
Nope. I eventually decided that it must mean an external FET driver IC.

@BB
Do I know how to use a scope?
Well It’s an old one, only 20MHz, but it’s more than capable of discerning the “extremely small” changes you refer too. How small can they be on a 4MHz chip?

I compared the waveforms visually and then adjusted the vertical position of the B channel so the verticals overlapped. I tried the subtract facility which clearly showed the tiny overlap that might indeed cause fast enough transistors to briefly both be on at the same time. I even used the X-Y facility (Output A driving X deflection, output B driving the Y deflection). All rock solid while the code shown below was running the whole time.

Code:
do
	for b0=0 to 127
		hpwm 1,0,b0,64,128
		pause 5
	next b0
loop
Maybe this delay was part the original PICAXE spec, but no one ever found a need to finish the coding (or the documentation). Maybe my 14M has ‘issues’. Maybe I’m completely missing something obvious.
 

BeanieBots

Moderator
I wasn't trying to infer that you didn't know how to use a 'scope, just that if you were looking at both traces with a full cycle on screen, the difference would be about the width of the rise time. Hence, you would require a feature such as "windowing" to actually see it.

"Normally", these differences are sub 1uS. You raise a good point though, "How small can they be on a 4MHz chip?" .25uS ???
 

boriz

Senior Member
"the difference would be about the width of the rise time"
How do you know? Have you managed to scope them?
 

BeanieBots

Moderator
"the difference would be about the width of the rise time"
How do you know? Have you managed to scope them?
I "know" because I've done a lot of work with that type of drive system and hence I "know" typical values.
I've never looked at the signals from PICAXE though.
The naff 'scope I have here has neither windowing nor delayed trigger, so I wouldn't be able to measure it anyway.
 

hippy

Technical Support
Staff member
According to the 16F684 datasheet I have ...

11.4.6 : "In Half-Bridge mode, a digitally programmable dead-band delay is available to avoid shoot-through current from destroying the bridge power switches. The delay occurs at the signal transition from the non-active state to the active state ... The lower seven bits of the associated PWM1CON register sets the delay period in terms of microcontroller instruction cycles (TCY or 4 TOSC)"

So the dead-band will range from 0us to 127us at 4MHz.

To check if HPWM is setting the dead-band hardware, peeking PWM1CON ($16) would be best bet.

Code:
For b0 =  0 To $7F
  Hpwm 1,0,b0,128,256
  Peek $16,b1 : b1 = b1 & $7F
  If b0 <> b1 Then : SerTxd("Failed",#b0,#b1) : End If
Next
SerTxd( "Finished" )
 
Last edited:

Technical

Technical Support
Staff member
We have checked this and it is indeed a bug on the 14M, the correct register ($16) is not being correctly set with the 'setting' value. We apologise for the error and will correct it in the next software compiler release.
To workaround at present simply poke $16 with the value desired before calling the hpwm command.
 

boriz

Senior Member
Woot!

Do I win a prize?

If I can choose one, I choose 'Auto-load last used program' as default in the editor for the next update. Aww go on. It won't hurt.
 

hippy

Technical Support
Staff member
Woot! Do I win a prize?
Yes; you have won a 14M which ignores dead-band settings. These will become increasingly rarer and hence more valuable as time goes on.

Not only that, in later years, when your grandchildren sit on your knee and ask, "is it true there used to be a 14M which didn't do dead-band ?", you'll be able to say, not only, "yes", but produce it and show it to collective, "oooooh" sounds.

It is traditional and expected that "old folk" in later life have only one story to tell, which must be told incessantly and at every opportunity. This could be yours.

:)
 

boriz

Senior Member
Grandchildren. LOL. (See Sig, then see: http://www.vhemt.org/)

Anyway, as a Sci-Fi fan. I’d like to think the conversation would more likely go like…

“Is it true that computers used to use chips? and keyboards? and wires? and fans? and circuit boards? and were stupid?”

@Tech
WHY DIDN'T YOU TELL ME THAT TWO DAYS AGO SO I COULD HAVE MADE MY PURCHASE FROM YOU GUYS?
 

Technical

Technical Support
Staff member
Actually with the next software release all 14M will do dead-band, so the actual chip won't be so rare!
Paypal is being setup, not yet setup, it will be another few days before the integration works.
 

boriz

Senior Member
None taken friend.

I sometime wonder if people think my sig is offensive. I’ll put the URL in the sig so people can get the full intention.

Did you try running that Peek $16 test on any other AXEs?
 

Jeremy Leach

Senior Member
(I've always thought your sig was a tongue-in-cheek insult, said with dry humour ... which I've found funny and actually used on other people I know !! You've spoilt it now :) )
 

boriz

Senior Member
The VHEMT is all a bit tongue in cheek. But it does have some serious points with which I’m in complete agreement, and I try to support them (so far as I can) with my sig. Their motto is “My we live long and die out”.
 
Top