. .

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Over the past 8 months, or so, I've designed and prototyped a servo motor controller. In short, I had to do a project for my final year at university, hence I asked if I could make a servo drive for a CNC machine (with a particular machine in mind ). I started by getting a cheap motor from hobbyking and finding out what would be required to run it as a servomotor. The design I've come up with can run different types of motors and uses the vector control algorithm to accurately and efficiently control the motor torque.

    Here are some specifications:

    Ratings:


    • 240VAC single phase (only tested up to 100VAC, will try mains soon).
    • 8.5A line current with no fan up to 40°C ambient - more possible with better cooling.
    • 18-24VDC@300mA required for logic.
    • With the motor from Hobbyking, about 1kW (so slightly OTT).


    General features:
    • Vector control - can operate in position, speed and torque control modes.
    • Tuning of controllers via GUI - can test step response, measure torque vs speed, etc.
    • Mains is isolated, some inputs also isolated (so single or double isolation depending).
    • Hardware over-current/over-voltage protection (adjustible).
    • Software over-current protection (partially inherently implemented, trivial).
    • Drive temperature readout / protection.
    • LEDs and switches for something (not really sure what).


    Motor types supported:
    • Permanent Magnet Synchronous Motors: (PMSMs, i.e. most modern servomotors, motors from hobbyking). Sensored only, but working on sensorless control.
    • 3-phase Induction motors (e.g. spindle): The common 2.2-3kW spindles work well. Vector controlled currently only if sensored (not tested), harware supports sensorless so will work on adding that. Tested and works fine with Vf control and SVPWM - so slightly better than the cheap drives that come with the spindles, but potential for a lot more at a lower cost.
    • Single phase induction motors: (not tested, but don't see why not).
    • DC motors: (for those that live in the 19th century



    Could be implemented (just requires programming):


    • 6-Phase PMSMs: Algorithm worked out, still under development, requires 2 drivers.
    • Stepper motors: Limited performance possible with one driver per motor, could run 3 motors from 4 drivers but that's getting a bit silly and I don't really see much point in pursuing it, as although a cheap mains voltage stepper driver would be nice ... a cheap mains voltage servo driver is nicer.


    Encoders supported:
    • Quadrature, differential and single-ended signalling.
    • SSI and SPI protocol (common for absolute encoders).


    General I/O:
    • USB via RS232 converter (GUI uses this, but can configure for other things)
    • Few spare pins which can be mapped to any spare peripheral the PIC supports (e.g. RS485, SPI ...)
    • Step/Dir (Could also configure these for quadrature input, which is advantageous as can obtain higher step frequency)
    • Isolated fault indication output.


    In addition to the usual methods to control the driver, I made an interface using MATLAB, so you can adjust all the controller gains and try different tests (e.g. measure torque vs speed characteristic of load) by clicking buttons. Here's an example - graph shows q-axis current controller (part of the vector control algorithm - torque is proportional to q-axis current):

    Click image for larger version. 

Name:	GUI_typical.png 
Views:	863 
Size:	20.8 KB 
ID:	12487

    I rewound the motor, to make the current ratings more reasonable and enable it to be driven directly from the mains (instead of requiring a big expensive PSU):
    Click image for larger version. 

Name:	Wound_Stator.png 
Views:	770 
Size:	1.07 MB 
ID:	12489

    To test the motor under load I made an eddy current brake, which worked well:
    Click image for larger version. 

Name:	Eddy_Brake_2.png 
Views:	1065 
Size:	1,009.4 KB 
ID:	12488

    Here's some pictures of the motor parts with the housing I machined to hold the 17-bit encoder and adapt the mounting to Nema 23. Note the flexible PCB:

    Click image for larger version. 

Name:	Motor_exploded.png 
Views:	1478 
Size:	1.17 MB 
ID:	12490Click image for larger version. 

Name:	NemaCover2.png 
Views:	945 
Size:	1.01 MB 
ID:	12491Click image for larger version. 

Name:	Flex_PCB.png 
Views:	812 
Size:	1.11 MB 
ID:	12492Click image for larger version. 

Name:	Motor.png 
Views:	827 
Size:	1.09 MB 
ID:	12493

    Testing with 3kW spindle:

    Click image for larger version. 

Name:	IM_test.png 
Views:	1010 
Size:	1.23 MB 
ID:	12494

    Typical step response (note load inertia of brake is *VERY* high compared to CNC router/mill, so response is not as fast):

    Click image for larger version. 

Name:	VelControllerStep.PNG 
Views:	863 
Size:	36.7 KB 
ID:	12495

    The position controller step response isn't so good - it oscillates quite a bit, but I think I know how to solve that now so I'll try it again when I have time.

    Last but not least, here's the actual driver - first version of PCB made using toner transfer, 2nd one got made professionally (both use SMT components):

    Click image for larger version. 

Name:	ServoDriveV1.png 
Views:	909 
Size:	1.07 MB 
ID:	12496Click image for larger version. 

Name:	ServoDriveV2.png 
Views:	866 
Size:	1.10 MB 
ID:	12497

    This was quite a big project (barely scratched the surface with this post) so any questions welcome. I might upload some videos, but I don't think there's much point as I'm sure you can imagine what a spinning motor looks like...

    I have not yet decided how I should take this project further - namely make it just open source, open hardware, both or neither. My next step will be to make some more and test them on my CNC mill and router.
    Last edited by Jonathan; 29-05-2014 at 03:51 PM.
    Old router build log here. New router build log here. Lathe build log here.
    Electric motorbike project here.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Closed loop Step Servo Drive Driver 2HSS86H + 4.5N.M Motor + Encoder
    By george uk in forum Motor Drivers & Controllers
    Replies: 20
    Last Post: 23-06-2014, 08:38 PM
  2. Servo drive problems
    By Tomnewry in forum Motor Drivers & Controllers
    Replies: 15
    Last Post: 27-03-2013, 11:30 PM
  3. servo control vs stepper control
    By Peter. in forum Motor Drivers & Controllers
    Replies: 24
    Last Post: 17-09-2012, 08:36 AM
  4. NEW MEMBER: I am going to build a 3 axis servo control
    By markey1979 in forum New Member Introductions
    Replies: 8
    Last Post: 16-11-2011, 12:53 AM
  5. drive control system
    By oadamo in forum General Electronics
    Replies: 1
    Last Post: 22-05-2011, 07:30 PM

Bookmarks

Posting Permissions

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