Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] BLDC motor control using PIC

Status
Not open for further replies.

nafnaf

Junior Member level 1
Joined
Aug 21, 2012
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,388
can anybody guide me how to do this im using proteus BLDC star motor pic 16f877

i tried to send 1 and 0 and follow this AN857 6 phases and will run the motor clockwise
C5C4C3C2C1C0
P1 0 0 0 1 1 0
P2 1 0 0 1 0 0
P3 1 0 0 0 0 1
P4 0 0 1 0 0 1
P5 0 1 1 0 0 0
P6 0 1 0 0 1 0

but the the motor turns positive +40~ and then -50~ and error in proteus
also how can i program the hall sensors i know that it emmit pulses

any help thanks
 

You should change status of your outputs according to your hall sensors clock's inputs. You should have 3 hall sensor which are placed 120degree between them.

1_You should address which hall sensor first, second and third for clock-wise.
2_You should find which coil should be energised just after first hall sensors pulse. Then second hall sensor then hird hall sensor.

What you want to do is a simple servo driving and beleive me this is not that easy issue becouse this is closed loop control.

Please first watch and read documents below then try to do what i told you:

https://www.youtube.com/watch?v=ZAY5JInyHXY

https://www.edn.com/design/sensors/4407580/Brushless-DC-Motors-Part-II--Control-Principles

Regards.
 

thanks for that it helps a lot :D and now the motor is running CW and CCW
but
another problem is that how can i limit the speed of the motor ?

i see some people that use arduino uses POT to limit it but how can i use it in PIC ?

thanks
 

thanks for that it helps a lot :D and now the motor is running CW and CCW
but
another problem is that how can i limit the speed of the motor ?

i see some people that use arduino uses POT to limit it but how can i use it in PIC ?

thanks

Speed of bldc is depend on current or voltage of windings. You can control current sourced or voltage applied to windings in order to control speed. POT means limiting the current. You can add fixed resistance or pot in series to motor windings if you dont have any hesitations about power consumption. Applying power (or driving mosfets this is according to your design) with PWM is more power saving method that is why people prefer to use it rather than using resistor.

Can you please post your C source code? There may something i should learn, i am also working on BLDC drive. Thank You.

Best Regards.
 
Last edited:

Hey all,
There should be (well with most BDC and BLDC motors) some sensor that relays the back-emf created by the windings back to the PIC.
On the PIC, the line should go to a ADC port which then checks it against a known (probably through trial and error) range of voltage-speed levels.

I believe there is another way to calculate this. If you are using PWM to control the motor, the duty cycle of the pulse directly relates to the amount of
voltage applied to the motor. The length of the duty cycle over the period (can be expressed as a fraction) times the input voltage to the motor
gives you the voltage the motor should be receiving. From there, the data sheet should provide a graph correlating speed and voltage.
Example: You create some PWM code that has some arbitrary period, lets say 10ms (make it easy on ourselves). Assume the output voltage on the line
is 12V (typical operating voltage for a motor). We want the motor to run at a third of its total speed.

( L(dcycle) / L(period) ) * V(motor in) = V(supplied to motor).

I could be wrong, Ill wait for someone more knowledge able to come around and correct me if I am

-Joshua
 

Hey all,
There should be (well with most BDC and BLDC motors) some sensor that relays the back-emf created by the windings back to the PIC.
On the PIC, the line should go to a ADC port which then checks it against a known (probably through trial and error) range of voltage-speed levels.

I believe there is another way to calculate this. If you are using PWM to control the motor, the duty cycle of the pulse directly relates to the amount of
voltage applied to the motor. The length of the duty cycle over the period (can be expressed as a fraction) times the input voltage to the motor
gives you the voltage the motor should be receiving. From there, the data sheet should provide a graph correlating speed and voltage.
Example: You create some PWM code that has some arbitrary period, lets say 10ms (make it easy on ourselves). Assume the output voltage on the line
is 12V (typical operating voltage for a motor). We want the motor to run at a third of its total speed.

( L(dcycle) / L(period) ) * V(motor in) = V(supplied to motor).

I could be wrong, Ill wait for someone more knowledge able to come around and correct me if I am

-Joshua

No you are right joshua. Siwtching (Buck-Boost) DC-DC coverters are also working in this principle in order to step down the voltage. But you should not avoid the frequency response of mosfets you are using. Some mosfets are not suitible for switching operations.

Regards.
 

Hi All, anybody can share your c code here. i am also working on BLDC sensor-less design and using protues for simulation.uC -PIC 18F2331

Thanks

- - - Updated - - -

I think they are using POT for voltage reference ie, pot connected to ADC and read voltage. this ADC value using for PWM duty cycle. ADC will read 0-5V voltage and it covert to 0-1024 (10bit) digital data. this digital data can be use directly for PWM duty cycle register for getting 0-100% duty cycle.

thanks.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top