![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| 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: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| 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. |
|
#2
| ||||
| ||||
| Nice work! Looks good. I could easily knock together a board design if you wish.
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. |
|
#4
| |||
| |||
| 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. |
|
#5
| |||
| |||
| 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. |
| Sponsored Links |
|
#6
| ||||
| ||||
| 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 |
|
#7
| |||
| |||
| 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 |
|
#8
| |||
| |||
| 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. |
|
#10
| ||||
| ||||
| 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
__________________ Phil, Still too many interests, too many projects, and not enough time!!!!!!!! Vist my websites - http://pminmo.com & http://millpcbs.com |
| Sponsored Links |
|
#11
| |||
| |||
| 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. |
|
#12
| |||
| |||
| 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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |