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
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.
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