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! > OpenSource CNC Design Center > Open Source Controller Boards


Open Source Controller Boards Discussion for Open Source CNC type Controller Boards and other related items. (for personal use only)


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 01-18-2005, 02:51 AM
 
Join Date: Jan 2005
Location: Toronto, Canada
Posts: 909
H500 is on a distinguished road
Thumbs up Avr Unipolar Chopper Drive

I wired together a simple chopper driver as a proof of concept. It is essentially an at90s2313 chip with 4 mosfets, a lm324 op amp comparator and and some resistors to measure the coil current. The avr have an onchip comparator, but I needed one for each pair of coils. The C code took about 1/2 a day to write, but I spent the weekend debugging the system. The biggest problem was that it would not step smoothly. It turned out the problem was due entirely to noise getting into the step input pin.

I was impressed at how well it worked. On my mill, using Mach2, I was only able to get about 8 inch per minute with a 12v resistor limited powersupply. With this setup and a 36v supply, it reached 42 ipm!

Part selection was based on what I had on hand. The mosfets were irf530's, rated at 14amp & 100volts. My motors are rated at 1.4 amp/phase, but I'm driving it with about 2 amps, 1 phase at a time. The mosfets were only slight warm with no heatsink. The only reason I put them on a large heatsink is so they won't burn out during debugging.

Although in theory I could easily do microstepping simply by adding a resistor ladder d/a, I don't seen any advantage at this point. My motors are a bit small for a mill, so my main goal is to maximize the torque.

The circuit is simpler than the lmd18245 designs I looked at. I estimate the total cost of parts is about $10 CAD (not including the power supply). If anyone is interested in doing a PCB or would like to collaborate, I can make the design available. Undoubtedly it design could be improved. I will probably opto couple the PC connections so that I could take measurements with my oscilloscope.
Attached Images
File Type: jpg P1170017.JPG‎ (128.7 KB, 474 views)
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 01-18-2005, 03:37 AM
Garfield2's Avatar  
Join Date: Sep 2004
Location: Australia
Posts: 232
Garfield2 is on a distinguished road

Nice work! Looks good. I could easily knock together a board design if you wish.

Originally Posted by H500
The circuit is simpler than the lmd18245 designs I looked at.
One thing you haven't taken into account is that you're comparing a unipolar driver to a bipolar driver.

To be fair you'd need two times the amount of FETs combined in h-bridges with back-emf suppressing diodes, current sense resistors or a high-side current sense amplifier, 2 x 4 bit DACs, plus your two comparators and RC oscillators to feed the PWM. The LMD18245 attracts it's price tag because it does all this and more (thermal protection, almost lossless coil current detection) for you.

Comparing apples and oranges really..

Alan.
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 01-18-2005, 01:21 PM
 
Join Date: May 2004
Location: United States
Posts: 174
tekno is on a distinguished road

If you post a schematic I’ll see if I can make a single sided board for you.
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 01-18-2005, 03:26 PM
 
Join Date: Jan 2005
Location: Toronto, Canada
Posts: 909
H500 is on a distinguished road

Hi Alan

I didn't mean to imply that this was the same as the lmd18245 boards. Those are very good systems and are ideal for someone looking for a proven design. I only made the comparison because I actually have a set of lmd's on hand and was previously trying to decide which was easiest to throw together.

I think this approach is very appealing for those on a very limited budget and for those who like to do things just to learn. All the parts are easy to get and nothing is particularly expensive. Programming the MCU is a non issue since the programmer just 3 zeners and 3 resistors connected to a com port.

It would be great if you are interested in looking at the circuit also. It is very preliminary and can definately be refined.

Possible improvements might be:

-use a attiny2313 or mega8 instead. The at90s2313 is only good for 10Mhz and is being taxed to the limits. (although code has not been optimized yet)
-connect the unused op amp to a diodes to sense temperature, for thermal protection.
-opto coupling the step/dir signals.
-micro stepping.
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 01-18-2005, 04:08 PM
 
Join Date: Jan 2005
Location: Toronto, Canada
Posts: 909
H500 is on a distinguished road

Hi Tekno

It would be great if you can look into designing a board, ideally with 0805 size surface mount resistors. They are actually very easy to work with. It will reduce the amount of drilling req'd allow for a smaller board.

I will try to do up a schematic as soon as possible. The circuit was very simple so I did not work from a schematic.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 01-18-2005, 04: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

H500,
I have attached a schematic of the board direction I was headed. I had the same thoughts, but only put in place for sense resistor(s) so I could piggy back a comparitor ir I wanted to go to the next level of complexity and chop. If you want to email me one or mark this one up, I'd be glad to put it into Eagle.

Phil
Attached Files
File Type: pdf 2313stpr.pdf‎ (80.8 KB, 660 views)
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 01-18-2005, 10:51 PM
 
