CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Electronics > General Electronics Discussion


General Electronics Discussion Discuss basic electronics, power supplies and anything else electronic related here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 07-25-2004, 11:41 AM
 
Join Date: Jan 2004
Location: United States
Posts: 231
owhite is on a distinguished road
Oscillator With Programmable Duty Cycle

I am working on an application requiring that I digitally control the duty cycle of a fixed frequency oscillator. I did some research on the 'net and found a couple circuits to support this system. I spent a lot time understanding the circuit and decided to document how it worked here.

Oscillator

The CD4541BC programmable timer has a 16 stage binary counter, an integrated oscillator that uses an external capacitor and two resistors. The timer is also programmable by setting the digital inputs to divide the oscillator frequency by to 2^8, 2^10, 2^13, 2^16. The CD4541BC ocscillator frequency can be set by an external RC network that's by the following formula freq = 1 / (2.3 * Rtc * Ctc) where Rs = ~ 2Rtc and Rs >= 10,000 ohms. (Although I've had reasonable results with going down to 1k.)





Obviously there is a lot of flexibility to control the frequency of the oscillator. For my application I just needed a fixed frequency which I set using switch S1. Users that want to control the frequency digitally you could control the frequency by putting TTL control lines on ports A and B.




4-Bit Counter
The next portion of the circuit involves a 74191 4-bit binary counter. The 74191 recieves a clock input and triggers each of the four outputs to produce a series of 4-bit words. The 74191 is called an up/down counter which means it is reversable and count up or down after each clock cycle. When the counter is counting up it produces these outputs on the rising edge of each clock cycle.




Notice that the counter rolls over from 1111 to 0000 at the end of the series. Wiring for the 74191 is really simple. Pin 14 recieves the clock input from the timer and pins 1, 4, 5, 8, 9, 10, 15 are tied to ground. "N.C." stands for not connected. Pin 16 is tied to Vcc.



Stay tuned for the next post...

owen
Reply With Quote

  #2   Ban this user!
Old 07-25-2004, 11:42 AM
 
Join Date: Jan 2004
Location: United States
Posts: 231
owhite is on a distinguished road

Magnitude Comparator 7485

Suppose we had a chip that could read the signals at the outputs of the 74191 and tell when it was at a certain clock cycle. This is accomplished with a 7485 4-bit magnitude comparator. This magnitude comparator performs comparisons of two 4 bit words. The two 4-bit words are called A and B here. <B>Note:</B> The documentation for the 74191 is confusing because it calls the complete word "A", which has four bits (A0, A1, A2, A3) , however; in the 74191 each <i>bit</i> of the word was called A, B, C and D. The comparator has outputs which register when word A&lt;B, A=B, or when A&gt;B on pins 7, 6 and 5, respectively.

Complete circuit

What does this allow us to do? Well, if we wanted to count the pulses that are coming from the timer, we could set a word on the B input of the comparator, wait for the clock to cycle the counter up to that word, and watch the output of pins 6 and 7 of the comparator. The wiring for this circuit is as follows:



The simple pulse generator allows you to program its duty cycle.

The user can set the inputs to B0, B1, B2 and B3 as digital inputs to the 7485 magnitude comparator IC3. The timer, IC1, increments the 74193 4-bit counter, IC2. When the output of the counter is equal to or greater than your duty-cycle code, IC4 an OR gate, goes high until the counter, IC2, overflows. The input code to pins B0, B1, B2 and B4 determine duty cycle of the overall circuit. Suppose the desired duty cycle was 50%. The total number of clock cycles you can measure is 16, and half of those cycles is 8. The input code corresponding to clock cycle 8 is B0=1, B1=1, B2=1 and B3=0. At these settings the output's duty cycle will be 50%. For an input at clock cycle 4, the duty cycle is 25%.

Here is a picture of the outputs of timer and PWM at 50% duty cycle:



Note that the output frequency is CLK divided by 16.

