Quantcast
Channel: MYCNCUK - Electronic Project Building
Viewing all articles
Browse latest Browse all 14

Build Log: Servo Drive and VFD with vector control

0
0
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 :rolleyes:). 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:	35 
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:	32 
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:	40 
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:	40 
Size:	1.17 MB 
ID:	12490Click image for larger version. 

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

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

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

Testing with 3kW spindle:

Click image for larger version. 

Name:	IM_test.png 
Views:	42 
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:	39 
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:	41 
Size:	1.07 MB 
ID:	12496Click image for larger version. 

Name:	ServoDriveV2.png 
Views:	42 
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.
Attached Thumbnails
Click image for larger version. 

Name:	GUI_typical.png 
Views:	N/A 
Size:	20.8 KB 
ID:	12487   Click image for larger version. 

Name:	Eddy_Brake_2.png 
Views:	N/A 
Size:	1,009.4 KB 
ID:	12488   Click image for larger version. 

Name:	Wound_Stator.png 
Views:	N/A 
Size:	1.07 MB 
ID:	12489   Click image for larger version. 

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

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

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

Name:	Motor.png 
Views:	N/A 
Size:	1.09 MB 
ID:	12493   Click image for larger version. 

Name:	IM_test.png 
Views:	N/A 
Size:	1.23 MB 
ID:	12494   Click image for larger version. 

Name:	VelControllerStep.PNG 
Views:	N/A 
Size:	36.7 KB 
ID:	12495   Click image for larger version. 

Name:	ServoDriveV1.png 
Views:	N/A 
Size:	1.07 MB 
ID:	12496  

Click image for larger version. 

Name:	ServoDriveV2.png 
Views:	N/A 
Size:	1.10 MB 
ID:	12497  

Viewing all articles
Browse latest Browse all 14

Latest Images

Trending Articles



Latest Images