#robotics Logs

Feb 16 2013

#robotics Calendar


00:07 Ademan ace4016: I wasn't articulating myself very well, this: http://www.societyofrobots.com/robotforum/index.php?topic=13598.0 is what I was getting at
00:08 RifRaf i have been making brackets for that from perspex, so i can attach an arm to the other side for stability
00:09 RifRaf you can glue a bit on the end of your servo to use as well
00:09 Ademan RifRaf: I was thinking of 3d printing a part for it if there's no currently "best solution"
00:09 Ademan removable is ideal for me
00:10 RifRaf but am still in the design stages, am finding better solutions every time i make some parts
00:10 RifRaf yes so you have a bracket that wraps around the servo then the servo sits into it, could take a picture later
00:14 GargantuaSauce_ Ademan: as far as I can see, servo brackets are inflexible and obscenely expensive
00:14 GargantuaSauce_ and thus i am printing all of mine
00:14 GargantuaSauce_ i am using small radial bearings too though
00:14 Ademan GargantuaSauce_: have handy STL/SCAD/something ?
00:14 Ademan ah
00:15 Ademan nvm then
00:15 GargantuaSauce_ but i'm sure you could get away without them
00:15 GargantuaSauce_ PLA on PLA is not particularly stiff
00:15 GargantuaSauce_ even just a basic hinge should do just fine
00:15 GargantuaSauce_ a hole and a cylinder
00:16 Ademan I was thinking hole on both sides, and a screw, two washers
00:16 Ademan er, one washer
00:16 GargantuaSauce_ that would probably work just fine
00:16 GargantuaSauce_ experiment, that's the whole fun of 3d printing :)
00:17 Ademan hehe, I would a lot more if I had my printer with me, but it's ~20 minutes away at my parents' house.
00:18 Ademan It'll move in with me into my next apartment, whenever that happens
00:18 GargantuaSauce_ well 2-3 iterations should do it anyway
00:18 GargantuaSauce_ also don't consider bearings to be a show stopper
00:18 GargantuaSauce_ http://www.aliexpress.com/item/50pcs-lot-624ZZ-624-2RS-4-13-5-Miniature-deep-groove-ball-bearing/610613340.html
00:18 GargantuaSauce_ 30 cents each
00:19 Ademan hrm
00:20 Ademan that probably is a better solution, since my idea requires thicknes of the screw head + strong-enough-wall
00:20 Ademan brb, going to get myself dinner
00:20 GargantuaSauce_ yeah i dunno about the tradeoff between weight and friction but 3.2g each is pretty inconsequential
00:21 GargantuaSauce_ considering the servos are 3-10 times that
00:21 [JIHADI] electrical programming....and psychology
00:21 [JIHADI] hold on
00:21 GargantuaSauce_ and sometimes toilets
00:40 theBear you use washers not screwheads
00:41 Ademan theBear: washer soldered to a shaft without a head?
00:42 theBear no, big washer under a small head
00:42 theBear big heads are rare and expensive
00:47 Ademan ah, I see what you're saying
00:47 theBear :)
01:20 RifRaf can't wait to make one of these for me camera
02:43 wond1ng hello,there
02:45 RifRaf hi
02:50 wond1ng are we talking about robot,something like that?
02:52 RifRaf yes please, is too quiet
02:53 wond1ng I think so....
02:53 Gargantuasauce i think the no bones is much cooler than the robot
02:53 Gargantuasauce http://www.youtube.com/watch?v=9vlkWUPhJCw
02:54 wond1ng what is no bones?
02:54 wond1ng sorry, i can't open youtube here,
08:37 delinquentme how to source a small mountable powersupply
12:55 RifRaf hrm busy night in robotics land
13:56 NightRavenXS RifRaf, ???
14:01 RifRaf NightRavenXS sarcasm, what are you up to?
14:02 NightRavenXS reading up on RF
14:02 NightRavenXS trying to understand how it works
14:02 NightRavenXS what about you?
14:03 RifRaf trying to get better with this accelerometer
14:10 ace4016 i've been trying to think up of projects to do
14:16 RifRaf ace4016 are you a C coder?
14:16 ace4016 yup
14:17 RifRaf cool, well as you know i am a newbie, but pretty happy with where i am up to
14:17 RifRaf i'd like someone to look at me code and tell me where things could be done better etc
14:19 RifRaf but just got it working how i want, will add a few comments first and pastebin
14:21 ace4016 cool
14:22 ace4016 i mmight be useless for the next few days
14:22 ace4016 i feel terribly sick
14:24 ace4016 my dog wouldn't let me stay in bed today
14:27 NightRavenXS ???
14:33 RifRaf http://pastebin.com/DDvYRrjv any comments welcome
14:48 rue_house instead of the delay in the main loop, you want to just skip loops
14:48 rue_house but I see what your up to
14:48 rue_house it works I presume?
14:49 RifRaf is working yes, but is so long
14:50 GargantuaSauce_ it looks pretty redundant
14:50 RifRaf without the little delays its hard to read numbers on lcd, cause they are then blank 1/2 the time
14:51 RifRaf cause i need to blank them out after display to get rid of stray chars that stay there
14:51 GargantuaSauce_ assuming you really need all those branches (which I think should be replaced with a single equation) you only need to have a single call to act_getSpeed and act_setSpeed
14:51 RifRaf yes am sure there is an equation, anyone can help with it?
14:52 RifRaf so the closer it gets to 0 the less of a jump the servo makes
14:52 GargantuaSauce_ well even a linear relation between valx and speed might work
14:54 GargantuaSauce_ er acceleration i guess
14:54 GargantuaSauce_ like speed -= valx/100 or something
14:54 GargantuaSauce_ if floating point math is possible on the architecture you're using that'd probably help
14:55 RifRaf ok yep, Speed == position of servo, 0= center, -127 left, 127 far right
14:55 rue_house RifRaf, put spaces at the end of the printed numbers to erase stray ones
14:55 GargantuaSauce_ oh...well that is not a very good name then
14:55 rue_house instead of printing "%d" print "%d "
14:55 RifRaf yes have floating point enabled
14:55 RifRaf rue_house wow great idea
14:55 RifRaf will do that one
14:56 RifRaf oh but the spaces might wipe out my non changing text, will have a go
14:56 RifRaf will make a video to show how it works with that code
14:56 rue_house sometimes just 1 or 2 spaces on the end is enoguh
14:58 RifRaf ok yep, have idea
15:43 RifRaf http://www.youtube.com/watch?v=Pv-yhr7GGdg
15:46 GargantuaSauce_ cool, that works better than i'd expect
15:48 RifRaf cheers
15:48 GargantuaSauce_ is that breakout just an accelerometer or is there a gyro on there that you haven't touched yet
15:48 RifRaf obviously a bug in switching to upside down, but worked fine when not filming
15:49 RifRaf just the accelerometer
15:50 RifRaf have ordered a cheep gyro as well to mess with, but only last night after seeing how cool this is
15:52 GargantuaSauce_ yeah there are 9 or 10DOF imu sensors on the market for like 20 bucks
15:52 RifRaf yep was 19.50 or so, 9dof
15:52 GargantuaSauce_ cool
15:53 RifRaf got some more of these for like $2 though, maybe a cheap ripoff, but worth a shot at that price
15:53 GargantuaSauce_ the algorithms to produce an orientation from the three sensors are kind of complicated though, you'll want to steal code from somewhere i imagine
15:54 RifRaf this was $10 for the accel adxl345 though, the others have a different model but look like they work the same
15:54 RifRaf Gargantuasauce yes i have a lot to learn still
15:55 GargantuaSauce_ sensor fusion is one of the points i'm procrastinating on myself :P
15:55 RifRaf but finally things i think of are getting made in a few days rather than maonths
15:56 RifRaf yep, just doing alot of different sensors and drivers for now, like biulding blocks, and slowly trying different blocks together
16:17 RifRaf ok got rid of the delay and blanking screen each loop with some spaces, more responsive now
16:22 RifRaf Gargantuasauce you still about, gonna try what you said now for the speed
16:27 GargantuaSauce_ cool
16:38 eadthem Anyone know a source of morse taper spindles
16:38 eadthem im mostly interested in the shaft for the berings
16:43 rue_shop2 machine shop supplier?
16:43 eadthem dont know of any
16:43 eadthem mc master dosent
16:43 eadthem but they probably would charge a lot
16:43 eadthem ebay hasnt helped any ither
16:57 RifRaf this is fun cause its working
16:59 Tom_itx wasn't so fun the other day
17:01 RifRaf Gargantuasauce something like this? http://pastebin.com/pcyd6EQu
17:01 RifRaf is working pretty much the same as the commented out code below it
17:02 RifRaf but looks like it could still be simpler
17:04 RifRaf something that just works with number above 50 and less than -50 for valX in the one step, all the rest is repeated
17:04 RifRaf a for statement?
17:05 GargantuaSauce_ all the branches need to do (assuming you actually need the branches) is assign move
17:05 GargantuaSauce_ getspeed, setspeed can all be outside those, once
17:05 RifRaf ok
17:06 RifRaf don't need the branches, checked the maths, gives a negative answer for negative values, so all good
17:07 GargantuaSauce_ yeah
17:07 GargantuaSauce_ that whole thing can definitely be collapsed into 4-5 lines
17:09 RifRaf at 11 lines :)
17:10 GargantuaSauce_ also note that the /250 is an integer division
17:11 GargantuaSauce_ so the quotient will be zero up to valX=250 and then 1
17:15 RifRaf something wrong in line 4 http://pastebin.com/mriqtbQM
17:15 RifRaf Gargantuasauce ok might lower to 125 then, at 50 was too jitery
17:15 GargantuaSauce_ that's an interesting operator you have going on there in the assignment term of the for
17:15 RifRaf it doesn't work :(
17:16 RifRaf tells me it does nothing
17:16 GargantuaSauce_ it's both grammatically and syntactically incorrect
17:16 RifRaf not good at for's yet
17:16 GargantuaSauce_ i mean semantically
17:16 RifRaf i'd beleive that
17:16 GargantuaSauce_ the first term is supposed to be an assignment
17:16 GargantuaSauce_ the second is a comparison
17:16 GargantuaSauce_ you don't need a for loop for this though
17:17 GargantuaSauce_ look at the contents of all your ifs
17:17 GargantuaSauce_ they are all the same
17:17 RifRaf ok
17:18 GargantuaSauce_ the exact same code is being executed in either case of valZ being positive or negative
17:18 GargantuaSauce_ or valX being big in either direction
17:18 RifRaf so can i say if valX >50 AND <-50; //on the same line?
17:18 RifRaf just want it to do nothing in the almost level zone to stop jitter
17:19 GargantuaSauce_ under what circumstances is valX going to be both positive and negative?
17:19 RifRaf but maybe, since it will return 0 anyway for low numbers it does not matter?
17:19 RifRaf all the time
17:19 RifRaf left is -, right is +
17:19 RifRaf for valX anyway
17:20 GargantuaSauce_ i think you might need to reconsider this from a theoretical standpoint irrespective of the code
17:20 RifRaf ok
17:20 RifRaf like step back and look for a bit
17:20 GargantuaSauce_ yeah
17:21 RifRaf ok :), will make coffee
17:21 GargantuaSauce_ i'd walk you through the process of figuring this stuff out but I don't know how to approach it outside my intuition
17:24 RifRaf http://pastebin.com/HKt4PcAt
17:24 RifRaf thats what i got it to from 100 odd lines :/ pretty sure it will work similar, testing now
17:26 RifRaf wow it still works
17:26 RifRaf ok now to fix the rest of the code
17:26 RifRaf Gargantuasauce thanks for the tips
17:27 GargantuaSauce_ yeah no problem, i wish i could be of more direct help
17:28 RifRaf its good, i just need a direction to focus in most of the time
17:29 joga not sure what exactly you were coding there but for some reason thought about "PID controller". as for the code I think whenever there's a lot of duplicated if-else branches, there should be something else like a function instead
17:30 joga but I guess those points were already made earlier
17:32 RifRaf joga coding this http://www.youtube.com/watch?v=Pv-yhr7GGdg
17:34 RifRaf joga am getting the code smaller, will post new version when its all tested
17:38 RifRaf damn is all broken now, will try fix
17:39 joga ah...well in that sort of thing you may want to check out PID anyway or something similar to smooth the movement out, codewise it isn't a big deal but getting the response appropriate for the task needs some tweaking of parameters
17:39 RifRaf joga yep, PID is on the pist for over the next few weeks
17:39 RifRaf list*
17:40 GargantuaSauce_ it is basically the kind of control you're clumsily approaching with that code :)
17:40 RifRaf lol
17:43 RifRaf yay, fixed again, back on track
17:45 RifRaf omg even working upside down, time to post code, i know we can do better still
17:46 RifRaf 160 less lines http://pastebin.com/y6F5VX0X
17:47 RifRaf numbers need tweeking to get it as stable before when level, but so much faster at maintaining position
17:47 GargantuaSauce_ you can get rid of the valz branch (which should use if/else instead of if/if since the two conditions are complimentary)
17:47 GargantuaSauce_ by multiplying the move by the sign of valz
17:48 RifRaf yes yes, how? me reads slowly
17:49 RifRaf ok works as if/else if , now to remove it
17:50 RifRaf so soon i won't even have an if statement?
17:50 RifRaf wowsers
17:51 GargantuaSauce_ http://pastebin.com/THUcWFWA
17:51 GargantuaSauce_ that implementation of the sign function is a bit unintuitive but blame c for not having a sane one
17:52 GargantuaSauce_ err apparently it decided to ignore my changes just a sec
17:54 RifRaf it did seems different and compiles
17:54 RifRaf gonna test
17:54 RifRaf nah i am dreaming i think
17:55 rue_shop2 SWEEET
17:55 rue_shop2 my parallel port eeprom read/writer works!
17:56 RifRaf rue_shop2 nice, did you see the video?
17:56 rue_shop2 no
17:56 RifRaf only it moves better now
17:56 RifRaf http://www.youtube.com/watch?v=Pv-yhr7GGdg
17:56 GargantuaSauce_ http://pastebin.com/AjCm9ikr
17:56 rue_shop2 eadthem, kat says Harbor Freight
17:57 GargantuaSauce_ still has some issues but i cleaned it up a little
17:57 rue_shop2 Enco, praps (buy-enco.com)
17:57 RifRaf ok will test
17:57 RifRaf Gargantuasauce so use same paste link as before?
17:57 GargantuaSauce_ the one i just pasted
17:58 RifRaf oh sorry didn't notice new link :/
17:58 GargantuaSauce_ also you need to rename the damn speed variable
17:58 GargantuaSauce_ because it is not speed it is position
17:58 RifRaf ok, to speed1 and speed2 ?
17:58 RifRaf oh no cannot do that
17:59 GargantuaSauce_ name it something sane that won't completely break your mental conception of what is going on
17:59 RifRaf just something with webbotlibs, keeps things the same across all motors
17:59 RifRaf my head is dealing with it ok
17:59 GargantuaSauce_ angle
17:59 GargantuaSauce_ call it angle
17:59 RifRaf ok
17:59 RifRaf will try
18:00 RifRaf lmao, looks like there is no code left
18:00 RifRaf will test
18:00 GargantuaSauce_ and it is functionally identical
18:00 GargantuaSauce_ i did not change the way it works at all
18:00 RifRaf lol, compiles fine
18:00 rue_shop2 RifRaf, hahah cool
18:01 RifRaf rue_shop2 no retakes or i coulda make it lok perfect, but would rather show off the defects to get help fixing them
18:02 rue_shop2 :)
18:02 rue_shop2 I'm gonna work on remembering how to write audio data to these eeprom chips I have
18:03 RifRaf Gargantuasauce works a treat :) thank you so much, i learnt alot by doing it the long way
18:03 GargantuaSauce_ i love how it freaks out when you plug it in
18:03 RifRaf all along i knew there were shortcuts but just had to use what i knew
18:03 RifRaf will update the video i think once i get this smoother
18:04 GargantuaSauce_ the oscillations are definitely because moving the servos makes the accelerometer pick up linear motion
18:04 RifRaf it still freaks out at some points of rotation, but recovers
18:05 GargantuaSauce_ which your code assumes is gravity
18:05 GargantuaSauce_ linear acceleration i should say
18:05 RifRaf yes, don't gets an accurate reading unless its stopped completely, but sorta knew that would happen
18:05 GargantuaSauce_ http://www.youtube.com/watch?v=C7JQ7Rpwn2k
18:05 RifRaf just need to deal with that in the code best i can
18:05 GargantuaSauce_ this is a good lecture
18:06 RifRaf yes, will have to save that for a little later but will watch, am interested in android stuff as well
18:07 GargantuaSauce_ it's more general than just covering android stuff
18:07 GargantuaSauce_ it's for getting a sane gravity vector from a 9dof sensor
18:07 GargantuaSauce_ something that is literally impossible from just an accelerometer
18:07 RifRaf omg i just cannot believe this code is down to 50 odd lines now :/
18:07 RifRaf so manageable
18:08 GargantuaSauce_ you should probably make a function for the drawing of stuff too
18:08 GargantuaSauce_ with row and value parameters
18:08 RifRaf ok will give that some thought
18:10 RifRaf yep when Z is vertical to ground it trips out because it is not sure to keep sensor facing up or down :)
18:12 RifRaf but rarely would an arm like this have to do that, i was thinking of like if it was on a robot that had flipped over
18:13 RifRaf but mainly so i could move it all around in testing, cause i noticed it went crazy upside down
18:13 GargantuaSauce_ actually come to think of it i'm not sure the responses to x and y should invert if z is negative
18:13 RifRaf it works ok in testing
18:13 GargantuaSauce_ except when it's upside down...
18:13 RifRaf when upside down the sensor aims towrds the table at all times
18:13 GargantuaSauce_ yeah that is the result of that inversion
18:14 GargantuaSauce_ get rid of it
18:14 GargantuaSauce_ that's why it oscillates madly when upside down also
18:14 RifRaf but thats a good thing no?
18:14 RifRaf nono, that was a short
18:14 RifRaf a brass standoff on the stand rubbed on bottom of pcb
18:14 GargantuaSauce_ oh dear
18:15 RifRaf some of the sideways wild movement was because Z was vertical
18:15 RifRaf i will make new vid shortly when a bit happier
18:17 RifRaf glad i saved my last code, you have done some tricky stuff there i don't know about yet, but resembles a pointer
18:17 RifRaf i just need to compare so i can try learn
18:18 GargantuaSauce_ you mean the ((x>0)-(x<0)) ?
18:18 GargantuaSauce_ that is just a term that is -1, 0, or 1 depending on the value of x
18:19 GargantuaSauce_ the result of a comparison operator is either 0 or 1
18:20 GargantuaSauce_ and the * is multiplication, not dereferencing a pointer :)
18:20 RifRaf oh woops :)
18:21 RifRaf heh its like a wild little animal at times now this arm
18:21 rue_shop2 one of the 10 64k eeproms I got from china for $1 is faulty :/
18:21 Tom_itx RifRaf what you workin on now?
18:22 RifRaf Tom_itx that video beforew
18:22 RifRaf where you been?
18:22 Tom_itx tryin to figure out my lathe package i've never used
18:22 RifRaf self stabilising platforms
18:22 Tom_itx cad cam
18:22 Tom_itx i always did the mill stuff
18:22 RifRaf cad is always a steep curve when you use a new one
18:23 Tom_itx it's very similar
18:23 GargantuaSauce_ also RifRaf you might want to consider a slightly different approach where the accelerometer is not on the stabilized end of the platform
18:23 Tom_itx but it's more limited than my mill package
18:23 RifRaf Tom_itx scroll up to find a youtube link, posted a couple of times
18:23 Tom_itx and translating files was one of the big issues
18:23 RifRaf yeah really sucks if they don't talk the same language am sure
18:23 GargantuaSauce_ (so its motion will not affect the reading as much)
18:24 Tom_itx did you get the code working the way it's supposed to?
18:24 rue_shop2 ooo the 256k is fualty too
18:24 RifRaf Tom_itx me?
18:25 RifRaf or rue, my code works
18:25 RifRaf rue_shop2 are you sure they are all faulty?
18:25 Tom_itx yes you
18:26 RifRaf yes gettin there
18:26 RifRaf adding a small delay now to cope with the G forces generated from the servos moving
18:27 rue_shop2 RifRaf, no, just one of them
18:27 rue_shop2 and my 256k chip
18:27 RifRaf 2 you said now
18:27 RifRaf k
18:27 rue_shop2 a 64 that was 10c and a 256 that was free
18:32 Tom_itx you better get a grip on your bot or it will destroy itself
18:33 RifRaf yes, have left the servo horns loose for such happenings
18:40 RifRaf Gargantuasauce how could i move the accelerometer elsewhere and get the same effect?
18:41 RifRaf oh have it controled by a lever on the same servo but down the other end
18:41 GargantuaSauce_ no no
18:41 RifRaf oh
18:42 GargantuaSauce_ having the accelerometer on the base would let you know its orientation right
18:42 GargantuaSauce_ then you just need to solve for the two servos' angles to make the moving part level
18:43 GargantuaSauce_ it would be both more stable and responsive that way
18:43 RifRaf ok cool, thats material for thought
18:44 RifRaf on the base it would always display the same because its not tilting though
18:44 GargantuaSauce_ if the base is not tilting the platform does not need to either
18:44 RifRaf oh oh wait yes
18:45 GargantuaSauce_ :)
18:45 RifRaf i am manualy tilting the base with may hand
18:45 RifRaf oh yes
18:45 RifRaf genius
18:46 RifRaf still need to keep thinking, but you are onto something here
18:46 RifRaf no wires to move as well
18:48 RifRaf i need to work out the angles to start with eh
18:49 RifRaf get rid of speed and calculate the angles it get now
18:50 RifRaf wow yes, so i could use this to keep an arm upright and stable on a platform that moves over rough ground
18:50 RifRaf too many ideas, must focus
19:15 RifRaf ok have servos moving from -127 (-90°) to center 0° or 360°, and +127 (+90°) in a rather linear motion, so like +63 = 45°
19:15 RifRaf is this the start i need
19:16 RifRaf 180° movement in the servo horns, had to tweek setting but this is way more movement than i had before, and safe for servo
19:17 RifRaf so now will work out that formula cause will likely need it
19:47 eadthem rue_shop2, thanks, i have tryed harbor freight, but ile check them agan, there website is a bit weard
19:47 eadthem ile look at enco as well
20:06 eadthem not much luck on enco
20:06 eadthem what im looking for would be something i could put a jacobs chuck or other in
20:06 eadthem probably using a morse taper
20:08 eadthem realy just need the shaft with the morse hole and endstops for bearings
20:17 RifRaf got a third servo in the base doing nothing, i wonder how it could be used to make things smoother and more agile'
22:56 RifRaf went to the pub for a few hours, so where were we at?
22:57 RifRaf oh great, didn't miss a thing
22:58 fRaf throws an echo around the room to see how many people he can
23:04 GargantuaSauce_ bluh
23:05 RifRaf Gargantuasauce i am a bit stuck, but just need to sober up i think
23:06 GargantuaSauce_ yeah dronk coding doesnt work well till you've got a solid knowledge base :P
23:06 RifRaf i just need to move the arm parts the same amount the accel is tilted on the base, but in the opposite direction, ithink
23:07 GargantuaSauce_ yup
23:07 RifRaf yay