[ cyb / tech / λ / layer ] [ zzz / drg / lit / diy / art ] [ w / rpg / r ] [ q ] [ / ] [ popular / ???? / rules / radio / $$ / news ] [ volafile / uboa / sushi / LainTV / lewd ]

λ - programming

/lam/bda /lam/bda duck
Name
Email
Subject
Comment
File
Password (For file deletion.)

BUY LAINCHAN STICKERS HERE

STREAM » LainTV « STREAM

[Return][Go to bottom]

File: 1446604413095.jpg (126.09 KB, 480x622, vertical.jpg) ImgOps Exif iqdb

 No.11421

Perhaps I've been looking in the wrong areas, but it seems that most common programming guides instruct new users the basics, then how to design software for use in phones and computers; phone apps, operating systems, macros, calculators. All of the aforementioned things are great and I use them every day. However, my immediate reason for teaching myself to code is to design automated and remote-controlled versions of production systems such as greenhouse pH and humidity controls.

Are there any recommended books or guides explicitly for writing programs that communicate with non-computer machines? I'm currently learning both C and Python for this purpose.
>>

 No.11429

Thank you for this thread OP.

This is exactly what i've been looking for. I want to learn to make vertical farms completely automated and accomodated for different climates

>>

 No.11430

File: 1446617171547.png (307.8 KB, 1480x1812, control.png) ImgOps iqdb

>>11421
I would suggest Forth, which is used extensively in these kinds of environments.

Here is a Forth book which details good design and also has some material (more of an aside, really) on how to build systems in the way you describe:
http://thinking-forth.sourceforge.net/
http://thinking-forth.sourceforge.net/thinking-forth-ans.pdf

Good design involves writing a primitive that allows you to change or read the value you want to. You then design your system in terms of your collection of primitives. If an aspect of your system were to change, you would simply modify the primitive.

An example would be a memory mapped device. All you would need to do is write a word or two to change and read the necessary memory locations. Everything else uses those words to communicate with the actual hardware.

>>

 No.11437

Only difference is that you need some interface to communicate with non-computers. Is this the part you are interested in?

>>

 No.11454

>>11421
Nice farm.
What interfaces does your hardware have?

>>11430
>Using a pocket calculator language just because it's "used extensively"
Why?

Also, if you can, avoid C and other languages that require manual memory management, unless you need a throughput of a billion data values per second.

Go full industry. Use SCADA. (jk)

>>

 No.11462

File: 1446651771544.jpg (3.22 MB, 4160x2340, sweetlordwhy.jpg) ImgOps Exif iqdb

>>11437
Yes. I'm looking to design software that can both read sensors and communicate with pumps, as well as controllable from either a pc or phone.

>>11454
>What interfaces does your hardware have?

For the time being, I don't own any hardware. I'm wrapping up my last semester of university and I'm currently trying to decide what kind of system to go with. I have years of experience working on farms and studying horticultural science, so I'd like to get into it myself as soon as I can. At the moment the market has a lot of over-expensive proprietary designs that I think are exploiting the fact that many older farmers don't know software. Pic related runs on fuarrrking windows 98. I think we can do better.

>Also, if you can, avoid C and other languages that require manual memory management


So assembly it is then? Present Day, Present Time! AHAHAHAHAHA!

No but seriously, for a project of this manner, what language(s) do you recommend I consider?

>>

 No.11515

>>11462
we need a whole lot more information to help you with this

How are you interfacing with the hardware? arduino, raspberry pi GPIO, some other way?

How will your remote control setup work? is it wired? if yes what type e.g. tcp/ip stack and ethernet? custom signalling? or wireless? zigbee? 802.11 wireless? some other type?

how are you going to interact with these devices (as a user)? web interface? application on a pc? signalling over serial connection?

will the devices need enough smarts onboard for general purpose computing e.g. each device has it's own control panel and can be upgraded? or will all the devices in a site be controlled centrally? how would the devices be enrolled to a control station? How will the devices be secured? will they have built in limits e.g. a chick incubator might have a lower bound for temperatures to prevent someone from turning the temperature to 0 degrees? are these enforced on the device or if applicable the controller?

In the end you might need to use multiple programming languages.

>>

 No.11555

>>11421
Well that are a lot of them. The term you're looking for is microcontrollers. Micros are the go between from full pc to the real world. Generally the manufacturer will publish a guide on how to get up in running, or there will be a book published about using it. For some of the more popular controllers there are communities and forums that offer guides on how to setup the controller.

First I'd try using the arduino. The website is awesome, there are great youtube videos on how to setup controller and the IDE uses a simplified version of C to make programming easy. Nearly every electrical project has an arduino program already made for it.

>>

 No.11559

>>11555
Ive been meaning to get into arduinos for a while. I have the starter kit and everything but I dont know enough low-level C to do anything useful and I want to be able to write the programs myself.

What are some things you can do with an arduino besides making the led flash?

>>

 No.11561

File: 1446766329672.gif (1.97 MB, 400x273, 1446295730392.gif) ImgOps iqdb

>>11462
For low level programming Id go with ruby, preferably ruby on rails.

>>

 No.11562

File: 1446766779800.jpg (306.82 KB, 1644x1319, PLC L4 5-40E A.jpg) ImgOps Exif iqdb

OP I've scrolled past your thread like three times now and I just cannot believe you didn't come across PLCs if you researched this.

Hardly a soul in the industry uses "computers" to do {automated, remote-controlled, sensor, control system} processes. These keywords should lead you directly to Programmable Logic Controllers.

