585,754 active members*
3,750 visitors online*
Register for free
Login
Page 7 of 14 56789
Results 121 to 140 of 264
  1. #121
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Interesting part about the magnetic encoder:

    Mode 3.x: Brushless DC Motor Commutation Mode
    In addition to the absolute encoder output over the SSI interface, this mode provides commutation signals for
    brushless DC motors with either one pole pair or two pole pair rotors. The commutation signals are usually provided
    by 3 discrete Hall switches, which are no longer required, as the AS5040 can fulfill two tasks in parallel: absolute
    encoder + BLDC motor commutation.

    If we would also use hall sensors we could eliminate the need for motor initialization, eliminating the free short move done when starting the servo.
    If this sensor is precise and the motor is magnetically sealed (no large magnetic fields escape the motor when energising coils) then this could be indeed a good and cheap solution. Also seems very easy to mount and tolerances are good.

    Mihai

  2. #122
    Join Date
    Mar 2005
    Posts
    159

    Re: DIY AC Servo Drive - ATMega based

    Just something to look at.

    ClearPath

  3. #123
    Join Date
    Dec 2008
    Posts
    28

    Re: DIY AC Servo Drive - ATMega based

    Mihai,

    Is it possible to transfer your code under Linux and use BeagleBone Black as a main brain which will run LinuxCNC and Servo control?
    This credit card size computer is very powerfull and requires only "Power Board" with Gate Drivers and Motor MOSFETs.

    There is a CRAMPS board available to drive 6 steppers and extruder control for 3D printers. Same idea can be for CNC as soon as LinuxCNC works well under BeagleBone hardware and Software. Beaglebone is cheap, $45. It has USB, Ethernet and HDMI.

    Thanks

  4. #124
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    Hi Mihai
    i have some motors for experiments .
    Panasonic 96 vdc encoder 1024 pulse no commutation. 200watts 3000rpm 8 poles
    yaskawa 100vdc encoder 2048ppr 100watts 3000rpm 8 poles
    yaskawa 150vdc encoder 5000ppr with uvw commutation output, 900watts. 1500rpm 8 poles

    how can i configure this .
    shabbir

  5. #125
    Join Date
    Mar 2015
    Posts
    2

    Re: DIY AC Servo Drive - ATMega based

    Something to consider;
    These brushless dc motors are wired nearly the same as vehicle alternators. The differences are:
    1 That an alternator requires an exitation field in the rotor. It is applied with brushes but the brushes are in continuous contact and not commutated.
    2 That an alternator has the three phases rectified internally.

    The disadvantages of this would be:
    1 It would require one more power channel for the rotor exitation, but it would only have to be regulated. (not necessarily by the controller)
    2 It would require that the field windings be disconnected from the bridge rectifier and brought out of the body of the alternator.

    The advantages of using an alternator would be:
    1 Much lower cost than a comparable motor of similar power conversion.
    2 The availability of the rotor field as an additional control variable for pid or as a cascade stage of pid.
    3 Wide availablity of alternators in the range of about 100 to about 7000 watts. The upper end of this puts INDEXABLE SPINDLE drives even for a lathe well within the range of homebrew feasibility.

    You guys keep at this and you're gonna mess up build something impressive.

  6. #126
    Join Date
    Mar 2015
    Posts
    2

    Re: DIY AC Servo Drive - ATMega based

    I thought about this some more. It gets better. This topology also applies to gasoline and diesel generators and welders as they are really alternators. You could make some BIG stuff. I have a 1200 watt 60 hz 110v generator set that I loaned several years ago to a friend. Unfortunately, my friend is not very bright and he took the carburetor apart and lost several pieces. Fortunately, I have a pretty good idea of what the electrical side of it is going to be used for.

  7. #127
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Hello again!

    I will come back later this evening with updates on firmware and servo drive tuning program.
    I've updated the pid parameters so basically now 1 is 256. this way you have a bigger range for parameters allowing better and smoother tuning.
    Also I am working on updating the PID algorithm, allowing over 10kHz frequencies for PID.

    Again an answer for all. People criticize me for not using HALL sensors for commutation detection. I've done some free spinning motor initialization and then I am updating the motor commutation according to encoder position.
    People say to me:
    "i watch ur video . when servo on it take a fast movement for setting her commutation . this is problem. u have to add external commutation signals. if any body use this in cnc when machine in running n power fail. after restoring power servo on then it will take a fast movement for a while n job will be damaged."
    The thing is: if machine enters "power fail" or any servo enters in failure mode you already lost steps. You Can Not Continue from that position, Hall or no hall sensors. You will have to re-calibrate again. So it's no big deal that motor spins freely for max 360 degree / Motor Poles when starting the servo.
    This project is as it is. You may change it and make it better for sure.

    Mihai

  8. #128
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Latest firmware and servo drive tuner.

    Kp, Ki and Kd parameters are now multiplied with 256. So if you had previously a parameter = 10 now you should set it to 2560. You can tune better now with a wider range of values.
    PID algorithm has been further optimized and PID frequency reached 9.5 kHz.

    Mihai

  9. #129
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    :cheers::cheers::cheers::cheers::cheers:

    I reached 15kHz for PID frequency.
    The most demanding math operation from PID (a modulo on a 32bit number) was dropped and replaced by a simple addition / subtraction on encoder interrupts.
    We reached this way 15kHz.

    Also a bug fix! very important one. When I moved enable / disable on interrupts, I made a mistake by activating the motor inside the interrupt code skipping this way the current limiting feature when starting the motor. (the voltage measurement is also made on interrupts).

    Also a single interrupt is now used for the encoder, int0, configured to trigger at any level change. int1 (PD3) is now not used, can be removed from the schematic also.

    Please upgrade to this latest version.
    Attached Files Attached Files

  10. #130
    Join Date
    Nov 2013
    Posts
    5

    Re: DIY AC Servo Drive - ATMega based

    Pretty good work! I have been looking for this some many time that I already started my own servo driver software some time ago, but haven't tested jet.

    My engineering knowledge is not hardware of software so I only have a hobby level. I just know Arduino so I have done all on that. Since it's less powerfull than programing the micro directly, I had to run some ideas that may be usefull to you;

    First of all I made the driver for brushed DC motors, since the control is easier. It have 3 interrupts (pulse, encoder A and encoder B) and 2 PWM outputs for the H-bridge.

    But I really wanted BLDC, so since I already have the DC driver I thought, can I make something to work BLDC with the DC driver? So I programed another arduino that takes the 2 signals for the H-bridge, and with a low resolution encoder (square wave from the hall sensors or a optic disk with the same number of cuts than magnets on the rotor) decripts the position of the encoder and generates 6 outputs to drive the 3 phase H-bridge.

    I wanted the driver to be the fastest I can, and since Arduino is a bit slow, I thought: can I make the same that this second Arduino does but just with logic gates? That should be faster, and yes, it's possible to do. It needs about 30 logic gates but it's not very hard. Then I separated the PWM from the other signals so I only need the arduino to generate one.

    So the main points is:

    The microprocesor need only 3 interrupts pins: 2 for the high resolution encoder and one for step.
    The micro just make the PID and generate 3 outputs: 1 digital output to turn the motor CW, 1 digital output to turn the motor CCW, and the PWM output. With that I can work a brushed servo. This way all calculations should be faster.
    The logic gates circuits takes this 3 outputs from the micro, and 3 new imputs from the low resolution encoder in the motor, and just decodes all the signals so it generates the 2 PWM outputs (at the same time) to the correct mosfets of the 3 phase H-bridge (it has 6 mosfets of course).

    Maybe this is usefull to you to improve the PID frecuency and the use of very high resolution encoders or RPM. If you want to see more in detail the logic circuit let me know and I will post it.

  11. #131
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    Hi Mahai
    U r right on step missing but when recalibrate the servomotor it rotates for calibration. This is problem .
    I feels don't rotate the motor at calibration.
    When any drive gets commutation signals from sensor r encoders It never rotates for phase calibration .
    It's only suggestion .
    Ur all efforts for this drive are appropriateing .
    Shabbir

  12. #132
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by moghul View Post
    Hi Mahai
    U r right on step missing but when recalibrate the servomotor it rotates for calibration. This is problem .
    I feels don't rotate the motor at calibration.
    When any drive gets commutation signals from sensor r encoders It never rotates for phase calibration .
    It's only suggestion .
    Ur all efforts for this drive are appropriateing .
    Shabbir
    Hello Shabir!

    I have an idea it can easily be implemented. Before starting motor initialization, we can get the encoder PPR, and then, after initialization set the position back. How does this sound to you? I can easily implement this, and I'll do it this evening.

    Mihai

  13. #133
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    HI Mihai
    no no
    i wants only that when we apply the motor power to drive it would not to free run for calibration..
    shabbir

  14. #134
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    hi Mihai
    can i use ATMEGA 162.
    it has 16 kb flash
    6 pwm 8bit
    shabbir

  15. #135
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    Quote Originally Posted by moghul View Post
    hi Mihai
    can i use ATMEGA 162.
    it has 16 kb flash
    6 pwm 8bit
    shabbir
    Yes you can. It has all ports needed. You will have to modify the size of the array that holds the response positions required for sending to Servo tuning software wont fit (ATMega163 has only 1K RAM and ATMega644 has 4K). The current size is 1024 positions. You can lower it to 128 and still see the position response in good conditions.
    The rest should be compatible with some minor changes.

    Mihai

  16. #136
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    hi Mihai
    thanks for info but a little problem more. i m not familiar to pascal .
    help me in that u have said.
    thanks

  17. #137
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    Hi Mihai
    I get the mikropascal 4.6 .now finally decided to use mega 2560. As is Ur firmware. Mega2560 n 644 same price here.
    But I want to learn little about Pascal
    Shabbir

  18. #138
    Join Date
    May 2006
    Posts
    190

    Re: DIY AC Servo Drive - ATMega based

    :wave:

    I've modified the code further, adding an encoder look up table, eliminating this way all calculations required for position commutation shifting. Surprise! We got more than 20 kHz for PID frequency. The only drawback is that we can not use encoders with more than 3072 PPR because ATMega 644 does not have more memory to allocate a bigger table. However I do not think we could use higher PPR encoders before because of the immense frequency of pulses they have per rotation.

    check out the latest version!

    Mihai
    Attached Thumbnails Attached Thumbnails ServoResponse.jpg  

  19. #139
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    hi Mihai
    it a grate success .
    keep it up.
    thanks
    shabbir

  20. #140
    Join Date
    Apr 2006
    Posts
    85

    Re: DIY AC Servo Drive - ATMega based

    hi Mihai
    please upload a video latest power on off n running.
    thanks

Page 7 of 14 56789

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
  •