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.

help, motor speed control!

Status
Not open for further replies.

UroBoros

Advanced Member level 2
Joined
May 5, 2004
Messages
642
Helped
19
Reputation
38
Reaction score
8
Trophy points
1,298
Location
Cochin - India
Activity points
6,463
moc7811 speed sensor

Hai,
This is not an industrial project, a college project.

A small dc motor with no load ;only a disc attached to the rotor ( for demo only). I have to enter the speed in RPM through a keyboard and the motor should attain that speed and display the speed on a lcd.
Give me some guidelines for starting.
Like to do it in 89S51 with software PWM or by any means if possible. Like to avoid a PWM engine if possible .

Please suggest

Picstudent
 

moc7811 opto interrupter

First of all you will need an encoder that will feed back at least one pulse per revolution to your microcontroller.
This can be done by attaching a small magnet to the disk and positioning a hall-efect sensor so it can sens passing magnet and generate a pulse.
As most of sensors will work of +5V its output can be fed directly to your microcontroller INT pin.
Now write the Interrup service subroutine that will calculate RPM. For this you will need real time such as 0.01s, 0.1s...this depends on RPM.
If an internal timer is started by the INT falling edge and started and stoped (with the count captured) by next INT falling edge you will have number of pulses per revolution. You will have to relate this number to minutes and "bingo" you have the calculated RPM.
How to connect PS/2 keyboard and LCD display yo can find out somewhere in this forum (use keywords and search).
When your your microcontroler increases RPM of the dc motor it will compare these two number: one from the keyboard and the secon, calculated RPM from the hall-effect sensor. Once the number are equal, the microcontroller should slow/stop changing PWM and display the current RPM on the LCD screen.

Please let us know how is it going.
 

    UroBoros

    Points: 2
    Helpful Answer Positive Rating
using moc7811

Hai
Thanks for the reply.
Hall sensor is not localy available now I am looking in metro cities for that, Should be able to locate that sooner or later.
What about the idea of using an IR led and a receiver placed on either side of the rotating disc fixed in the shaft ? The dics will be having a hole and for each rotation as the hole passes across the IR led and sensor ,the IR receiver will give a falling edge.Can we use this old method here?
Is it practical to generate a PWM within the same microcontroller considering the present constraints for measuring the RPM? because I plan to use 89S51 which is without a PWM module.

Thanks again
Picstudent
 

control number of revolutions for motors using ir

Picstudent said:
Hai
Thanks for the reply.
Hall sensor is not localy available now I am looking in metro cities for that, Should be able to locate that sooner or later.
What about the idea of using an IR led and a receiver placed on either side of the rotating disc fixed in the shaft ? The dics will be having a hole and for each rotation as the hole passes across the IR led and sensor, the IR receiver will give a falling edge.Can we use this old method here?
Is it practical to generate a PWM within the same microcontroller considering the present constraints for measuring the RPM? because I plan to use 89S51 which is without a PWM module.
If you have opto-slot-sensor, then you can built the following encoder yourself.
 

    UroBoros

    Points: 2
    Helpful Answer Positive Rating
measurement of motor speed lcd microcontroller

Thanks picotube for the information.
I have collected one opto slot sensor.
No datasheet ,no information I was about to collect.
MOC7811 from motorola is the part . +,D are the terminals on one side and +,E are the terminals on the other side.( Motorola website seem to have no details about this part)
One side diode and one side phototransistor .I think so. D may be the diode side? Any info?
Picstudent
 
information about interrupter moduleic moc7811

In my opinion:

'D' -> Detector (phototransistor)
'E' -> Emitter (photodiode)

I think we should be able to find out which side is diode/photodiode by using multimeter. If my guess is correct, '+' for 'D' side should be the collector of the phototransistor, whilst '+' for 'E' side should be the anode of the diode. Make sure the current through photodiode is less than 50mA (typical maximum rating of the diode of opto interrupter/slot-sensor). So, you need to add a resistor in series with the photodiode to limit the current. Good luck.
 

    UroBoros

    Points: 2
    Helpful Answer Positive Rating
