![]() | ![]() | ![]() |
| | |||||||
| Robotics Chat Specific to discussions about robots and the making of. |
| | Thread Tools | Display Modes |
| | (permalink) |
| New Member | Hi, I want to control a dc motor with serial port. The speed should vary according to value at serial port. 1 to 7 bits for speed control 8th bit should control the direction of the motor. 1-CW,0-CCW Please help me Its urgent for my UG project. I am mechanical student and an electronic newbie |
| | |
| | (permalink) |
| Super Moderator | Hi, First of all you'll require a serial to parallel converter to convert your serial data from serial port to parallel, then digital PWM generator which will change the pulse width (and finally the average DC voltage across the motor) depending upon the output of serial-to-parallel converter and finally a H-bridge to drive the motor in either direction. Or the other option is to use a microontroller which will directly generate PWM pulses to drive H-bridge. But that will require a knowledge of assembly programming and since you are a mech. student I won't suggest you to go for it. I would like to say that you are making things more complicated out over here. If you use parallel port, it will remove the serial to parallel stage.
__________________ "There is no way to peace, peace is the way!" |
| | |
| | (permalink) |
| Experienced Member | yes, but serial is easier to send by radio or something else. but if your robot will be controlled with a cable, i suggest you go for paralel. the programming is easyer too. |
| | |
| | (permalink) |
| Super Moderator | How about an RS232 line driver (for voltage shifting). Serial data (now 0 -- 5v) into microcontroller. Microcontroller decodes (simple shift register job) to parallel. Microcontroller uses 7 bits to output an analogue (128 steps) value for speed to a power transistor as an emitter follower (allows higher current). Microcontroller outputs 8th bit to a relay for reversing the motor. If the microcontroller can output analogue then magic, if not then build a simple D-A with 7 binary-weighted resistors and an op-amp buffer. The lot could be as small as 3 off 8 pin ICs and a transistor. Hey, if this is single direction RS232 then skip the line driver and use a resistor and zener ? I was thinking of suggesting my old favourite the 6402 UART and a host of other bits but the above could be more elegant ? ################## What's this thing about serial being harder to program than parallel ? I reckon the opposite is true, my pocket PC serial port is easy in BASIC, I just send it a number or character. The parallel port (printer) is unreachable! Similar thing on my Sinclair ZX81 (now in storage) and Amiga A500+; all proper computers, not like this Windoze/Intel conspiracy !! ##################
__________________ I need a memory upgrade ... My head is full ! |
| | |
| | (permalink) |
| New Member | yes parallel is easy, but i am driving two steppers with it. So i guess there is only serial port left for communicaton |
| | |
| | (permalink) |
| Experienced Member | but why do you need 8 bits for 2 steppper motors? you can use some simple ic to control them only with 4 bits. do you get me? then you will have 4 more bits for the other things. |
| | |