DIY hardware interface for simple data collection and robot control?

For issues with communication ports, protocols, etc.
BasicCoder2
Posts: 3310
Joined: Jan 01, 2009 7:03

Re: DIY hardware interface for simple data collection and robot control?

Postby BasicCoder2 » Jan 20, 2018 22:34

@MrSwiss,
In fact I have never interfaced using the serial port as I found the parallel port much simpler to use until Windows prevented direct access due to the need handle conflict between two programs in a multitasking OS from accessing the same hardware at the same time. So I haven't really used QBASIC or FreeBASIC to access a serial port.

In fact I do understand that the Arduino must be programmed first to exchange data with another computer via their serial ports. However what I was alluding to was using the usb port as a usb port to your own hardware directly as I did with the parallel port rather than via the Arduino. Maybe I will blow the dust of my Arduino which I haven't played with for some time and see what I can do.

It is just so much easier if you can find working code examples.
MrSwiss
Posts: 2817
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: DIY hardware interface for simple data collection and robot control?

Postby MrSwiss » Jan 20, 2018 22:42

BasicCoder2 wrote:It is just so much easier if you can find working code examples.
If I remember correctly, I've provided you with "working" Arduino code (in Arduino C).
First, download that to the Arduino, using it's own Arduino-IDE.
All that remains to be done then, is: write the FB-code, to communicate with it.
(It needs to use the commands, that are implemented on the Arduino, of course.)

Refer to this thread, to get started: Virtual Com Port ...
BasicCoder2
Posts: 3310
Joined: Jan 01, 2009 7:03

Re: DIY hardware interface for simple data collection and robot control?

Postby BasicCoder2 » Jan 20, 2018 23:45

Well just downloaded the Arduino software to my new laptop and got the flashing LED example working.
Haven't found your "working" Arduino code yet.
Will start another thread for this project if I have any luck in getting it working.
Last edited by BasicCoder2 on Jan 21, 2018 9:31, edited 3 times in total.
MrSwiss
Posts: 2817
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: DIY hardware interface for simple data collection and robot control?

Postby MrSwiss » Jan 20, 2018 23:57

BasicCoder2 wrote:Haven't found your "working" Arudino code yet.
It's in the old thread, where we've discussed your robotics project.
FreeBASIC and Arduino communication
jj2007
Posts: 896
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: DIY hardware interface for simple data collection and robot control?

Postby jj2007 » Jan 21, 2018 13:42

grindstone wrote:@jj2007: If you know how to control single lines of such a USB to parallel cable, please let me share your wisdom. I'm trying in vein to figure out how that can be done since more than a year.
No wisdom here - I am not a hardware man. But if these converters can make a printer work, then they MUST address single lines, I suppose...
grindstone
Posts: 582
Joined: May 05, 2015 5:35
Location: Germany

Re: DIY hardware interface for simple data collection and robot control?

Postby grindstone » Jan 21, 2018 19:26

jj2007 wrote:...they MUST address single lines, I suppose...
Alas not. The cable expects a printer and refuses to work if it doesn't detect one connected.

In view of the occasion I decided to open one of my printer cables and found an IC named "PL-2305H". The manufacturer's datasheet is not very informative, but I found some interesting links:
http://thx8411.over-blog.com/pages/Add_TTL_outputs_to_your_USB_Laptop_Part_1_Hardware-3229030.html
https://www-user.tu-chemnitz.de/~heha/basteln/PC/USB2LPT/faq.en.htm
https://www-user.tu-chemnitz.de/~heha/basteln/PC/USB2LPT/index.en.htm

Especially the first one may be suitable for pupil's handicraft.
BasicCoder2
Posts: 3310
Joined: Jan 01, 2009 7:03

Re: DIY hardware interface for simple data collection and robot control?

Postby BasicCoder2 » Jan 21, 2018 21:01

MrSwiss wrote:
BasicCoder2 wrote:Haven't found your "working" Arudino code yet.
It's in the old thread, where we've discussed your robotics project.
FreeBASIC and Arduino communication

