how to control dc motor using the USB port by binary values ? (without using controller or processor) for simple start stop operations only?

we are inneed of command for usb port enable or disable by using binary value withuout using controller or external hardwares

답변 (1개)

That is not possible. USB is a serial packet protocol that uses differential lines. The USB controller hardware has a microcircuit to do the direct control of the lines and the lines cannot be directly addressed. You cannot use USB to send a single binary value except by using the USB port to talk to a device by sending it commands to trigger the values on your behalf -- requiring external hardware. For example a USB parallel port.

댓글 수: 4

Thanks for the reply sir. Is there any way to operate dc motor using Matlab command for simply start-stop operation. is it possible by USB parallel port or serial port? then how it will be
USB ports use packetized commands -- similar to using ethernet in data structures. USB cannot hold a value or a bit: the data is bundled with headers and sent over USB and you need some kind of device to decode it into hardware signals. If you were to try a USB to RS232 or USB to TTL, then note that both RS232 and TTL serial do not permit the transmit lines to be held. A true RS232 port would permit RTS or DTR to be held, but the USB emulation of those has to send the state of those pins as digital data and the decoding device needs to somehow be constructed to hold the state.
USB to R232 or TTL, or USB to parallel cannot sustain low latency because of the master/slave polled protocol inherent to USB.
If you must use USB, then I would suggest you consider putting a Raspberry Pi or Arduino at the other side to manage the motor control; if you needed a lower latency or higher frequency than could be handled by USB ports themselves, you would build a waveform description of some sort to send to the Pi or Arduino to decode and handle the sending as required.
Thanks for the reply sir. can we use RS232 for dc motor control for start-stop operation? Is it so what is the code for that and is it be efficient for this purpose or we have to use Arduino Uno this purpose. And thanks for your valuable time for reply us.
See https://www.mathworks.com/help/matlab/matlab_external/overview-of-the-serial-port.html#f51533 . You can configure the state of the DTR pin using the serial object DataTerminalReady property; see https://www.mathworks.com/help/matlab/matlab_external/overview-of-the-serial-port.html#f51533 . This pin has only two states and is not at all suitable for PWM (Pulse Width Modification)
You have not said anything the frequency (number of times per second) you need to change the motor, or about your latency requirements (how long between the time something happens that requires a change of state, to the time the state is actually changed.) Setting the DTR pin is not intended to be used for signalling. I would not trust being able to change the state more than 2 or 3 times per second, not without testing.

댓글을 달려면 로그인하십시오.

커뮤니티

더 많은 답변 보기:  Power Electronics Community

질문:

2018년 2월 5일

댓글:

2018년 2월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by