587,132 active members*
3,071 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > Stepper Motors / Drives > Cheap, small, stepper Pic Driver - Developing
Page 1 of 3 123
Results 1 to 20 of 45
  1. #1
    Join Date
    Jan 2006
    Posts
    25

    Question Cheap, small, stepper Pic Driver - Developing

    Hi, i just want a little help, i have just finish a pic based controller,
    this is for Unipolar motors, with chopper, and microstepping (calculated in realtime for more precision or in contants 4-64 microsteping), change steps on the fly(bia the RX pin, not in schematic, so i deside to use a manager board), I have test this design in discrete components (48hrs continusly, with a fan, if not IRLZ44 gets hot... and the motor just a little) and it works wondelfull in every config, and i'd like to make it in SMT, and I have a little questions.
    1 - how much does the IRLZ44 get hot, with a 3A paused (HOT!!! i Guess), and in a D2Pak?
    2 - discrete is better than SMT for this kind of aplications?
    3 - I'm a programmer not electronic, as you see the design is a little simple, can someone please help me to check posible design error in the electronic side, protections, noise etc.
    4 - Does anyone know a method for sense the current other than checking the voltage passing thoung a Resistance??
    5 - for PWM of microstepping which frecuency is adecuated 40Khz <- the one I use, 20 Khz <- half for a diferent cristral, or 7.8Khz <- to use the internal osillator, bye bye cristal.

    This board is for 1 motor, I'm planning to have a Interfaz board with a pic to control everything, I dont know how g-codes works, but I was planning to used the serial conector or USB or a kind of interface to mach2, 3 or something like that, and pass a bunch of g-code to the pic proccess it and send every thing to N motor modules, instead of limit us with the parallel port, the same goes for the inputs, and is kind of cheap.

    well is everything I will apreciate your help, I have send a rudimentary schematic, the PIC should be PIC16F88(is another 'cause i want the QFN 28 encapsulated to apper in the SMT image, and doesnt apper (wedge) , the 16f88 has a pin to pin compability and more with QFN pak ), the Power transistor is IRLZ44 (the same but for the D2pak), SV1 = Vref, Dir, Step, Sv2 and SV3 for motor and power conection (but planning to cominicate just for RX), the SMT image is just a "It should be like this".

    Thanks Everyone.

    PD i dont not much Eagle and where the hell are the components, resistences and conector i'd like,........ or I dont know their correct names
    Attached Thumbnails Attached Thumbnails Ragnarok.JPG   Schematic.JPG  

  2. #2
    Join Date
    Jun 2004
    Posts
    463
    Have you measured the temperature of the IRLZ44's? At 3 amps, they should be dissipating less than 1/2 watt. The TO220 package has a Tja of 65 deg C/W so at 1/2 watt they should not be getting extremely hot, even without cooling. Also, with a Tjc of 1 deg C/W they can be run at case temperatures of 100 deg C with no problems, but at 1/2 watt, they shouldn't be getting that hot.

    I suspect that you are not fully driving the gate to the required 4 volts above the source. The voltage out of a 74ls00 is typically only 3.5 volts, so it is too low by it self. You should at least be using CMOS to drive the gate, and probably a dedicated MOSFET driver. What value are your current sense resistors? Since you are running the sense voltage to the PIC without an amplifier, the voltage drop across the sense resistors is probably rather high. The source on the MOSFETS will be raised above ground by the voltage drop across the sense resistor, so this has to be subtracted from the 3.5 volts out of the 74ls00. You might be only getting 2 volts of drive to the gate. This would cause the IRLZ44's to get much hotter than necessary.

    Here is one alternative to the current sense resistors. http://www.allegromicro.com/hall/currentsensor.asp

  3. #3
    Join Date
    Apr 2005
    Posts
    1268
    Gosh these folks impress me with their knowledge. I'm from the old school. We design, plug in a "smoke test".
    Keep up the good work guys.
    billyjack
    :idea:
    billyjack
    Helicopter def. = Bunch of spare parts flying in close formation! USAF 1974 ;>)

  4. #4
    Join Date
    Jun 2003
    Posts
    3312
    ragnorok,
    How are you doing microstepping with the posted circuit? I'm missing something............
    Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
    Vist my websites - http://pminmo.com & http://millpcbs.com

  5. #5
    Join Date
    Apr 2005
    Posts
    462
    well spotted phil. this would achieve half-stepping only, in software. unless RA0 and RA1 have something to do with it?

  6. #6
    Join Date
    Jul 2005
    Posts
    442
    How did you do the board image?

  7. #7
    Join Date
    Jan 2005
    Posts
    1695
    Probably Eagle.

  8. #8
    Join Date
    Jul 2005
    Posts
    442
    Quote Originally Posted by H500
    Probably Eagle.
    I didn't see anything in eagle to create a ray traced image or 3d model

    Aaron

  9. #9
    Join Date
    Jun 2004
    Posts
    463
    Posix,
    Im sure RA0 and RA1 have something to do with it. He is probably using the a/d inputs on the PIC to measure the current to determine the switching time. It might work on high inductance motors with low supply voltages. I dont use pics much, but believe the A/D conversion time is around 10 or 20 uS. A motor with 24 mH inductance driven with 24 volt supply might ramp up only 0.02 amps during one conversion period, and could give you good control over the microstepping. However, a motor with 1mH inductance driven with a 50 volt supply might change a whole amp during one conversion period, and be totally unuseable.

    Jeff

  10. #10
    Join Date
    Jan 2006
    Posts
    25
    Hi, thanks for your replies, pminmo, im doing microsteping using the CCP1 mudule in PWM config, I send the apropiated PWM and AND it with the signal as if it were a Full step 2 phases bia the demux.
    the A0, A1, A2(vs1, vs2, Vref) are for the chopper circuit, they are comparators not ADC ( they are alot faster), in software if any phase goes high than Vref, in firmware it turns of the phase bits for that pic cycle and the next until it rech a lower voltage, the posibles configs are full 1 phase, full 2 phase, half step, and the micros i have mentioned.

    About the SMT image it was render using POV file generated by a ulp, a thread in this comunity, i been looking for it but i dont find it, let me search some more.

    Thank you very much for the info jeffs555!!!!

    I will try to impruve the design!

  11. #11
    Join Date
    Jun 2003
    Posts
    3312
    Quote Originally Posted by jeffs555
    Posix,
    Im sure RA0 and RA1 have something to do with it. He is probably using the a/d inputs on the PIC to measure the current to determine the switching time. It might work on high inductance motors with low supply voltages. I dont use pics much, but believe the A/D conversion time is around 10 or 20 uS. Jeff
    I think it would be a real stretch to measure the current in real time to do microstepping. Takes roughly 20us to just get the sampling cap charged, then you have to add the a to d conversion cycle. Plus during that 20us acquisition, the current isnt just setting steady state. At microstep rates of 1/8th step you have to be able to resolve roughly 2%.

    I'm missing something, but it wouldn't be the first time. :tired:
    Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
    Vist my websites - http://pminmo.com & http://millpcbs.com

  12. #12
    Join Date
    Feb 2004
    Posts
    361
    Eagle 3D from ? Matthias Weber? generates PovRay compatible images from Eagle PCB software, Povray can save to bmp, etc..

  13. #13
    Join Date
    Jan 2006
    Posts
    25
    jeffs555, you are right i just have sense the voltage and is lower than spected in the Rsense, i guess is because the mosfet isn't fully actived as you says, ill change the TTL gate for a CMOS gate and see the results.

    Once again thanks!!!

  14. #14
    Join Date
    Jun 2003
    Posts
    3312
    [QUOTE=Ragnarok]Hi, thanks for your replies, pminmo, im doing microsteping using the CCP1 mudule in PWM config, I send the apropiated PWM and AND it with the signal as if it were a Full step 2 phases bia the demux.
    the A0, A1, A2(vs1, vs2, Vref) are for the chopper circuit, they are comparators not ADC ( they are alot faster), in software if any phase goes high than Vref, in firmware it turns of the phase bits for that pic cycle and the next until it rech a lower voltage
    QUOTE]

    I still don't get it. Is there a filter on the pwm output somewhere to develop a dcv to compare?
    Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
    Vist my websites - http://pminmo.com & http://millpcbs.com

  15. #15
    Join Date
    Jan 2006
    Posts
    25
    Quote Originally Posted by pminmo
    I still don't get it. Is there a filter on the pwm output somewhere to develop a dcv to compare?
    the CCP module is a capture/compare/PWM ->this module is everything about time and timers, nothing about voltage.

    the chopper ckto is made in the analog comparator modules -> those are like analog comparator with amp ops,
    they are not and ADC, the Typ responce time is 150ns, as the datasheet says.

    the chopper is applied on every step configuration for current control, not only in microsteps.

  16. #16
    Join Date
    Jun 2003
    Posts
    3312
    ragnarok,
    I understand the timer compare module and the analog comparator modules. What I am not understanding is what your basing your current value decision on? Typically use of an analog comparitor for microstepping is done by setting the percentage analog value for a specific miscrostep current value on for the comparitor reference. That is updated to a new value each fractional step. How can you microstep without some analog components?
    Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
    Vist my websites - http://pminmo.com & http://millpcbs.com

  17. #17
    Join Date
    Jan 2006
    Posts
    25
    Quote Originally Posted by pminmo
    ragnarok,
    I understand the timer compare module and the analog comparator modules. What I am not understanding is what your basing your current value decision on? Typically use of an analog comparitor for microstepping is done by setting the percentage analog value for a specific miscrostep current value on for the comparitor reference. That is updated to a new value each fractional step. How can you microstep without some analog components?
    ok, now i understand, I use the PWM itself, just like controlling the voltaje on a DC motor o a Fan, the current in the phase will be directly proportinally to the duty cycle, and I dim or increase the duty cycle every step, the current for a microstep is controlled by the PWM duty cycle.

  18. #18
    Join Date
    Jun 2004
    Posts
    463
    The main problem I see with your approach is that your speed will be severely limited. A normal microstepping chopper drive has a DAC to drive the reference input on the comparator like Phil said. When a step pulse comes in, and the current in a coil needs to increase , the DAC voltage is changed. They then apply full supply voltage to the coil until the current reaches the set value, and only then do they start chopping. This assures that the current ramps up to the set value as rapidly as possible. The chopping is only to maintain the current after it has reached the set value. With your scheme, you will be chopping all the time, even while the current is ramping up, so the ramp up will be much much slower, and the maximum speed of your stepper will suffer greatly. You will lose all the advantage of using a power supply higher than the rated motor voltage, because you are essentially regulating the power supply voltage back down to the rated voltage of the motor or less.

  19. #19
    Join Date
    Jan 2006
    Posts
    25
    Hi jeff555, I have attach a schematics of how the chopper works( ignore the values). I not really an electronic guru, thats why my designs are kind of simples.
    pminmo, looking at your page( excellent page ), i see a stepper driver page, i have seen the diagrams and boot have a DAC, i see is for a kind of microchopping for each step, but what is the diference of using DAC aproach and control the current with PWM???

    Thanks your help, and patience .
    Attached Thumbnails Attached Thumbnails Schematic.JPG  

  20. #20
    Join Date
    Jan 2006
    Posts
    25
    hi, looking for internet i find this page http://www.piclist.com/techref/io/st...step/index.htm, it seems he uses a kind of PWM simulated by code and some transistors, for the chopper he uses a limit resistance, but look at the Osiloscope images, i guess i'd have a similar signal modulating the step with the PWM(with a osiloscope ), I will try to generate the PWM by code like this guy, so i will eliminate the 2 gates, the demux and the AND,
    what do you thing about this images??, i guess you could do it without a dac, just with PWM, and here is an microchip application note for control bipolar motors.

    http://www.microchip.com/stellent/id...pnote=en011997

    and the an906 in microchip site

Page 1 of 3 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •