Page 5 of 12

Re: DIY Timelapse project

PostPosted: Tue Nov 19, 2013 2:47 am
by teetee
good luck with the test mate!
:grin:::::

Re: DIY Timelapse project

PostPosted: Tue Nov 19, 2013 12:06 pm
by godzilla
cheers bro!
The update is good, right now its still running :)

Its reached 210 thousand movements since I started the test, so I think the problem was resolved with the changes I made last night, hurray!
awesome, now I can think about mounting this servo board onto the robot tonight and readying the arduino to be driven from the raspberry pi. pleased with progress so far this week, if I don't hit any other gotchas then by the end of the week the whole system should be starting to operate as I want :P

Re: DIY Timelapse project

PostPosted: Thu Nov 21, 2013 11:36 pm
by godzilla
The servo controller got strapped onto the robot yesterday and wired in tidily, also mounted the raspberry pi on the top. The original arm I did for the pi camera, I found to be just too heavy to cope with.
Basically when the robot moved forward a step, it was enough to put the servo arm into heavily oscillation. Basically it was not designed to control a very large torque like that. So some major weight reduction in the arm happened. The old steel frame was removed and now the arm is just a piece of balsa wood cut to the size I need and stuck directly on the servo horn. It very lightweight and good rigidity so there is no longer the oscillation problem, and its more than strong enough to cope with the weight of the tiny pi camera board.

Id ordered a longer 50cm ribbon cable for the pi cam last week (standard one is very short!) , so I mount the camera, fed the cables down and into the pi. Now I was able to power back up the pi along with the robot, all good so far. Now back to sorting out the raspberry pi timelapse functions and adding the movement control into it also.

Bit of a detour getting the robot sorted, feels like a while since I last booted the pi! nearly there tho, the grand plan is coming together nicely :grin:

30.JPG

Re: DIY Timelapse project

PostPosted: Mon Nov 25, 2013 1:45 pm
by godzilla
Got the robot fully under control of the Raspberry Pi over the weekend. Arduino's USB is plugged into the Raspberry Pi, and so the Raspi makes use of the virtual serial over that.
I started with the simpler method of setting up the port with the STTY command and trying to simply send the command to the port and echo "MV=1" >> /dev/ttyACM0 but that did not work so well.
Since the Arduino Mega 2560 board does a RESET when the DTR line on the serial is detected, the command from the raspi happens before the arduino has started up. After doing some reading I had to give up on that path. If DTR could be controlled by the Raspi, then the reset could be disabled, but it cant. There is another HW hack to stick a 120ohm resistor across a couple of pins on the arduino, but Im not in favour of that since I do want it to reset rather than run for 90 days (avoids issues which take longer to happen than Ive tested).

In the end the solution is quite tidy. I used python on the raspberry pi to send the command, it can open the port, wait for the arduino to startup and then send the command needed. I have a few scripts which can be called from the command line.

This one takes a value as an input parameter and sends it on to arduino. It will set the horizontal servo to a position.

-------------------
import sys
import serial
import time

commandString = "HS=" + sys.argv[1] + '\n'

print commandString

port = serial.Serial("/dev/ttyACM0", baudrate=9600, timeout=3.0)

time.sleep(1.5)

port.write(commandString)


-------------------

From the command line, its run like this ; python servoHS.py 1450
The servo will jump to that position about a second and a half later.

Similarly I have some scripts to handle the vertical servo and the forward/backward movement of the tank base. So it should be a case of some bash scripting between now and done, just syncing and setting the schedule of the periodic tasks, and some final testing :)

Re: DIY Timelapse project

PostPosted: Tue Nov 26, 2013 2:18 am
by godzilla
managed to settle down and get a good bit of progress with the project tonite!

Thinking about how to deploy the system easily, I put together a useful utility. It's a small PC application that connects to the Pi via SSH/Shell connection, over the network. So far I added a bunch of buttons that are all working now, making it easy to nudge the robot, move the camera arm, test the grow lighting, white lighting, flash LED... also just finished a pretty cool feature - to check the image that the Pi-Cam sees there is now a button for it. It takes a picture with the Pi-Cam and saves it to a temp file, then sucks that over the network onto the PC (via SSH/SCP) and opens it in the windows picture viewer. Just press, wait a few seconds while the progress bar goes, and the image pops up. Will be real useful to be able to do all this easily during setup, or even to log in and check the view to plan the next movements of the robot etc. Will save me untold amounts of typing out bash commands from memory im sure :)
Tomorrow will expand it more to be able to preview also the shots from the additional web cams. Also think about how it can be used to program the next few days movements, I figured it wont be a linear growth so this will allow me to track and adjust every few days along the grow.

