Shop OBEX P1 Docs P2 Docs Learn Events
Position Controllers from a PC via USB — Parallax Forums

Position Controllers from a PC via USB

AlkarexAlkarex Posts: 30
edited 2012-06-11 01:46 in Robotics
Hello,
I have a question on how to control from a PC via USB the Position Controllers of the Parallax "Motor Wheel Kit with Position Controller".

I have ordered the "Motor Wheel Kit with Position Controller" (#27971), 2

Comments

  • Ray0665Ray0665 Posts: 231
    edited 2011-01-16 06:22
    I havn't looked at the links you provided but off the top it would seem obvious that

    PC-->[custom software]-->motion controller --> HB25 --> motor... would be the top level

    where [custom software] becomes
    ... --> usb (or serial) bidirectional interface--> command interpreter --> motion controller driver --> ...
  • AlkarexAlkarex Posts: 30
    edited 2011-01-18 06:04
    Thank you for your answer Ray.
    I have no problem in controlling the HB-25 from a PC (via a USB Servo Controller).
    However, the Position Controller of the kit have precisely the role of motion controllers and I would like to use them if possible (they are able to control a HB-25 and use some information from the position encoders).

    In a nutshell, I would like to find a way to interact with the Position Controllers from a PC via USB (in order to control speed, acceleration, but also get finer position control and feedback).

    Any suggestion?

    Best regards,
    Alexandre
  • AlkarexAlkarex Posts: 30
    edited 2011-01-22 06:34
    Hello,
    I have been searching like crazy, and I have found an adaptor that could maybe work to connect from USB to the Position Controllers:
    Basic ATOM Nano USB2Serial Adapter #B0083
    http://www.basicmicro.com/Basic-ATOM-Nano-USB2Serial-Adapter_p_35.html
    Like the Position Controllers, it is using a 1 wire bus, but I am not sure that it is the exact same concept.
    The 3 pins of this adapter are defined as:
    • SER pin is a bidirectional serial I/O (Transmit bidirectional serial data, CMOS drive output 5VDC, TTL input 5VDC)
    • RES is the reset control pin (Controls target RESET pin, 5VDC output)
    • GND is the common (VSS).
    However, in the case of the Position Controller, the 3 pins are defined as:
    • DATA, Communication line used to send and receive data – Connect to single-wire UART bus
    • +5V Regulated DC Supply Voltage (VCC)
    • GND Common Ground

    Could someone please confirm or refute that this adapter is compatible with the Position Controllers?
    Thanks,
    Alexandre
  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-22 08:09
    It looks like the Basic ATOM Nano USB2Serial Adapter should work. You'd have to make some connection adapter since the pins don't match up. You'd connect the SER pin of the Adapter to the DATA pin of the Controller and you'd connect the two GND pins together.

    Look at the schematic for the Basic ATOM Nano USB2Serial Adapter. You'll see that it uses what's called diode logic to implement an OR gate between the transmit output of the FTDI chip and the receive input of the chip with SER connected to the receive input. When the transmit line is high (idle), it's effectively disconnected. When it's low, it pulls SER low. That's exactly what you want.
  • AlkarexAlkarex Posts: 30
    edited 2011-01-22 09:38
    Thank you Mike for your response, which is very useful :smile:
    I think I will give this adaptor a try then.
    Mike Green wrote: »
    It looks like the Basic ATOM Nano USB2Serial Adapter should work. You'd have to make some connection adapter since the pins don't match up.

    I am not sure I understand when you say that "the pins don't match up". If I understand you correctly, I have to connect "the SER pin of the Adapter to the DATA pin of the Controller", +5VCC pin to +5VDC pin, and GND to GND, which are in the same order on the adapter side { SER, VCC, GND } and on the controller side { DATA, VDC, GND }.

    If this does work, it could be an idea for Parallax to have a similar and tested item in store.

    For the record, here are links to two other relevant discussions on a related topic, which I have discovered after I had started this thread:
    All the best,
    Alexandre
  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-22 09:59
    There is no +5V pin on the position controller side. DO NOT try to connect the +5V pin on the Adapter to any pin on the position controller.
  • AlkarexAlkarex Posts: 30
    edited 2011-01-22 10:45
    Mike Green wrote: »
    There is no +5V pin on the position controller side. DO NOT try to connect the +5V pin on the Adapter to any pin on the position controller.

    Thank you for the warning, as this is what I would have done... :innocent:

    But now I am lost, and feel my lack of knowledge in electronics.
    On the controller side, the three pins are { DATA, +5 VDC (Regulated DC Supply Voltage), GND }. Should'nt this "+5 VDC" pin get connected to something for the controller to get any power? The problem lies probably in the fact that I do not understand the difference between the "+5 VDC" pin of the controller and the "5 VCC / RES" pin of the adapter (the name of this pin varies: VCC on the picture, RES in the documentation).

    Thank you again for your time.
    Cordially,
    Alexandre
  • G NagG Nag Posts: 2
    edited 2012-03-25 10:23
    I have the same problem, were you able to solve it in the end?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-25 10:49
    Hopefully you've resolved your issue.

    The adapter provides a limited amount of current at approximately 5V (5V VCC or Vdd). This current comes from the PC's USB port and is limited to 100mA when the USB serial port is active. Depending on how the adapter is designed, it may provide up to 500mA after it negotiates this with the PC. Unless you know how much the controller draws at 5V and how much the adapter can supply, it's best for you to have a separate 5V regulated power supply that is designed to supply the amount of power that the controller requires. There are all sorts of AC powered +5V regulated supplies available that would work.

    Note that RES is very very different from VCC. Most Parallax microcontrollers use their reset input to force the microcontroller into download mode. The adapter's RES output is intended to connect to the reset input for this purpose.
  • AlkarexAlkarex Posts: 30
    edited 2012-03-26 02:54
    Dear G Nag,
    No, I did not have sufficient time to dig more into this issue, and I ended up doing without the position controllers (also due to the fact that I had doubts concerning to their ability to allow driving straight and then turning smoothly without having to stop in between).
    However, I am still very much interested in a documented way of how to use them...
    Thanks to Mike Green for the support so far.
    Best regards,
    Alexandre
  • G NagG Nag Posts: 2
    edited 2012-03-27 23:40
    Thank you Mike Green and Alkarex
    I'll dig into this issue until it is solved and tested. Then I'll make a simple documentation for it.

    Alkarex: I just want to make sure. Did you buy the Nano USB2Serial Adapter and didn't work?
    or you just didn't have time to try it? I'm planning on trying it first.
  • AlkarexAlkarex Posts: 30
    edited 2012-03-28 16:25
    G Nag wrote: »
    Alkarex: I just want to make sure. Did you buy the Nano USB2Serial Adapter and didn't work?
    or you just didn't have time to try it? I'm planning on trying it first.
    No, I did not try the USB to serial due to my doubts that even if this communication worked, the position controllers might not be working as I intended.
  • princeplanetprinceplanet Posts: 2
    edited 2012-05-30 21:59
    Alkarex,

    I ran across a couple of your posts while searching for a solution to the same problem. If you have come up with a solution, please let me know! If not, I am working on it and I think that the key is to find or create a class that will write to usb without any drivers (or perhaps a generic driver) . Then we can do the usb/serial conversion to send the commands to the position controller via the single line UART. It is indeed becoming a lot more complex then I ever imagined!
  • princeplanetprinceplanet Posts: 2
    edited 2012-05-30 22:06
    Oh, as a side note, one guy said the position controller did not have a 5v supply; I believe he was mistaken, the HB-25 doesn't.
  • AlkarexAlkarex Posts: 30
    edited 2012-06-11 01:46
    Hello princeplanet,
    For the time being, I am not using the position controllers at all, which is a pity indeed. I do not really understand why Parallax is not clearer about the matter :frown:
    Best regards
Sign In or Register to comment.