509,854 active members
4,315 visitors online
Register for free
Login
Page 1 of 21 12311
Results 1 to 12 of 250
  1. #1
    Registered
    Join Date
    May 2006
    Posts
    190

    DIY AC Servo Drive - ATMega based

    Hello dear machinists!

    A long time ago I tried to build my own servo drive (and I almost did), based on ELM CHAN Servo drive schematics and code.
    I am now building an AC servo drive from scratch. I have my own program, and my own schematic.
    After a couple of weeks of hard working, reading, soldering and programming this is what I obtained:

    A cheap servo drive, based on ATMEGA644 (lower versions can also be used as compiled program hardly occupies 15% of MCU flash).
    The whole boar wont cost you more than 30$!!!
    The features so far:

    Works with AC motors without using any Hall sensors.
    Step / Dir inputs
    UART connection for tuning and debuging

    I can tell you that I am really happy with the performance obtained so far. My own build servo (a cdrom motor and an optic encoder from an old mouse) works really fine. I was able to obtain about 1200 RPM with this 6 poles motor and 90 PPR encoder.

    Little software / hardware description.
    MCU must have 6 pwm outputs and 3 external interrupts.
    3 x IR2101 are used for driving the final stage mosfets.
    1 x 74hc14 is used to buffer my encoder inputs.
    16 Mhz clock on MCU (can be raised to 20 Mhz)
    PID process for controlling movement.

    I will make the schematic and source code available for anyone here. Please feel free to modify them as you need (they are not under any kind of licensing)

    Here are some pictures and video of my very beta board and servo!

    https://www.youtube.com/watch?v=Auw7-5yBa3o
    Attached Thumbnails Attached Thumbnails IMG_20141215_013411.jpg   IMG_20141215_013429.jpg  

  2. #2
    Registered
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Here is the firmware and schematic as promised.
    Program is compiled with Mikropascal Pro for AVR.
    Schematic and board are done in Eagle 5.8.0.

    I am a software engineer so please forgive my mistakes in the schematic.

    I am open to any suggestion or remark!

    I will come back later explaining functionality and where and how the PID process is involved.

    Mihai.

  3. #3
    Registered
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based


  4. #4
    Registered
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Short description of software commands:


    1. 'getconfig' - will display the config parameters stored in the EEPROM

    example output:

    CONFIG:
    ENCODER PPR = 90
    MAX PPR ERROR = 45
    MOTOR POLES = 6
    PID Kp = 450
    PID Ki = 350
    PID Kd = 100

    2. 'set ppr XXXX' - will set the PPR rate of the encoder. XXXX must be unsigned int 16
    3. 'set error XXXX' - will set the max allowed error. If during movement the EncoderPosition - DesiredPosition is greater than this value servo stops and error led is powered. This is used only when STEP/DIR commands are applied. XXXX must be unsigned int 16
    4. 'set poles XXXX' - will set the number of poles of the motor. (I am not sure about this terminology, what I did is: for eg. 6 poles means the motor makes a full turn in 6 sine periods)
    5. 'set kp XXXX' , 'set ki XXXX', 'set kd XXXX' - will set Kp, Ki and Kd constants of PID process calculation.
    6. 'start', 'stop' - starts or stops the PID process. if stopped no power is applied to motor and PID calculation is stopped.
    7. 'enc' - will display the encoder position register (Int 32 signed). PID must be stopped to allow this
    8. 'move XXX'X - starts a free movement of XXXX steps. During this the max allowed error is set to max int 32 so no error will be raised during this kind of move.

    Give it a try...

  5. #5
    Member
    Join Date
    Jan 2005
    Posts
    10536

    Re: DIY AC Servo Drive - ATMega based

    mcm_xyz

    Well done, looks like a fun project
    Mactec54

  6. #6
    Gold Member
    Join Date
    Apr 2006
    Posts
    3501

    Re: DIY AC Servo Drive - ATMega based

    great ,,, must see more pictures and progress..
    http://free3dscans.blogspot.com/ http://my-woodcarving.blogspot.com/
    http://my-diysolarwind.blogspot.com/

  7. #7
    Registered
    Join Date
    May 2005
    Posts
    1397

    Re: DIY AC Servo Drive - ATMega based

    Wow! That's nice!

    Can it work with a larger motor? What would it take to support that? Can I help?
    James hosts the single best wiki page about steppers for CNC hobbyists on the net:
    http://www.piclist.com/techref/io/steppers.htm Disagree? Tell him what's missing! ,o)

  8. #8
    Registered
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    First PCB!
    It's milled and drilled on CNC. Not so good. The separation is very poor, parts are very hard to solder.
    I will stick to old chemical way for the next versions and maybe drill the holes on CNC.
    I am waiting for a bigger motor. The board will work with higher currents, it's just a problem of final stage Mosfets.

    Here is the latest schematic and firmware also.
    Attached Thumbnails Attached Thumbnails IMG_20141217_085958.jpg   IMG_20141217_090026.jpg   IMG_20141217_090224.jpg  
    Attached Files Attached Files

  9. #9
    Gold Member
    Join Date
    Dec 2004
    Posts
    1858

    Re: DIY AC Servo Drive - ATMega based

    Looks pretty good to me. Keep up the good work.

    Mike
    Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out.

  10. #10
    Registered
    Join Date
    Apr 2006
    Posts
    169

    Re: DIY AC Servo Drive - ATMega based

    cd rom motor as bldc ???

    Keep up the good work

  11. #11
    Registered
    Join Date
    May 2006
    Posts
    190
    Quote Originally Posted by hesham morsy View Post
    cd rom motor as bldc ???

    Keep up the good work
    It was the only one I could find in house...
    Actually I do not even understand the term BLDC... There is no way that kind of motors to work with DC...
    They are simply triphasic motors...

    I am about to recive a larger 'BLDC'...
    I will post progress and new schematic and firmware after...

    Mihai

  12. #12
    Registered
    Join Date
    Apr 2006
    Posts
    169

    Re: DIY AC Servo Drive - ATMega based


Page 1 of 21 12311

Similar Threads

  1. Servo drive with ATMEGA
    By mcm_xyz in forum Servo Motors / Drives
    Replies: 1
    Last Post: 12-15-2014, 01:12 AM
  2. Servo module for UHU based drives now available.
    By H.O in forum UHU Servo Controllers
    Replies: 0
    Last Post: 02-06-2012, 08:32 PM
  3. Suggestions on New VSD-Core Based Mains Powered Drive
    By Adamj12b in forum Granite Devices
    Replies: 4
    Last Post: 05-05-2009, 08:28 PM
  4. Pic based servo motor drive
    By ahmedrehan in forum PIC Programing / Design
    Replies: 7
    Last Post: 08-08-2007, 01:08 AM
  5. I need help on PC-based for servo control
    By NASR1 in forum Servo Motors / Drives
    Replies: 1
    Last Post: 08-14-2006, 09:43 PM

Tags for this Thread

Posting Permissions

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