Sunday, August 27, 2006

 

Fishing stories...

Friday, I had hopes of grand amounts of progress. I had got the 16F877A rolling with serial and got a 754410 hooked up with each channel being served by a separate PWM signal. Tentative tests showed me that I could run the GM4 motor and control its rotational direction. All that was needed was to "fish around" for PWM frequencies that the GM4 was happy with. Simple huh?

NOT!

It's Sunday night and NOOOOO fish. :-(

I did a LOT of fishing around. It appears that the 754410 is NOT a happy camper if you feed it much more than a 1 KHz signal. Ditto the L298N. You can get them to respond up to just under 4 KHz, but they're not happy about it. Not happy means you have a reduced range of speed control if any.

The problem is that timer 2, which generates the clock signal for the two PWM channels, only allows you a divisor of 1, 4 and 16 for prescaling. What that means is that when you slap a 20 MHz clock crystal on the 16F877A the nice little 977 Hz PWM signal that was running your GM4 and Frankenmotor jumps 5-fold to just under 5 KHz. You can fiddle that down to about 1.22 KHz, but your H-bridge chip efficiency and functionality goes south on you.

I went back to the Microchip PIC literature on PWM and those guys recommend that you try to run your PWM frequencies at over 20 KHz so that people won't hear the hum. That didn't square with what I was observing with the H-bridge chips that I was using so I did a literature search to see what I could find out about the frequency response of the H-bridge chips. I found several off-hand references that the 754410 wasn't good for much above 4 KHz, which squared with what I had observed.

I continued looking and discovered one H-bridge chip that was certified to work at over 1 MHz, Intersil HIP4081A. The data sheet had this little jewel in it...

For example, the HIP4081A can drive medium voltage brush motors, and two HIP4081As can be used to drive high performance stepper motors, since the short minimum “on-time” can provide fine micro-stepping capability.

Short propagation delays of approximately 55ns maximizes control loop crossover frequencies and dead-times which can be adjusted to near zero to minimize distortion, resulting in rapid, precise control of the driven load.

Interestingly, these chips work for 2.5 amps. I wonder if they had the NEMA 17's in mind. These bad boys cost $5.50/unit at mouser.

Anyhow, I'm hoping that the fine folks at Microchip know lots of stuff that I don't so I made out a nice trouble ticket on the issue and turned it in to them. Who knows, maybe this apparent frequency response problem is just a misunderstanding of some trivial detail and I'll wake up to an email from them with a nice message that starts out "Hey dummy! You forgot..."

I have some hope that that will be the case. I have two modes that I can get 977 Hz, Mode 2 and Mode 7. Mode 2 gets you 10 bits of speed control resolution while Mode 7 (which I am currently using) gets you 8. I redid the Frankenmotor control board to do Mode 2 and it didn't want to work right, so I'm hoping that there is something besides a H-bridge frequency response issue involved.

If that doesn't happen, though, I have a couple of options. The simplist and least happy option is to just put a 4 MHz clock crystal on the 16F877A and forget the problem. That guts any extra performance hopes I had with the 16F877A and leaves me with basically a big memory 16F628A. I'm not real happy about that.

The other approach is to simply use two 16F628A's to drive the PWM-driven motor speed channels on the 754410 and close couple them with the 16F877A which will keep track of the pulse counts and tell the 16F628A's what to do to the motors.

Anyway, it was a fairly frustrating weekend.

Comments:
Well that sucks! I'm trying to remember where I saw a little circuit that can halve frequencies... Some can cut frequencies by 2, 4, ect.

I think they are called frequency dividers. I know this is less than ideal, just an idea. :)
 
Is the circuit you are using similar to that on http://me118.stanford.edu/pictures/Win02Projects/BirthOfByter/pdf/SN754410_Module.pdf ?

Are you planning on driving N-Channel Power MOSFETs (the recommended uses for the FET driver chips appear to use them, rather than driving the motor directly)?

--

My own plans include stripboard layouts using the SN754410 for dual 1A H-Bridges, one 2A H-Bridge, or a dual chip one 4A H-Bridge (2-6 cuts + 1-6 jumpers) that are based around the circuit design URL above -- except, I won't add the schmitt inverter, or the voltage regulator (I know you said it would be a mess, but it looks really simple and easy. I haven't got the chips yet though, so I'll see when I actually have to make them.)

Instead, I'll provide separate 12V (or whatever the motors prefer), and 5V lines to the daughterboard(s).

I may add a schmitt NAND chip to yield a table as:

LT=L,RT=L => Active brake
LT=L,RT=H => Power Right
LT=H,RT=L => Power Left
LT=H,RT=H => Passive brake (coast)

This depends on how fast I can process the data so I can simulate pulse modulation in software. The advantage here is it simplifies the software control, and increases the number of motors that can be driven by a single microcontroller chip (or, you can use a microcontroller chip with fewer pins to drive the same number of motors -- same thing.)
 
Is the circuit you are using similar to that on...

Not all that similar. I'm using the layout that you'll see around reprap in the wiki. It doesn't attempt to combine directional signals into one line and it doesn't use all those 4935 diodes. Mind, throwing those in isn't a half-bad idea. That's certainly what we do with the L298N.

Are you planning on driving N-Channel Power MOSFETs (the recommended uses for the FET driver chips appear to use them, rather than driving the motor directly)?

Nope, the GM4 has a stall amperage of .68 amps. One channel of the 754410 can handle 1.2 and has an overheat switchout as well.
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]