Speed and current control

musa
Posts: 1
Joined: Thu Nov 13, 2008 1:44 pm

Speed and current control

Postby musa » Thu Nov 13, 2008 1:52 pm

Lubin, I want to control the speed and current on the dc motor. I'm using PI controller for both current and speed control, but the controller generates the constant duty cycle. please help me I dont know what is the problem

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: Speed and current control

Postby LubinKerhuel » Fri Nov 14, 2008 1:38 am

Hi Musa,WeI have not element to help you. Provide more details ! (electronic, control scheme...)
Lubin

gdiana
Posts: 4
Joined: Sat Jul 05, 2008 11:41 am

Re: Speed and current control

Postby gdiana » Mon Dec 22, 2008 3:52 pm

Hi Musa and Lubin,

I have done this sucessfully using Lubin's demo software. See the attached Simulink model.

DEMOIO.mdl
(49.17 KiB) Downloaded 224 times


You must adjust Speed, Current and DC Voltage for your system. The controller gains will depend upon your motor size and machine parameters (Ra,La,Kt,Km,J and B).

Start with current loop first. Positive voltage must give positive current and positive speed.

I have inlcuded some info in the model. The controller may be used as is in the Simulink simulation. The PI controllers have anti-windup.

It would be better to use synchronous sampling, to avoid switching noise in the feedback signals using the PWM block, but this feature is not yet available in Lubin's blockset.

Cheers


Greg Diana

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: Speed and current control

Postby LubinKerhuel » Tue Dec 23, 2008 1:55 pm

Hi Greg,

Thanks for posting this demo and for making it nice and clear... Would you like to add a short page about this demo in the Example Category of the website? It would be great to have few more details about the motor used, its simulink model, and few curves of the closed loop response... or whatever you want... Musa could also contribute if he would like too...
Let me know (You may not have the right to create a new page on this wiki ; I will just create it and let you write...)

Few technical points about the simulink model you posted:
* Sampling time for all blocks is 10Khz except for delay blocks (1/z) which are at 5Khz. (It is very useful to use sample time colour : Format ==> SampleTimeDisplay
* 10Khz is very fast for the calculation to be done using single. You may check using the Calculus Time Step block that calculation are done within the 100us. This block will provide you with the calculation time. It's interesting also to get the free time you may have for others tasks... (You could get the numerical value of the Calculus Time Step block directly with the UART or with another PWM output)

More general question about the control scheme:
It seems that this motor is a big one (from the several amperes current you provide). I guess thus that its dynamics may be quite slow. Coupled with the very fast time step of 100us, I suspect the PWM output to be in fact use as an on/off signal (always saturate to PWMmax or to 0). i.e. it could be interesting to see if it this control scheme works when replacing the PWM output with a threshold followed by a binary Output PIN (Sliding mode).

On a similar subject, a sensorless controller for a tiny motor using Simulink with dsPIC is described in this article: http://ieeexplore.ieee.org/xpl/freeabs_ ... er=4602072

Lubin


Return to “Advanced Simulink & RTW Questions”

Who is online

Users browsing this forum: No registered users and 2 guests