Page 4 of 12

Re: DIY Timelapse project

PostPosted: Tue Nov 12, 2013 12:55 am
by godzilla
got few more things done on the timelapse robot.

been sorting out the camera's pan/tilt system recently. I've got a couple of servos to use and tried to drive them off the arduino but was a bit unhappy with the resolution and jitter from the arduino. it can do 8 bit pwm, so 256 steps in the servo range kind of course.
what Ive done is make use of some handy MSP430 USB FET debuggers that I had lying around. This is a 10 buck USB debugger and target microprocessor, handy.
Ive made up a little test board to get that system running, what it does it act like an I2C slave and drive a servo using its hardware timers. This way I have 2500 or 3000 steps in the servo range. This has proved to be a LOT more accurate and precise. This will mean we can make minute, precise adjustments to the camera angle day by day. This system is about 80% up and running. few bits more to tidy up and it'll be ready for the arduino to drive it.

the raspberry pi is still going to be in charge of things, as well as driving all the timelapse functions, its going to tell the arduino robot what to do. basically move position or camera pan or tile angle adjustment.
the pi will plug by USB to the arduino, the usb-serial connection will allow the pi to command the arduino robot.

made up a little diagram of whats going or about to be going on to make it more clear ;

23.jpg

Re: DIY Timelapse project

PostPosted: Tue Nov 12, 2013 9:28 am
by teetee
In my house I have old copies of Heat lying around, I have old pizza cartons... lying around. YOU Godzilla, have MSP430 USB FET debuggers lying around!!!
Your attention to detail is amazing, jut cant wait for this to be up and running... are you gonna soak some beans soon?
:grin:::::

Re: DIY Timelapse project

PostPosted: Tue Nov 12, 2013 12:32 pm
by godzilla
lol. its true I have some pretty strange things lying around, from years of tinkering. I think the FET debuggers I used to learn something of the MSP430's a while back when I wanted to convert my rc heli to a brushless motor tail instead of the brushed one. and I had one of the much bigger msp430's running controlling some led lighting in a very specific way (which might be interesting for grow lighting also...ill come back to this one day im sure, probably when I have a sealed chamber and lots of sensors to gauge photosynthesis rate with :) )
the problem I usually have is finding the right weird thing when I actually need it!

preparing for the second layer of the robot now, the pi, camera and servos will sit on the top ;

24.JPG

Re: DIY Timelapse project

PostPosted: Tue Nov 12, 2013 12:50 pm
by godzilla
..soaking some beans soon yes hopefully!!!
I guesse this has dragged on a bit esp with adding the robot and pan /tilt etc. the timelapse itself is happening OK a good few weeks ago.
then again as I been out of the country a fair bit in the last weeks, I would not have started it up then anyway.
Need to sync it with the timelapse robot getting done, since I want to record from day 1. ill have to mount the rest of the robot up, fiddle with the servo drives till I can control pan/tilt OK from the arduino, then add some commands and get the pi to drive the whole lot. then I got some more tweaks to do on the pi to sync the movements into its timeplan for the grow.
when all that's done I got to mount the whole kit. the timelapse control box on the wall feeding down to the tank... then check the video and work out how far its going to go and how the camera will pan/tilt.... plan the sequence, then update the pi code to do that... then test run for day or two I guesse.
still a bit to do till its ready to roll. need me a technician helper. or one of iron man's helper bots.

anyway, alongside the timelapse robot build, I've set aside some space for the new grow and mylar'd it nice, i'll drop some pics when its looking a little tidier. had to find a corner with enough space for the robot to back away several foot outside the grow area.

Re: DIY Timelapse project

PostPosted: Wed Nov 13, 2013 11:55 pm
by godzilla
Ok top level of the robot is on, and the servos are mounted up with the arm that will have the pi-camera on the end :)
25.JPG


26.JPG


27.JPG

Re: DIY Timelapse project

PostPosted: Mon Nov 18, 2013 12:34 am
by godzilla
good news to report peeps, another step closer!
the weekend task was to get the robot arm servo's up and running, and now they are. took an evening or two with a soldering iron and then fiddling around with the coding but now its up and running - im well chuffed :)
Never made a slave device before, that's useful.
Had to write a library for the arduino to program the servo also, another first for me, though that was wonderfully easy, as most things with arduino.
Working with the MSP430 is a bit (lot) more work than the arduino for sure, had to get my head around things again with that. Soldier on with confidence and you get there.