31.JPG

Re: DIY Timelapse project

PostPosted: Tue Nov 26, 2013 6:19 am
by teetee
Hi Godzilla, thanks for another couple of blinding posts there. When you started this, you wanted to produce a low cost controller with all the extra features.
Looking at how much effort and brainpower that has gone into this, you can see why they charge so much for all in one controllers. A controller like the Harvest Master will cost well over a grand and still not do all that yours will, so if you were to market this, would you offer the 'plans' or would you construct the equipment. and how much would that all cost??? (Don't worry, I'm not after one.....yet). What I'm getting at is that you shouldn't sell yourself short mate!
As always, looking forward to the nest installment!
:grin:::::

Re: DIY Timelapse project

PostPosted: Wed Nov 27, 2013 1:40 am
by godzilla
hi teetee.
First thanks for your interest, helps drives things along to know others are interested :)

Yes, was thinking also the other day about what can come out of all this. I reckon in its current form its something that maybe most would assume too difficult to follow, but great info for the techy minded and might inspire or some of the info might help someone else along. Theres a lot of different things Ive been looking into so I wondered where to define the boundaries of what. I think the timelapse robot is interesting in its own right and could be useful even outside the growers community. Maybe a couple of versions of that like low cost "home" version, and an industrial grade few K system..... I wonder if any of the professional seed companies or others could use something like that. an enhanced version, with a couple of DSLR's lets say turning out timelapse in 3D, with automatic plant tracking etc.. on a johhny 5 tank base :)
I guesse the thing to do is go on with the "open" project and lets see the results, gauge if there is any interest if folks would want one of these things!

Re: DIY Timelapse project

PostPosted: Wed Nov 27, 2013 2:17 am
by LEDDWCRigger
Build and sell the actual hardware profiles and rover, provide a pre-compiled end-user runtime and source code for free.

Example, I'm sure you could find a TON of busted laptops that utilize essentially the exact same webcam (I know several HP/Compaq models use the same camera, so there are hundreds of thousands of them out there!) and be able to salvage those tiny boards and make them work for the little rover.

Once you've standardized the initial design, that is. :D

Re: DIY Timelapse project

PostPosted: Wed Nov 27, 2013 3:54 am
by teetee
It's like being on Dragon's Den :lol: Next we'll have Deborah Meaden offering her extensive network of Pensioners growing weed in the North East as a firm client base fighting it out with Peter Jones and his well known connections with Worldwide Drug Cartels.
The problem with technology is that some fucker will come along and pinch all your ideas. What I like most about this project is that you are genuinely having fun doing it and for sharing it with us. I bet there's stacks of people keeping an eye on this giving you good karma.
:grin:::::

Re: DIY Timelapse project

PostPosted: Wed Nov 27, 2013 12:07 pm
by godzilla
lol teetee that is quite funny, pensioner network :) Maybe you are more right than wrong who knows!!!
LEDDWCRigger - yes that was the model I was thinking of, leave the SW side open, they can modify and adjust and use as they like, maybe construct their own robot, or if they prefer get hold of the official HW platform for it which could be sold. Arduino and Rasp-Pi have those kind of licensing anyway so that a solution built around them needs to be open. Trouble there is that an open hardware will just get picked up by sparkfun or the likes and there is no benefit to the creators, that's what happened with BusPirate, and others probably.
But a hardware kit with a special optional adaptor or info on how to connect for Arduino , that would allow some protection for a little while anyway.

There is also another thing, when we buy things marked as "development only", it doesn't need to go through all the electrical, safety, immunity tests that an end product does. Something off the shelf working would require some investment up front to get to something that can legally sell. but then that's also a barrier to others copying it later :)

theoretical parallel lineup;
* open source project with development grade supporting HW for purchase. this is the feeder.
* Low cost commercial "home grade" timelapse platform, proper control SW etc, based on commercial micro subsystem.
* High end "industrial" system, all the bells and whistles.

First is the least risk for sure. third is easiest to analyse the market and what it will pay money for.

some interesting thought and input from the both of you, thanks guys!