587,171 active members*
3,120 visitors online*
Register for free
Login
Page 9 of 14 7891011
Results 161 to 180 of 264
  1. #161
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by moghul View Post
    dear Mihai
    yes i have some question .
    if u dont mind n have time send me details of this.

    in
    // PWM channel 0
    TCCR0A := (1 SHL WGM00) or ({1}0 SHL WGM01) or (0 SHL COM0A0) or (1 SHL COM0A1) or (0 SHL COM0B0) or (1 SHL COM0B1);
    TCCR0B := (0 SHL WGM02) or (1 SHL CS00) or (0 SHL CS01) or (0 SHL CS02);
    OCR0A := 0;
    OCR0B := 0;
    // PWM channel 1 (used in 8 bit mode)
    TCCR1A := (1 SHL WGM10) or (0 SHL WGM11) or (0 SHL COM1A0) or (1 SHL COM1A1) or (0 SHL COM1B0) or (1 SHL COM1B1);
    TCCR1B := ({1}0 SHL WGM12) or (0 SHL WGM13) or (1 SHL CS10) or (0 SHL CS11) or (0 SHL CS12);
    OCR1AL := 0;
    OCR1BL := 0;
    // PWM channel 2
    TCCR2A := (1 SHL WGM20) or ({1}0 SHL WGM21) or (0 SHL COM2A0) or (1 SHL COM2A1) or (0 SHL COM2B0) or (1 SHL COM2B1);
    TCCR2B := (0 SHL WGM22) or (1 SHL CS20) or (0 SHL CS21) or (0 SHL CS22);
    OCR2A := 0;
    OCR2B := 0;
    end;

    what means of 1 SHL CS20
    is it CS20 = 1
    ({1}0 SHL WGM21) what is this


    shabbir
    Hello Shabbir

    SHL means shift left, it's equivalent to c operator "<<". what is in between {} in Pascal is a comment so {1} can be ignored. 1 SHL CS20 means 1 shifted left CS20 positions.
    for eg: A = (1 shl 3) or (1 shl 1) is equivalent to binary value 00001010.
    Hope this helps.

    Mihai

  2. #162
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by S.A.C. View Post
    Sounds like this is shaping up nicely. Also funny as I maintain the TFS project for a large NC software development team, and given the choice, I'd probably go that route, but since it's not free, I think github is probably the right choice. If you want to come up with a name for it, I'll be happy to get us set up with a repository.

    With only two interrupts necessary, we can probably get away with an Uno. I happen to have a couple of those sitting around and a Due. C and AVRStudio sound like a fantastic choice to me.

    I can tackle the tuner application probably pretty quickly. I'll see what I can do next week.

    Thanks again. Looking forward to working on this with you.
    Hello again.

    Any name would be good for the repository. I'll have to dig for info on tools for working with Windows with github. I presume it's a straight forward approach and easy to learn.
    I do not know how much time I have for porting to c. The app for tuning it's easy. If you start to it I will give you some hints.

    Mihai

  3. #163
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    Thanks Mihia
    I understand it.
    1 shl cs20 = set bit cs20 or cs20=1

  4. #164
    Join Date
    Dec 2010
    Posts
    70

    Re: DIY AC Servo Drive - ATMega based

    Hello Mihai,

    Nice to see your project
    Also, thank you for free sharing your work

    Regards,
    Seb
    HTM.Ro - Hobby Tools Manufacturing

  5. #165
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Quick question...
    I came across a logic problem.
    For eg the X axis movement in any direction requires same amount of power. However for a Z axis for eg It's harder to move it up than down. If my Z axis has 10 kilos, then we have a 20 kilos force differnce between directions.

    Question is: have any of you heard about servo drives with 2 sets of parameters for PID, 1 for each direction? Or something similar...

    Mihai

  6. #166
    Join Date
    Feb 2015
    Posts
    2

    Re: DIY AC Servo Drive - ATMega based

    Hi Mihai,

    I dont know if others use this feature but I think it is an interresting idea which is worth a try.

    Regards

    Uli

  7. #167
    Join Date
    Feb 2007
    Posts
    966

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by mcm_xyz View Post
    Quick question...
    I came across a logic problem.
    For eg the X axis movement in any direction requires same amount of power. However for a Z axis for eg It's harder to move it up than down. If my Z axis has 10 kilos, then we have a 20 kilos force differnce between directions.
    Question is: have any of you heard about servo drives with 2 sets of parameters for PID, 1 for each direction? Or something similar...
    Mihai
    You shouldn't need it, because its normal to have load in one direction only (EG: when cutting hard.) Your PID should be able to be stable both directions.

    But on a Z axis, you could add a "Offset" setting which makes the error zero when the load is on. ( i have that in my viper) You just make the PWM sit normally with a bit of offset.+ or -

    Larry K

  8. #168
    Join Date
    Feb 2015
    Posts
    2

    Re: DIY AC Servo Drive - ATMega based

    I think it is not a question of "need". Perhaps it could perform a little bit better.

    Larken, the offset you mean should be compensated by the I-part of the control loop. So there is no need for an offset.

    But I am no expert, maybe I am wrong....

  9. #169
    Join Date
    Nov 2014
    Posts
    10

    Re: DIY AC Servo Drive - ATMega based

    Hi Mihai,
    for my experience on all CNC for z axis have a pneumatic cylinder to offset the weight
    On my little CNC I have a cilinder of 40mm of diameter always on pressure of 3.5 bar
    This solve and fix all my problem !!!
    Francesco

  10. #170
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Hello again guys!

    Small changes in servo firmware and tuning program. PID frequency around 23.5kHz... super... I've dropped all "anti vibration stuff" as when I changed the couplings from this:



    to this:



    all vibrations disappeared... Bad mechanics for me...

    Also a new eagle schematic and board (board is not completed yet) has been created... I added optocouplers for step / dir / enable and for encoder inputs.
    If someone with experience in PCB design could make a better board design would be nice.
    Also I dropped the PlanetCNC USB controller and migrated to LinuxCNC. I am amazed what one can do with that piece of software...
    I strongly recommend it.

    Mihai

  11. #171
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Latest board and firmware. Board with optocouplers is ready!

  12. #172
    Join Date
    Feb 2009
    Posts
    40

    Re: DIY AC Servo Drive - ATMega based

    You can optimize routing of the resistor to optocoupler - pl see attachment
    Attached Thumbnails Attached Thumbnails edge67.png  

  13. #173
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by quadtech View Post
    You can optimize routing of the resistor to optocoupler - pl see attachment
    Noted!

    Will be done in future versions! Thanks!

    Mihai

  14. #174
    Join Date
    Mar 2015
    Posts
    4
    Hi
    I read this forum. This project is amazing. Long time ago i was search similar. So i rebuild your PCB. I use PIC earlier, but this is my first AVR project. I don't know why but the oscillator didn't work. I use 20MHZ crystal. I try different capacitor, and low and high crystal. But nothing. I didn't see the resonation in scope. The green led is on a few sec and off, and that's repeat. MCU type 644PA. Maybe the fuse setting is wrong.
    What is the correct setting? Calculated values.

  15. #175
    Join Date
    Mar 2015
    Posts
    4

    crystal problem

    Hi
    I read this forum. This project is amazing. Long time ago i was search similar. So i rebuild your PCB. I use PIC earlier, but this is my first AVR project. I don't know why but the oscillator didn't work. I use 20MHZ crystal. I try different capacitor, and low and high crystal. But nothing. I didn't see the resonation in scope. The green led is on a few sec and off, and that's repeat. MCU type 644PA. Maybe the fuse setting is wrong.
    What is the correct setting? Calculated values.

  16. #176
    Join Date
    Mar 2015
    Posts
    4
    Hi!
    I solved the problem. But i have another.
    If i use PuTTY i see SERVO STARTING. FIRMWARE VER 1.5, but Servo Drive Tuner connect to COM1 and write
    >>> STATUS
    NO RESPONSE FROM SERVO!!!

  17. #177
    Join Date
    May 2006
    Posts
    190
    Quote Originally Posted by gaborf View Post
    Hi!
    I solved the problem. But i have another.
    If i use PuTTY i see SERVO STARTING. FIRMWARE VER 1.5, but Servo Drive Tuner connect to COM1 and write
    >>> STATUS
    NO RESPONSE FROM SERVO!!!
    Try some text commands in putty. Like status or getconfig. You should get an answer. If no answer comes but you can still see the message Servo starting when you power it up, then its a problem with the rx part of your atmega. Keep me informed of your progress.

    Mihai

  18. #178
    Join Date
    May 2006
    Posts
    190
    Quote Originally Posted by gaborf View Post
    Hi!
    I solved the problem. But i have another.
    If i use PuTTY i see SERVO STARTING. FIRMWARE VER 1.5, but Servo Drive Tuner connect to COM1 and write
    >>> STATUS
    NO RESPONSE FROM SERVO!!!
    Have u used an usb 2 rs232 5v adapter to connect to pc? If no that is the problem.
    I have used a cable like this: TTL-232R-5V FTDI - Modul: cu cablu, integrat | TME - Componente electronice
    PC serial port is not TTL compatible (works on 3.3V) and you will need an adapter. There are circuits available for this (like max232 and others)

    Mihai

  19. #179
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    First cut!

    demo cut on a router machine equipped with 3 servo controllers:

    https://www.youtube.com/watch?v=zbGa3EwVcs0

    rapid move is set to 5m / minute but it can go up to 10m / minute (with my motors)

    Mihai

  20. #180
    Join Date
    Mar 2015
    Posts
    4
    Hi
    I short the pin14 to 5V. Now it's work fine. I testing now.
    I what to build a rotary 4th axis.

Page 9 of 14 7891011

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
  •