moc7811 pin details

"Is it practical to generate a PWM within the same microcontroller considering the present constraints for measuring the RPM? because I plan to use 89S51 which is without a PWM module. "

You probably can do it with 1 microcontroller however to make things more transparent I would separate the calculation of the RPM from the PWM.
 

    UroBoros

    Points: 2
    Helpful Answer Positive Rating
moc7811 opto sensor datasheet pdf

Hai,
I have completed the RPM calculating part and the lcd part.
I am using keil. I have done the lcd in 4 bit mode with busy check which uses only one port.
Now the programe asks for the Rpm values to be entered from a keyboard and stores the same in ram .
using the optoslot sensor the programe calculates the current rpm and it is being displayed.
The motor now running on a variable dc for testing purposes.
Now i have to include the actual speed control to this motor using a software pwm(I am using 89C51).For that i propose to use a timer of the chip and use interrupts to drive the mosfet. (please suggest)
What should be the pwm frequency for my small dc motor( from a VCR )which runs around below 3000 rpm in below 12V.

Expecting your valuable suggessions
Picstudent.
 

slot sensor + dc motor speed measurement

Picstudent said:
Now i have to include the actual speed control to this motor using a software pwm(I am using 89C51).For that i propose to use a timer of the chip and use interrupts to drive the mosfet. (please suggest)
What should be the pwm frequency for my small dc motor( from a VCR )which runs around below 3000 rpm in below 12V.
Some designers use timer to produce the PWM signal. You may read this article ( **broken link removed** ). In the article, the author mentioned 20kHz was used in his project to control the motor.
Article said:
... to achieve a PWM frequency around 20KHz thereby allowing the motor to run without producing any audible PWM noise.
In my opinion, there is no an absolute answer for the value of PWM frequency that should be used in dc motor speed control. It's dependent on the requirement of your design (e.g. low acoustic noise, efficiency, etc) and also the motor characteristics (e.g. rating, dynamic response, etc). For example, I tended to use 10kHz to drive my motor. Unfortunately, the motor could not start or work smoothly. Then, I reduced the PWM frequency to 5kHz, then everything became OK. I remember a user in this board (can't remember his nickname) suggested to use 16kHz. However, fan controllers from Microchip ( **broken link removed** ) uses only 30Hz to control fan.

May be the following article will help you to decide the frequency you use in your application:
Suppressing Acoustic Noise in PWM Fan Speed Control Systems
https://ww1.microchip.com/downloads/en/AppNotes/00771b.pdf
 
  • Like
Reactions: an143remo

    UroBoros

    Points: 2
    Helpful Answer Positive Rating

    an143remo

    Points: 2
    Helpful Answer Positive Rating
speed sensor+ small motor+microcontrolers

H friends,
I have completed the project to my satisfaction ,may not be perfect.
.
It uses 89S52 for control of lcd ,keyboard and motor.
Rotation is sensed by the opto slot sensor suggested above.
the programe asks for the reqd speed in RPM which we can enter through keyboard. the motor attains that speed in seconds!!.
As I have used a small dc motor from an old VCR I have tried speed upto 2500 RPM in that . My motor cannot run above that .
But in slower speeds that is below 400rpm the motor is not smooth. I have not paid much attention to pwm frequency because I have used a timer arrangement something like a pwm ,not perfect.
I am a beginner to C.this is developed in keil.I am sure there are a lot of other shortcut possibilities for my routines. I will be thankful if anybody could suggest the mistakes i have committed in this or improvements that could be made.
I have uploaded the entire project files and a schematic in circuitmaker format.
Expecting your suggessions
Picstudent
 
89s51 lcd 4 bit

@Picstudent

Cool !!!

Have yo updated this ? Have you included quadrature signals.

Slotted optos are available.. are reflective types available ?

What price ?

Great work !
 

opto sensor moc7811 details

can you upload the ckt here for ready ref, i am not having the software for *.CKT.?
thank you
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top