PLCs generally don't have C or Python, but skillpoints in those languages will not go to waste. You'll have to buy a PLC, you'll have to use strange new languages, you'll have to lock yourself into the integrated environment of your vendor feudal lord. Still, it beats writing control systems in C, let alone python, on hardware that doesn't provide you the interface you need to plug all your sensors and actuators in.

PLCs are built for this purpose. If you want to see what it's like you can get a free trial of development software on Codesys' website.

Drop those "IoT platforms" and come do some real automation.

>>

 No.11564

>>11562
yeah, op who barely knows how to do C , is going to drop thousands for PLCs and learn ladder logic and buy industrial sensors for his weed farm.

or he could buy and arduino and a couple of sensors from sparkfun for about half the cost. Also sparkfun has great tutorial on all of there products. While industrial equipment doesn't necessarily have great tutorials.

While I do agree that PLCs would be great if you want to drop about 25k on the project and would be an awesome project. However I think op will probably only want to spend 1k max and you can even buy Allen bradley in that range.

Oh and fuarrrk automation direct.

>>

 No.11604

>>11559
The first thing you need to realize is that everything is really some variation on flashing an LED. I've spent the last four year learning how to be an EE and flashing an LED is the most important job.

as far as getting started this looks like a good video https://www.youtube.com/watch?v=U2fUvCFNyI0 from MIT and starts at the very beginning.

what you need to understand is that on a base level the arduino is development board. Development boards are used to highlight the abilities of a particular chip or system. The uno has the ATmega328P as the brains of the board. Micros like the ATmega328P are literally in everything electronic anymore. I just googled arduino hydroponics and here are some of the links I found.

http://www.instructables.com/id/Hyduino-Automated-Hydroponics-with-an-Arduino/
http://openhydroponics.org/
and several others

>>

 No.11605

>>11421
>>11562
On the tought of PLC: look up the sites of Fanuc and Siemens, they have huge PLC program lines, tons of models and as much documentation.
It should be either free or very cheap because the more people know how to use their stuff, the more people will buy it.

Another big thing is LabVIEW, which is also used a lot in high energy physics experiments.

You might find general treatises by looking for books on "industrial automation" or "process control" on sites like avaxhome or torrents.

>>

 No.12045

>>11454
>avoid C
Wat?! OP wants to do embedded systems, C is a must for this kind low-level design.

>>

 No.12063

>>12045
People for some reason equate 'embedded' and 'low-level' as if we'd still work with 256 bytes of RAM in every node. I have no idea why. Controlling your greenhouse is very high level. You care about temperatures, not about where in RAM you store the strings for the status display, etc.

>>

 No.12064

>>11421
>Are there any recommended books or guides explicitly for writing programs that communicate with non-computer machines?
Even hearing someone say this is a bit strange. You'll have to have a computer somewhere along the line if you want to do any programming. You might prefer creating your automation with circuits if you just can't stand computers as a concept, but maybe you'd want to look into Arduino tutorials?

>>

 No.12066

>>12063
If you're going to do the whole systems, you need a way to exchange and access data from addresses in sensors, MCUs, set up communication protocols, sampling rates, control systems etc. Stuff you can't do with your webdev languages. Of course, if this already done for you, and you only need some sort of simple automation between yourself and high-level interface of the system, then it is most probable that all you need is the API they provide. But if that's the case, then you're not really doing any embedded systems design.

>>

 No.12075

>>12066
>programming an embedded system isn't "embedded systems design" unless you do it all yourself in C

Whut

>>

 No.12083

>>12063
>temperatures
>high level

lol

>>

 No.12085

>>12075
you can do it in another language if you have some kind of compiler that translates your high level code into C using the libraries and features for the particular mcu architecture you're using(like using MATLAB to design control systems and then implement them in an arduino with their code generator). However, in order to take into account certain details and optimizations, a thorough knowledge of C, assembly is a must if you want to understand better how the mcu works. You can't simply a code monkey for embedded stuff.
To further expand, you(or some other anon) talked about only caring for temperatures, not the RAM. However, temperature values do no take an infinite range of values, and cannot be represented in a computer with 100% precision(do to the digital nature of computers). Knowing how registers and data type works help you asses how to manipulate the temperature reading your sensor throws at you, it lets you know that needing more precision means shrinking your range of values you can represent and viceversa in a constrained environment.

>>

 No.12096

>>12066
not that I recommend it, but you can do usb/serial communication and gtk widgets from within PHP so, all you need is the linux kernel and your favorite interpreter

>>12085
The error margin of the sensor is probably bigger than the error introduced by rounding the value to the next 32-bit integer. And Python can handle arbitrary precision numbers.

>>

 No.12104

>>12096
Most sensors are built with the capacity compensate for measurement and/or internal errors. If not, they're documented in a datasheet and you can make the calculations to compensate. For real-time applications, Python is sub-optimal on itself since it's a interpreted language unless, again, you have a C code generator or a compiler for Python. That's okay if you're going to do complex stuff but if all you want to do is read from sensors and display them on an lcd, then just learn some C and get it over with.

As for your other point, you can definitely do that if you use a microcomputer like a Pi. You can read tru serial and display it on a monitor or something. In that case, you don't necessarily PHP, just any language you're familiar with.

>>

 No.12124

>>12104
>Most sensors are built with the capacity compensate for measurement and/or internal errors. If not, they're documented in a datasheet and you can make the calculations to compensate.
Yeah, but like he said. The error margin is going to be bigger than anything introduced by floating points. What kind of plant suffers from a temperature less than a few degrees of?



Delete Post [ ]
[ cyb / tech / λ / layer ] [ zzz / drg / lit / diy / art ] [ w / rpg / r ] [ q ] [ / ] [ popular / ???? / rules / radio / $$ / news ] [ volafile / uboa / sushi / LainTV / lewd ]