electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

dsPIC30F for Motor Speed control


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> dsPIC30F for Motor Speed control
Author Message
yokel



Joined: 13 Nov 2008
Posts: 14


Post02 Jan 2009 9:41   

dspic motor control


Dear All,
I am using dsPIC30F3011 for controlling 3 sensored BLDC motors. For running the motors, I am using BLDC motor drivers. My MCU in this case has to just input 3 things to these motor drivers- (1) PWM signal of certain dutycycle (2) The CW/CCW direction (3) The Start/Stop instruction. I can also extract the current speed information of the motors from the pwm signal served by the BLDC drivers.

In my system, I have to change the speed and direction of the motors very frequently: My MCU can do that easily by setting the PDC value of pwm input signal (to the bldc driver) from 0-1000, where at PDC=0 the motor comes to a stand still. The problem is, the transition time to change in speed is much higher.

For exaple, now the motor is running at a speed corresponding to PDC = 500. Then if I change it as PDC = 0 (or any higher or lower value), the motor speed start decreasing and the total transition time taken for the speed to become 500 to 0 is quite high. Please tell me, if I want the motor to come to its new speed value instantly (ASAP) what should I do? Please keep in mind all the operations in my case here are done through the bldc drivers and I have very little things to do from my MCU (as far as I know).

Please let me know if you need any further information.

waiting eagerly to hear from you.
Back to top
btbass



Joined: 20 Jul 2001
Posts: 1187
Helped: 113
Location: Oberon


Post02 Jan 2009 11:48   

pwm dspic


You can normaly apply a brake to a brushless motor by simultaneously grounding all the phases.
If you are driving the motors via motor drivers, you can not do this.
Some motor drivers have a brake input.
What happens if you apply a Stop command to the drivers, do the motors Stop quickly or wind down slowly?
If they Stop you could use this to transition through the speed change.
What happens if you change direction, does that help to slow it down?
Back to top
yokel



Joined: 13 Nov 2008
Posts: 14


Post02 Jan 2009 12:07   

dspic30f pwm


1. If I send STOP command to the drivers the motor stops instantly. But the problem is- if I want to start it again, there is a delay to start the motor after sending the START command.

In my system, I have to start and stop the motor very frequently. That's why I choose the SPEED_0 command instead of STOP so that I can avoid the starting delay. If I stop the motor with SPEED_0 then it starts to rotate instantly as I send SPEED_500 (eg.) command. As I mentioned, the transition time in all these cases is the problem here.

Moreover, all time I send START or STOP command there is a click sound in the driver before starting or stopping of the motor. That's really annoying, as I have to continuously on and off 3+3=6 motors in the system. Actually it's one of the main causes, for which I don't want to send STOP or START command to the driver once I start the machine.

Another important issue is my problem is not only related to stop or start, I want to decrease the transition time for any speed transition (if possible make it near to zero)

2. If I change the direction the motor changes it's direction instantly but it's speed doesn't decrease at all, even if I change the direction in time of any transition of speed change.

3. I will look for the BRAKE input in the motor driver and let you know


Thanks a lot for the nice answers and suggestions. Please let me know if you have more directives.
Back to top
Google
AdSense
Google Adsense




Post02 Jan 2009 12:07   

Ads




Back to top
btbass



Joined: 20 Jul 2001
Posts: 1187
Helped: 113
Location: Oberon


Post02 Jan 2009 16:00   

pid dspic


What if when slowing down, you just give it a very short blip of reverse, so it doesn't have time to reverse, but slows it down?
Back to top
yokel



Joined: 13 Nov 2008
Posts: 14


Post05 Jan 2009 4:22   

dspic c30 delay.h


btbass wrote:
Some motor drivers have a brake input.


Hi,
I have found a braking option in my motor driver and it works fine. In the driver, there is an input point for the motor braking and if I give some input there the motor comes to a halt without any transition time and starts instantly to move with the same speed (though with a huge vibration Sad ) when I remove the input.

Now I need some programming tips from you. The motor-brake works in the same manner for both 1 or 0 input in the brake input point of the driver. How can I work with that? If I want my motor to brake for input 0 and start again for input 1 or vice versa, what should I do? I have to give this input from my dsPIC30F3011.


