We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi everyone, I am trying ot run a motor with the 80c51. anybody knows any good c program or asembly program to run a motor with the 80c51. thanx for any help
We really need to know what sort of motor it is. Is it a simple DC motor, stepper motor or some other type? Do you want to go forward and backwards? Do you need to control the speed and if so how accurate does that need to be. How powerful is the motor need and what sort of loads. Does the load have a high inertia? Tell us all you can...
There's an example of one type of motor control (using a C167 though) on... http://www.hitex.co.uk/c166/PID167.html ...but as has already been said, its really down to what you've got and what you want to do with it. Yours, Richard Roebuck.
Thanks Graham Well this is a 1.5 v DC motor. I am trying to make a robotic arm. The motor is connected to the gear wheels. If the motor roates then it moves the gear wheel move, which makes the arm move.I do not need to control the speed. and this is not a powerful motor. Its a small motor, which has a gear wheel connected with that and which can be run by a 1.5 v battery. Now I am writing a software to run the motor. I am hoping if anyone can help me with that. Any hlep will be greatly appreciated
Well that does sound like a very small motor and although you describe the project as a robotic arm, I guess that you have only one degree of freedom. Robots are notoriously difficult to do and the problem is control. The gearbox will give you more toque but unless it is of a very high quality you are certain to introduce slack that makes control more difficult. If you don't need to control speed, then turning on a DC motor is much like turning on any other electrical device, all you need is a power transistor. If you are actually running from a small battery then efficiency will be a serious issue – a FET or some such might be in order. If the motor is required to go in two directions, an H-bridge circuit or similar will be required. Don't forget that you are dealing with an inductive load; you will need diodes snuff out the voltages induced when the current is suddenly turned off. Although you say that you don't need to control the speed of the motor, control is required for an arm that even comes close to be called 'robotic'. If you get your basic on/off forwards/backward functionality going first, you can later add PWM to control the mean voltage applied to the motor. If you have some sort of feedback, you can then use the PWM control of voltage to control the speed or possibly the position of the arm (depending on the type of feedback). You can get feedback from some sort of tachometer that can give speed and possibly direction to. The back EMF of the motor – that is the voltage generated by the action of the motor turning as if it was a dynamo – is proportional to the speed and its sign gives the direction. Back EMF can be measured during the PWM off times or it can be inferred from a measurement of the current drawn and the known mean voltage from the PWM output. A full H-bridge and feedback is a powerful combination, it is where the real fun begins!
Intel Application Note AP-425 "Small DC Motor Control" is on the free Keil CD, or try http://developer.intel.com