Ok. I had another look. Can't really piece it together. If I ever do I will write a proper fully explained step by step tutorial. I noted the Arduino was too slow for D.J.Peters. Also caseih wrote: By the way, BasicCoder, my little Arduino LCD screen project ended in a sort of failure. I couldn't get my code to run fast enough to keep up with the commands coming in over serial
As back then I don't seem to have the motivation to work through all this the way I used to in the old days. h4tt3n has a financial motivation.
FreeBASIC has the getJoystick() function which I just tested with a Logitech game controller so who ever wrote that function must know how it is done. I see the controller has a single chip in it between the usb port and the buttons. CY7C63231A
So the hardware from the controller along with the FreeBASIC getJoyStick function could be used to input digital data.
Although you considered the K8055 to be rubbish the fact is it worked, albeit a bit slow, to send commands and read inputs without having to solder your own versions of its support circuitry.
Last edited by BasicCoder2 on Jan 21, 2018 23:19, edited 1 time in total.
MrSwiss
Posts: 2817
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: DIY hardware interface for simple data collection and robot control?

Postby MrSwiss » Jan 21, 2018 21:57

BasicCoder2 wrote:Although you considered the K8055 to be rubbish the fact is it worked, albeit if a bit slow, to send commands and read inputs without having to solder your own versions of its support circuitry.
The 'rubbish' referres to:
    1) all Velleman products, are NOT suitable, for professional use
    2) K8055, precisions, on analogue ports, are too low (for my expectations)
I prefer a LabJack U12, any day (which I use for my commercial environmental Monitoring-SW).
  • Temperature °C
  • relative Humidity %
  • Dew Point °C
  • atmospheric Pressure hPa/mBar
which uses high precision Vaisala Transmitters (used for weather monitoring systems, worldwide).

... to send commands and read inputs without having to solder ... applies equally here.
In fact, all (used) connections, are of screw-terminal type. Unused 16 digital IO's, on 25Pin D-Sub.
grindstone
Posts: 582
Joined: May 05, 2015 5:35
Location: Germany

Re: DIY hardware interface for simple data collection and robot control?

Postby grindstone » Jan 21, 2018 22:49

MrSwiss wrote:I prefer a LabJack U12,
Now I see why you're arguing against the parallel port: You are mollycoddled! ;-)
MrSwiss
Posts: 2817
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: DIY hardware interface for simple data collection and robot control?

Postby MrSwiss » Jan 22, 2018 2:35