Join Date: Jan 2005
Location: Toronto, Canada
Posts: 909
H500 is on a distinguished road

Hi Phil

I've attached a photo of a sketch, so I hope it's legible.
My computer is not set up for CAD at the moment.

The mosfets on my board are connected to the MSB of portb because initially I thought I would need the built in comparator. The code can easily accommodate your connection by shifting the drive byte right 4 bits.

I've included pull down resistors on the gates so that when the mcu is in reset, the pins won't float and cause the mosfets to potentially burn up.

I'm only driving one coil at a time. If I'm not mistaken, with heat as the limiting factor, increasing the current on a single coil is more efficient than driving 2 phases. So, if you're not doing microstepping, it might be possible to use a single current sensing resistor with the built in comparator and not have to graft on an external op amp. I haven't tried it, so I don't know if the switching transients would cause false triggering.

My mcu is running at 10 Mhz with an external crystal. My code isn't optimized yet, so the 8 Mhz rc oscillator might take too long to respond to the interrupts. I'll be glad to post my code if you're interested in trying it out. I'm a bit reluctant at the moment because it is still work in progress.

I'm using the image craft avr compiler. The eval version is limited to 4k after 45 days. I will look at avrgcc when I have time.

http://www.imagecraft.com/software/demos.html
Attached Images
File Type: jpg circuit.JPG‎ (109.8 KB, 389 views)
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 01-19-2005, 01:40 AM
 
Join Date: Jan 2005
Location: Toronto, Canada
Posts: 909
H500 is on a distinguished road

I just tried the circuit using just 1 load sensing resistor common to all 4 coils and everything seemed to work fine. So theoretically, the avr's built in comparator should be good enough if microstepping is not req'd.
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 01-19-2005, 03:23 AM
 
Join Date: Jan 2004
Location: Alberta, Canada
Posts: 111
TinkerDJ is on a distinguished road

Deffinitly neat H500, due to school i have made no movement with my board design and am way behind on coding. Keep us posted. Thanks.
__________________
Have a good one.
Dave
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 01-19-2005, 04:53 PM
pminmo's Avatar  
Join Date: Jun 2003
Location: St. Peters, Mo USA
Age: 59
Posts: 3,325
pminmo is on a distinguished road

H500,
I modified my schematic to try to incorporate your design, as well as started on a board layout. Eagle (www.cadsoftusa.com) free version is great for doing this kind of thing. Attached is pdf's of the schematic and board start for comment. Also attached is a simple stepper routine that I was working for my nonchopped version. It's written in BASCOM Basic which has a free compiler and simuluator and programmer for 2K of code. http://www.mcselec.com/bascom-avr.htm

Phil
Attached Files
File Type: pdf H500brd.pdf‎ (175.8 KB, 457 views)
File Type: pdf H500sch.pdf‎ (103.5 KB, 541 views)
File Type: pdf listing.pdf‎ (2.4 KB, 331 views)
__________________
Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
Vist my websites - http://pminmo.com & http://millpcbs.com
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 01-19-2005, 09:09 PM
 
Join Date: Jan 2005
Location: Toronto, Canada
Posts: 909
H500 is on a distinguished road

Phil

Looks good! I will have to get set up for doing PCB's again. I'll probably use the toner transfer method. My mill "sort of" work, but I don't trust it yet.

It might be a good idea to make provisions for a crystal, just in case 8Mhz is not fast enough. The avr program chops the power at about 20khz, so it only have about 50 uS to run. Also, chopping produced a lot of electrical noise on my system. It acted very irratically until I put a .1u on the step pin.

I will post my code as soon as I test it a bit more.
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 01-19-2005, 11:21 PM
 
Join Date: Jan 2005
Location: Toronto, Canada
Posts: 909
H500 is on a distinguished road

Dave

The avr driver is working as well as I can expect, but I'm finding that I would like to get more power out of my motors. A bipolar drive will give 40% more power, but is more complex to design. Since my motors only need about 1.4 amps, the A3977 looks like the best solution for my current setup. I'm planning to put the avr on the vertical axis for comparison. This axis will only be used for pcb milling and drilling, so it isn't as demanding.

Henry
Tweet this Post!Share on Facebook
Reply With Quote

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HobbyCNC Unipolar Chopper Driver Kit! HobbyCNC Product Announcements & Manufacturer News 1 11-09-2009 09:40 PM
Open Source CNC Controller Specification gregmary DIY-CNC Router Table Machines 28 12-04-2005 10:58 PM
Chopper for AVR from complete newbie, comments pls genericuser Open Source Controller Boards 12 03-31-2005 10:22 PM
Good DC motor and drive JRoque General Electronics Discussion 11 01-02-2005 10:38 PM
Creating a chopper drive with discrete components using the L297 tpworks General Electronics Discussion 15 05-31-2004 01:04 PM




All times are GMT -5. The time now is 11:31 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