Thanks a lot to you for being so helpful to me
Back to top
btbass



Joined: 20 Jul 2001
Posts: 1187
Helped: 113
Location: Oberon


Post05 Jan 2009 18:33   

dspic dsp.h


That seems a little strange, normaly you would have 1 for go and a 0 for brake or vise versa?
You will have to study the data sheet of the driver chip. There must be some information about it there. What driver chip is it?
If it is true that the brake action happens on a transition from 0 to 1 and 1 to 0, you could AC couple it using a series cap and resistor to ground at the driver chip side.
You will have to experiment and try somthing like,
motor at 500,
apply brake,
motor at 400
apply brake,
motor at 300.
To try to get a smooth transition.
Back to top
yokel



Joined: 13 Nov 2008
Posts: 14


Post06 Jan 2009 3:06   

dspic30f


Quote:
That seems a little strange, normaly you would have 1 for go and a 0 for brake


Ya, it seems very strange to me too. But I have tested it and the datasheet doesn't have any clarification about this issue. Anyway, I have got an idea. I will connect the brake input with default 1 or 0 point through a Transistor/Mosfet switching and the Mosfet switch will be triggered by a signal from my MCU. If you have any better idea please let me know.

Please tell me if I don't want to use brake due to huge vibration after resuming the motor, do I have any option to make my transition time for speed variation smaller? How about using PID controller? Please give me some tips on how I can implement the PID controller in my case using dsPIC30F30. I have found that if I change the amplitude of the voltage of my input PWM signal the rpm of the motor also changes for a certain PWM duty cycle.

Thanks again and again for helping me

with regards,
Kamrul
Back to top
btbass



Joined: 20 Jul 2001
Posts: 1187
Helped: 113
Location: Oberon


Post06 Jan 2009 18:30   

motor control dspic


If you are using the Mplab C30 compiler, (which is a very good compiler, a port of gcc), you will find a PID is included in the dsp library. If you look in the header file, 'dsp.h', which is located in \MPLAB C30\src\dsp\include, you will find the function prototypes at the end of the file.
If you search Microchip web site you will find examples of using the PID for motor control.
Back to top
yokel



Joined: 13 Nov 2008
Posts: 14


Post07 Jan 2009 10:32   

programming dspic for motor control


btbass wrote:
If you are using the Mplab C30 compiler, (which is a very good compiler, a port of gcc), you will find a PID is included in the dsp library. If you look in the header file, 'dsp.h', which is located in \MPLAB C30\src\dsp\include, you will find the function prototypes at the end of the file.
If you search Microchip web site you will find examples of using the PID for motor control.

Actually I also have code samples for PID control. As I have said you, the only output I give to the driver is a PWM signal of certain duty cycle (which indicates the speed), the direction and the start/stop instruction. My question is PID means change in the output voltage. Here how can I change the voltage as I dont have any control over it?

Thanks a lot to you for all the supports.
Back to top
btbass



Joined: 20 Jul 2001
Posts: 1187
Helped: 113
Location: Oberon


Post07 Jan 2009 19:05   

dspic pid


Quote:

Here how can I change the voltage as I dont have any control over it?

By changing the duty cycle!
The duty cycle is effectivly the voltage applied to the phases. By changing the duty cycle you change the power delivered to the motor.
The PID controls the duty cycle fed to the motor
Back to top
yokel



Joined: 13 Nov 2008
Posts: 14


Post08 Apr 2009 11:35   

dspic pwm


Ok.
It's done now. I had nothing to do in my MCU as it's there in my motor driver. In the driver by changing the resistance of a particular pot, the acceleration value of the motor can be changed.

Thanks a lot to all for all the supports
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> dsPIC30F for Motor Speed control
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
best way for speed control of dc motor (3)
blower motor Speed control for AC in car (2)
Scaling concern for dc motor PID speed control (1)
Motor speed control for small 120V. AC. fans? (10)
Motor speed control - operates well at low speed only (2)
2 push button to control pwm signal for speed of motor??? (1)
Mplab programming codes for 16F877A to control motor speed (1)
analog control of dc motor with pid controller for speed con (2)
speed control of DC motor with inner current loop control (3)
speed control of DC motor with inner current control loop (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS