587,683 active members*
2,802 visitors online*
Register for free
Login
Results 1 to 20 of 264

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    3498

    Re: DIY AC Servo Drive - ATMega based

    I am also interested in 328P version of ATMEGA.
    Quote Originally Posted by nitrochopper2 View Post
    Thank you so much for sharing Mihai. I have 5 boards in progress based on the 644p. It would be awesome if somebody with some time and mikropascal could compile the code for the 328p and list the corresponding pinout. Could result in more interest...
    http://free3dscans.blogspot.com/ http://my-woodcarving.blogspot.com/
    http://my-diysolarwind.blogspot.com/

  2. #2
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by Khalid View Post
    I am also interested in 328P version of ATMEGA.
    I've looked a little over the datasheet for the 328P MCU. It's ok for the design. The only problem I see is the low memory (2K SRAM) that will not allow a very big commutation table to be allocated. (The table storing the commutation shift for each encoder step). This being said the circuit will only allow lets say 1024PPR max encoders, or if bigger used, a precision decimation is needed. Or we could drop the commutation table, and use in realtime calculation of the commutation, sacrificing in performance...

    Thus being said, what we would need is:

    1. at least 2 external interupts
    2. at least 16K of Flash
    3. at least 2K of RAM
    4. at least 6 PWM outputs (it would be nice to have them all 16 bit)
    5. at least 1 ADC input
    6. hardware UART is nice but not really a must
    7. lowest price.

    ATMEGA 328 has all of these... I could try and modify the design and code for it but it would be later this year, in autumn I hope...

    Mihai

    PS: I just discovered that int 1 is shared with a PWM Output (PCINT19/OC2B/INT1) PD3... This is not so good for our design, We will have to use a PCINT for the second interupt = performance issues...

  3. #3
    Join Date
    Apr 2015
    Posts
    3

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by mcm_xyz View Post
    I've looked a little over the datasheet for the 328P MCU. It's ok for the design. The only problem I see is the low memory (2K SRAM) that will not allow a very big commutation table to be allocated. (The table storing the commutation shift for each encoder step). This being said the circuit will only allow lets say 1024PPR max encoders, or if bigger used, a precision decimation is needed. Or we could drop the commutation table, and use in realtime calculation of the commutation, sacrificing in performance...

    Thus being said, what we would need is:

    1. at least 2 external interupts
    2. at least 16K of Flash
    3. at least 2K of RAM
    4. at least 6 PWM outputs (it would be nice to have them all 16 bit)
    5. at least 1 ADC input
    6. hardware UART is nice but not really a must
    7. lowest price.

    ATMEGA 328 has all of these... I could try and modify the design and code for it but it would be later this year, in autumn I hope...

    Mihai

    PS: I just discovered that int 1 is shared with a PWM Output (PCINT19/OC2B/INT1) PD3... This is not so good for our design, We will have to use a PCINT for the second interupt = performance issues...

    Thank you for catching that..saved me some time. I will stick w the 644p. They are on the way already.

    Hmmm...how about code for a 1284p? More common probably. Wait..or is the code already compatible w the 1284p? I have one of those.

  4. #4
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by nitrochopper2 View Post
    Thank you for catching that..saved me some time. I will stick w the 644p. They are on the way already.

    Hmmm...how about code for a 1284p? More common probably. Wait..or is the code already compatible w the 1284p? I have one of those.
    Hello.
    From what I know so far ATMega1284 has 2 counters on 16 bit so a very little code modification is requred (I think) for PWM initliazition. That should be all. I also have a few of those and I might give it a try.

    Mihai

    PS. 1284 has also a great bunch of SRAM(16K) so further code optimizations I think are also possible.
    PS. Code is fully compliant with 1284. 1284 has another counter (OCR3) that is on 16 bit but it's not used. (all you have to do is open the project and change MCU type and then hit compile)

  5. #5
    Join Date
    Apr 2015
    Posts
    3

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by mcm_xyz View Post
    Hello.
    From what I know so far ATMega1284 has 2 counters on 16 bit so a very little code modification is requred (I think) for PWM initliazition. That should be all. I also have a few of those and I might give it a try.

    Mihai

    PS. 1284 has also a great bunch of SRAM(16K) so further code optimizations I think are also possible.
    PS. Code is fully compliant with 1284. 1284 has another counter (OCR3) that is on 16 bit but it's not used. (all you have to do is open the project and change MCU type and then hit compile)
    The code is too big for the free version of Mikropascal..and i dont want to spring for a license yet. I might though if i can get these drives to work on some bigger motors.

  6. #6
    Join Date
    Apr 2019
    Posts
    2
    Hi Mihai am very interest with your project that you share, please i don't have a big experience with Mikropascal can you help me how to change the mcu 644p to 1284p to compile it, because i have a AC servo motor 3 phase 2500ppr 8 poles...
    Thank very much
    Stewart

Similar Threads

  1. Servo module for UHU based drives now available.
    By H.O in forum UHU Servo Controllers
    Replies: 1
    Last Post: 01-24-2022, 03:11 PM
  2. Servo drive with ATMEGA
    By mcm_xyz in forum Servo Motors / Drives
    Replies: 1
    Last Post: 12-15-2014, 01:12 AM
  3. Suggestions on New VSD-Core Based Mains Powered Drive
    By Adamj12b in forum CNC (Mill / Lathe) Control Software (NC)
    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
  •