so whats working now.. I can call a library function setServo() command which I built for the arduino, and it will send a message across the i2c interface over to the servo control board. the control board shifts the signal (5V) to 3.3V level for the MSP430's to manage. Both MSP430 have their own address and each control a servo. the msp's pick up the i2c message and set their hardware PWM generator to the specified value. The PWM signal is amp'd back up to 5V and then passed to the relevant servo.

pi ---> arduino ---> servo controller --->servos


this is the chain of command, so everything from the arduino on we are good now. Just the pi that needs to tell the arduino what to do next then the bot is under the pi's ultimate control and I can start finalising and testing few other things and finally sync everything together.

I reckon I'll try and squeeze few things into this week and see how it goes, maybe i'll be ready to start setting this thing up in place the week after.

here's the servo control board, the new addition to the robot frame. managed to keep it tidy and small.

28.JPG


29.JPG

Re: DIY Timelapse project

PostPosted: Mon Nov 18, 2013 4:21 am
by teetee
Godzilla mate, how on earth do you maintain such high levels of concentration to do this??? While smoking high grade??? Just reading it taxes my brain, but I must admit, you do make it all make sense! When I read your posts, I hear a younger, more enthusiastic version of 'Q' out of James Bond! Keep it coming!
:grin:::::

Re: DIY Timelapse project

PostPosted: Mon Nov 18, 2013 9:43 pm
by LEDDWCRigger
It's really mostly simple algebra (except the coding. I'm more of a raw hardware person.)

Soldering is simple, heat joint, apply solder, remove solder and iron. Be swift and be precise, like a needle and thread (unless you're using some of that thick rosin flux solder, then you just gotta pray you don't get spattered upon!)

Re: DIY Timelapse project

PostPosted: Mon Nov 18, 2013 10:23 pm
by godzilla
copious amounts of smoke my friend, then I can sit down and concentrate deep. probably most prefer not thinking too hard once they had a smoke but I reckon I do my best work after a little mind opening. I guesse I wouldn't be alone really, there quite a few people we can think of who did their best work off their heads be it artists or musicians or comedians.
like most things it might seem daunting at the onset but if you get in there knee deep and with perseverance you WILL work it out ! I always try something new along the way, not just same old tricks, so to keep learning. with practice you screw up less and get closer to right first time :)

the soldering itself is easy you are right leddwcrigger, but takes a while to put together something complex, getting it neat and proper first time requires some forethought and planning. working out what needs soldering where is the more fun bit for sure. that little board took about 4 hours to solder together I think !

and to the coding, still not quite perfect with the servo controller. I left it in a continuous cycle last night to soak test, but in the morn the servos had stopped their pattern of movements :(
Made a couple more tests earlier and after a few K cycles it does halt for some reason... there is a gremlin :o
doing some debug now, I think the arduino side is clear, no memory leaks or power issues I can detect. I think the MSP430's i2c state machine needs a get out of jail handler in case any comms mismatch. Good job I soak tested it and picked up on that early, after all I need all those things working for super-extended periods of time so have to make sure things are perfectly stable. 70-90 days runtime is a serious amount of on time!

Re: DIY Timelapse project

PostPosted: Tue Nov 19, 2013 12:46 am
by godzilla
looking good for another soak test tonight, injected some code in the msp430's to guard against getting locked in any state except idle and ready :)
got it running on an accelerated test now, 4 times as many ( but smaller) alterations to the servo positions, driven by arduino. Finger crossed its still running in the morn :lol:

plus I figured another thing - the way I will connect the arduino to the raspberry pi is using USB. Every time that serial interface is opened, it actually does a reset of the arduino (and the msp430's hanging off its 3.3v suppy). So every time the pi accesses it, it will have been reset and running "fresh". In this case I don't need it to be 90 day stable really, its going to get reset at each use anyway.

I decided to try and test the changes anyway since it would be nicer if its perfectly stable for extended continuous operation. Theres a good chance I might re-use the work here later for something totally different no doubt, probably in a year or two when getting knee-deep in it again to resolve the issue will take more effort! A tidy hi res i2c > pwm controller is a useful thing. esp since all this monkeying about with robotic stuff has got me wanting to built me a proper robot. something much bigger and challenging, bipedal, or johnny 5 style ...
I'll stick it in the queue with the other "one day..." projects like getting a 3d printer together :lol:

blimey, test made nearly 10 thousand moves on those servos already.