@grindstone, you'd better watch the words, you are using. Not amused at all.
You just seem to be a yesterday oriented person. I attempt to go with time.
(Last time I've used Parallel Port, to control HW, was 20+ years ago!)
caseih
Posts: 1300
Joined: Feb 26, 2007 5:32

Re: DIY hardware interface for simple data collection and robot control?

Postby caseih » Jan 22, 2018 5:27

Parallel ports are still commonly used to control CNC machines because they are one of the few interface standards that have direct connections into the CPU's bus and can be controlled in real time by the processor.

Parallel ports are hard to find these days, so a lot of CNC machinery and data acquisition use I/O interface boards plugged into the PCIe bus.

USB cannot be used directly for interfacing with and controlling hardware (as you can do with an Arduino) because USB does not allow real-time signalling. The USB bus and protocol just isn't designed for it. In fact gamers often go for PS/2 keyboards because USB keyboards have a latency that makes their game play more difficult, believe it or not. Like most devices attached to the USB bus, the data acquisition board you link to has it's own onboard microprocessor that does the actual ADC measuring, and reads and writes the I/O ports, and then sends the data (in response to commands) back to the computer. The USB bus is essentially a glorified serial port link that communicates between the microprocessor and the host computer. The microprocessor runs a purpose-built firmware. Just like an Arduino. But reliable, proven, and capable of high frame rates.
grindstone
Posts: 582
Joined: May 05, 2015 5:35
Location: Germany

Re: DIY hardware interface for simple data collection and robot control?

Postby grindstone » Jan 22, 2018 8:08

MrSwiss wrote:Not amused at all.
Sorry, I wasn't aware of overwhelming your sense of humor. :-7

And regarding to my "yesterday orientation": "New" doesn't necessarily mean "better", and outdated or not, IMHO for h4tt3n's purpose the parallel port (if available) is still the best solution.
MrSwiss
Posts: 2817
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: DIY hardware interface for simple data collection and robot control?

Postby MrSwiss » Jan 22, 2018 12:52

caseih wrote:Parallel ports are still commonly used to control CNC machines ...
I don't know, who told you that, but my own experience, with CNC controlled
machinery (4 axis milling machine, was new in 2007) says otherwise:
    direct connection: RS232-C (to download G-Code), aka: Serial Port (HW)
    without cables: USB-Thumb-Drive (to download G-Code)
From there on: the machines own processing unit* takes over.
(which implies also: there is no such thing, as a remote control of CNC, would be
far to dangerous!)

Only pre-processing: from CAD/CAM to G-Code, is done on a PC, for:
*Heidenhain, *FANUC, etc. common, on CNC machinery (milling/turning/pressing
/3D printing/Laser cutting/welding, and more).

FYI: programming (mostly, simple parts) can also be done, on the machines
operating panel, directly (machine setup, is always done that way).
caseih
Posts: 1300
Joined: Feb 26, 2007 5:32

Re: DIY hardware interface for simple data collection and robot control?

Postby caseih » Jan 22, 2018 15:54

Sorry, I should have been more clear. I'm aware of how CNC works, both g-code generation and execution. There are a lot of home CNC setups these days using LinuxCNC and many of them use parallel ports to control stepper drivers. These include mill conversions, 3D printers, and plasma tables. This is because parallel ports are cheap and reliable, don't require extra hardware, and can be driven in real time. As parallel ports vanish, cheap MesaNet cards often replace them. In fact, most commercial LinuxCNC installations typically use MesaNet cards or equivalent. For example, Tormach's mills and lathes. I understand that some of the larger commercial systems use ethernet to control motors. Still the G-Code execution is on the controlling computer where there's plenty of horsepower to do neat things such as integrating various custom signals into the G-code path planning system.

At this point I will say the the line between what you describe and what I'm talking about is blurred such that we're really talking about the same thing. A production Haas CNC machine, for example, is controlled by a what is essentially a full computer (with a regular CPU perhaps using a custom real-time OS) using a directly-driven hardware interface, but it's built into the chassis of the machine itself--including keyboard and monitor. The same goes for Tormach, which uses a custom version of LinuxCNC called PathPilot that runs on an integrated Linux computer. I think more and more companies are moving to off-the-shelf OS's, rather than rolling their own OS. Anyway at this point the talk of "remote control" of a CNC machine is fairly meaningless.

I do own a Flashcut CNC USB controller, which does all the g-code interpretation in a little box, and I just send it data and commands via USB (there's also an RS232 version of it). Unfortunately it's feature limited and not upgradeable, and I'll be moving down the road to a MesaNet and LinuxCNC solution (or maybe the venerable Mach3 on Windows) so I can integrate auto torch height right into the path planning system. Another possibility is a BeagleBone Black controlling stepper drivers with GPIO pins. Perhaps an integrated LCD display and keypad will be the way to go. Make it more like the integrated commercial systems.

A bit off-topic but interesting. CNC is an exciting field.
MrSwiss
Posts: 2817
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: DIY hardware interface for simple data collection and robot control?

Postby MrSwiss » Jan 22, 2018 17:34

Well, that clears it, our points of view differ, as much as possible, on the same subject.
While I talk about commercial manufacturing machinery (high precision mech. engineering).
You are more relating to the low cost implementations (the two are worlds apart, in
monetary/financial aspects).
The mill, I was referring to, cost 'naked': 1/4 Millon Bucks! (without any tools, which cost
another 1/4 Million, before production could start.)

Return to “Hardware Interfaces / Communication”

Who is online

Users browsing this forum: No registered users and 1 guest