owen
Reply With Quote

  #3   Ban this user!
Old 07-26-2004, 08:02 PM
pminmo's Avatar  
Join Date: Jun 2003
Location: St. Peters, Mo USA
Age: 59
Posts: 3,325
pminmo is on a distinguished road

What kind of resolution do you need, and at what frequency? If 256 parts (8 bits) is good, clock a d flip flop on equal (d held high) and reset it on counter overflow.
Phil
Reply With Quote

  #4   Ban this user!
Old 07-26-2004, 08:05 PM
 
Join Date: Jan 2004
Location: United States
Posts: 231
owhite is on a distinguished road

I could try that but any idea why it doesnt work? Why will the flip flop work any better?

o
Reply With Quote

  #5   Ban this user!
Old 07-26-2004, 10:22 PM
pminmo's Avatar  
Join Date: Jun 2003
Location: St. Peters, Mo USA
Age: 59
Posts: 3,325
pminmo is on a distinguished road

Prop delays through the gates some times glitch outputs. Comparators used to be known for that. In my day(74LS logic), you almost always did a sync design, rather than async.

Phil
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 07-27-2004, 08:11 AM
 
Join Date: Jan 2004
Location: United States
Posts: 231
owhite is on a distinguished road

Phil,

I found this circuit on the net. is this what you had in mind by using a flip flop on equal?

Owen
Attached Thumbnails
Click image for larger version

Name:	programable_duty_cycle.gif‎
Views:	115
Size:	9.4 KB
ID:	2930  
Reply With Quote

  #7   Ban this user!
Old 07-27-2004, 03:43 PM
pminmo's Avatar  
Join Date: Jun 2003
Location: St. Peters, Mo USA
Age: 59
Posts: 3,325
pminmo is on a distinguished road

No, not exactly, but along the correct lines. It sync's and eliminates the glitch's that the 85's were known so bad for.

Phil
Reply With Quote

  #8  
Old 07-27-2004, 04:20 PM
*Registered*
 
Join Date: Apr 2004
Location: Norway
Posts: 678
ESjaavik is on a distinguished road

If you don't mind a little programming, you can use this:
http://www.avrfreaks.net/Devices/dev...ion=1&devid=44
In addition you need one capacitor as you do for all digital circuits, and one potmeter to adjust your duty cycle in 1024 steps.
You don't even need a circuit board, just solder it to your pot.
It costs around $5.- in single quantity.
On the same site you can find appnotes showing how to use the PWM and the ADC. You just need to "glue" the two together.
Reply With Quote

  #9   Ban this user!
Old 07-30-2004, 06:33 AM
 
Join Date: Jul 2004
Posts: 28
Romos V. is on a distinguished road

If you want frequencies up to 32Khz is much easier to design a PWM with a PIC microcontroller.
About your optics... if you want to cut metal, use feedback isolator. If not, you will destroy the optics in laser cavity from the reflected beam.

I bought the same laser model (G-100) last February and I finish my 2m x 2m CNC laser last May.
I can cut steel and s/s up to 2mm.

Romos

Last edited by Romos V.; 07-30-2004 at 07:41 AM.
Reply With Quote

  #10   Ban this user!
Old 07-30-2004, 07:41 AM
 
Join Date: Jan 2004
Location: United States
Posts: 231
owhite is on a distinguished road

Romos,

hey, thanks for the info on the laser. I'm going to move this over to another thread and ask you a question there.

owen
Reply With Quote

Sponsored Links
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cycle Start button kaleem1 Mach Software (ArtSoft software) 7 12-24-2005 02:05 PM
Programmable CNC I/O expansion psevin Product Announcements & Manufacturer News 0 03-04-2004 11:49 AM
Programmable CNC I/O expansion psevin Product Announcements & Manufacturer News 0 03-03-2004 12:13 PM
Post configuring (black art?) John F OneCNC 12 07-18-2003 01:26 PM




All times are GMT -5. The time now is 11:03 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361