#robotics Logs
Nov 29 2014
#robotics Calendar
01:30 rue_shop2 2.Warmup 248:-19415
01:30 rue_shop2 29c /100c ON
01:30 rue_shop2 I found another bug tom
01:31 rue_shop2 the time goes wrong
01:32 rue_shop2 interestingly enough its not a signed number
06:15 theBear gyg
12:22 anonnumberanon what's the foss alternative to HyperTerminal data logger program?
12:37 rue_shop2 minicom?
12:38 Tom_itx realterm
13:37 kurt screen -L ?
14:06 cnnx why did banebots discontinue its wheels?
15:05 anonnumberanon thanks rue_shop2 Tom_itx
15:13 anonnumberanon I thought there would be a software in the Debian repository, apparently not.
15:13 anonnumberanon Those things are rare or what?
15:13 anonnumberanon Realterm is for Windows.
15:19 LoRez or, ya know, uh, cat works on serial ports
15:21 anonnumberanon lol, using a welder to manufacture a CruiseShip
15:21 anonnumberanon I think I probably don't understand what's involved yet.
16:50 cnnx would these wheels support a 50lbs payload or are they too soft and get crushed?
16:50 cnnx http://www.robotshop.com/ca/en/lynxmotion-green-dot-sumo-tire-288d.html#Supplier%20Product%20Code
17:42 RifRaf http://i.imgur.com/mJdgKHD.jpg
17:56 rue_more heh
17:56 rue_more is it pulled togethor with elastic strings?
17:58 rue_more just_corey, are you alive?
17:59 Tom_itx snowed in?
18:02 rue_shop2 no, just came back
18:02 rue_shop2 oh him
18:02 rue_shop2 he's not answering his phone, he didn't reply at the door, and his answering machine is full
18:02 rue_shop2 he could be unconcious in a far away hospital, its happened before :/
18:03 rue_shop2 I hope not, we have some cool stuff on the go
18:05 RifRaf rue_more, yep elastic
18:07 RifRaf reprinting a few parts now to get better quality, imagine the stop motion clips you could make
18:08 rue_shop2 hey, tell me if you heard, everyone is starting to use larger tips on the repraps, 1mm is aparently the latest thing?
18:09 RifRaf nope
18:09 rue_shop2 huh
18:09 RifRaf for nylon maybe larger is bit better
18:09 RifRaf still on 0.3 - 0.35 here
18:10 rue_shop2 huh
18:11 RifRaf nozzle size
18:11 rue_shop2 apparently you keep the layer height the same and you get less problems with the only sacrifice being the inner radius is up to .5mm
18:11 rue_shop2 you can aparently print way faster
18:11 RifRaf show me your experiments to prove this :P
18:12 rue_shop2 it didn't come from me
18:12 RifRaf obviously larger tip will print alot faster, and need to feed alot more filament so maybe bigger or 2 heaters
18:12 rue_shop2 it came up with an experienced fellow who mentioned it when I told him about my 1mm to get me going
18:12 RifRaf but not same layer height
18:13 rue_shop2 well I dotn know, I still have to get the damn thing going
18:13 rue_shop2 to spite it, I'm gonna work on my cnc first tonight
18:13 RifRaf so you can print a little jointed robot
18:13 rue_shop2 I need somewhere to put all these robot arms
18:14 RifRaf not an easy print though, no flats
18:15 rue_shop2 Tom_itx, armyofevilrobots was showing me his sherline, its gathering dust
19:23 rue_shop2 I need another slide in the led display above the door that I have displaying the time
19:23 rue_shop2 right now it cycles between the time and "build robots"
19:23 rue_shop2 I need another side in the middle that says "this clock is wrong"
20:13 wolfmanjm I tried to use a 0.75mm nozzle, the issue is the hotend did not have a big enough melt zone to keep the plastic fluid, so it was flowing so fast it would cool down too much. Never did get it to work properly at speeds over 30mm/sec which defeated the entire thing
20:14 wolfmanjm maybe a better hotend would work not sure
20:14 wolfmanjm I made my own heater block out of solid copper with a heater cartridge so heat supply was not the issue
20:33 rue_shop2 thats 2 2A fuses...
20:34 rue_shop3 aha, direction and pwm lines were backwardsa
20:44 rue_shop3 no life, hmmm
20:55 rue_shop3 there has to be something wrong with this code
21:32 rue_shop3 #define Kp 40.0 /* proportionate gain */
21:32 rue_shop3 #define Plim 200 /* proportionate component limit */
21:32 rue_shop3
21:32 rue_shop3 #define Kd 30.0 /* derivitive gain */
21:32 rue_shop3 #define Dlim 200 /* derivitive component limit */
21:32 rue_shop3 error = control - position ;
21:32 rue_shop3 differ = lastError - error;
21:32 rue_shop3
21:32 rue_shop3 termP = limit(error/10, -Plim, Plim);
21:32 rue_shop3
21:32 rue_shop3 termD = limit(differ, -Dlim, Dlim);
21:32 rue_shop3
21:32 rue_shop3 reaction = ((termP * Kp) - (termD * Kd));
21:32 rue_shop3
21:32 rue_shop3 reaction = limit(reaction, -255, 255);
21:32 rue_shop3 // if (ABS(reaction) < 55) reaction = 0; // deadzone (SILENCE!)
21:32 rue_shop3
21:32 rue_shop3 SetSpeed ( reaction );
21:32 rue_shop3 prevReaction = reaction;
21:33 rue_shop3 lastError = error;
21:33 rue_shop3 anyone see anything I'm not?
21:39 rue_shop3 ok, lets try gutting the calculations
21:41 rue_shop3 iiiinteresting
21:49 rue_shop3 aaah I think thepwm is backwards
21:49 rue_shop3 0=255
21:50 rue_shop3 OK I'M REALLY CONFUSED NOW
21:52 rue_shop3 ok, inverted pwm operation and have something thats making sense
21:53 rue_shop3 but it didn't pwm to zero
21:53 Triffid_Hunter avr8 timers have a glitch where the pin still pulses momentarily at overflow if the compare value is zero
21:53 Triffid_Hunter best to just set the pin to GPIO when pwm==0
21:55 rue_shop3 sweet, is servoing
21:55 rue_shop3 oh hmm
21:55 rue_shop3 is that just on fast pwm?
22:01 rue_shop3 heh, it keeps it within a half turn at 18tpi
22:02 Tom_itx moving the table?
22:02 Tom_itx that's not so bad
22:02 rue_shop3 27 thou?
22:03 rue_shop3 it can do better!
22:04 rue_shop3 this is annoying to tune, I have to wait for the 24V 25A to power down, when they have almost no load
22:05 rue_shop3 every time
22:07 Tom_itx so hook a bulb up to it
22:08 rue_shop3 hmm, you mean an incadescent lamp?
22:08 rue_shop3 how primitive :)
22:08 Tom_itx i added a drain resistor on mine along with those 3 leds on the capacitor board
22:08 rue_shop3 how about a current control mosfet current sink?
22:08 rue_shop3 I could have it ARM controlled
22:08 rue_shop3 write the regulation loop in python
22:09 rue_shop3 :)
22:09 rue_shop3 I have a strange issue, the pwm steps seem off
22:09 rue_shop3 the first error level seems really high
22:09 rue_shop3 I get nothing for the first half turn, then it comes in with a bunch of power
22:10 rue_shop3 oh, I bet its the error/10
22:10 rue_shop3 10 steps min error
22:12 rue_shop3 that was it, now its within 5 degrees
22:12 rue_shop3 (by eye)
22:13 rue_shop3 ok, have to adjust the constants tho
22:16 rue_shop3 #define Kp 6.0 /* proportionate gain 40 */
22:16 rue_shop3 #define Plim 200 /* proportionate component limit 200 */
22:16 rue_shop3
22:16 rue_shop3 #define Kd 60.0 /* derivitive gain 30 */
22:16 rue_shop3 #define Dlim 200 /* derivitive component limit 200 */
22:16 rue_shop3 error = control - position ;
22:16 rue_shop3 differ = lastError - error;
22:16 rue_shop3
22:16 rue_shop3 termP = limit(error, -Plim, Plim);
22:16 rue_shop3
22:17 rue_shop3 termD = limit(differ, -Dlim, Dlim);
22:17 rue_shop3
22:17 rue_shop3 reaction = ((termP * Kp) - (termD * Kd));
22:17 rue_shop3
22:17 rue_shop3 reaction = limit(reaction, -255, 255);
22:17 rue_shop3 its overshooting
22:17 Tom_itx oh i forget this is a servo
22:17 rue_shop3 but I dont think I can just dial up PD
22:18 rue_shop3 Kp is already kinda low
22:19 Tom_itx lower kp and kd
22:19 rue_shop3 if I make Kd too high, it'll oversubtract from Kp
22:19 Tom_itx keep kd out of it until you get close with kp
22:19 rue_shop3 I need Kp to be higher, its not bringing the position back at 6, it did at 8
22:19 rue_shop3 but its overshooting almost every time
22:19 Tom_itx take out kd and get kp to oscillate
22:20 rue_shop3 hmm, "dial up Kp til its just unstable"?
22:20 Tom_itx yes
22:20 Tom_itx then lower it a bit
22:20 rue_shop3 yea, k
22:20 rue_shop3 or snuff it out with Kd
22:21 rue_shop3 I'm gonna guess it'll osc around 10
22:22 rue_shop3 10 is overshoot but not osc
22:24 rue_shop3 whats cool is because its a linear encoder I dont ahve to worry about error from the allthread
22:24 rue_shop3 20 is still no osc
22:24 rue_shop3 er that was 15
22:25 rue_shop3 20 is still underdamped
22:27 rue_shop3 40 is almost unstable
22:27 rue_shop3 50 is much closer
22:29 rue_shop3 60 is still underdamped
22:29 rue_shop3 (wow
22:30 rue_shop3 aha! oscilation at 80
22:30 Tom_itx now back down and add a little Kd
22:30 rue_shop3 I wonder if 70 is enough
22:30 Tom_itx emphasis on little
22:30 Tom_itx try 60
22:31 rue_shop3 ok giving Kd 6
22:31 rue_shop3 #define Kp 60.0 /* proportionate gain 40 */
22:31 rue_shop3 #define Plim 200 /* proportionate component limit 200 */
22:31 rue_shop3
22:31 rue_shop3 #define Kd 6.0 /* derivitive gain 30 */
22:31 rue_shop3 #define Dlim 200 /* derivitive component limit 200 */
22:31 rue_shop3 error = control - position ;
22:31 rue_shop3 differ = lastError - error;
22:31 rue_shop3 termP = limit(error, -Plim, Plim);
22:31 rue_shop3 termD = limit(differ, -Dlim, Dlim);
22:31 rue_shop3 reaction = ((termP * Kp) - (termD * Kd));
22:31 rue_shop3 reaction = limit(reaction, -255, 255);
22:31 rue_shop3 which means that...
22:32 rue_shop3 error rate change *6
22:32 Tom_itx lower
22:32 rue_shop3 hmm
22:32 rue_shop3 3?
22:32 Tom_itx is it int or unsigned?
22:32 Tom_itx 1.xx mabye
22:32 rue_shop3 its signed, and its bound to a total range of +-200
22:33 Tom_itx then move up from that
22:33 Tom_itx say 1.5
22:33 rue_shop3 I'll go 1, I dont think this will like me if I try to go floating
22:34 Tom_itx * 1 won't do anything will it?
22:34 Tom_itx needs to be >1 ?
22:34 rue_shop3 it can chew off a little
22:34 rue_shop3 I could try 2, see if its not too much
22:34 rue_shop3 last time Kd had to almost be as much as Kp
22:35 rue_shop3 at 2 it overshoots and rings out
22:36 rue_shop3 the sad bit is that this motor has an analog tach on it that I dont have hooked up
22:36 Tom_itx i figured it would overshoot
22:37 Tom_itx so lower Kp to 35
22:37 Tom_itx leave kd
22:37 Tom_itx that will give some room for Ki
22:37 Tom_itx 35 - 38
22:37 rue_shop3 dont have a Ki
22:37 rue_shop3 this is just PD
22:37 Tom_itx leave it at 2
22:38 Tom_itx you may want ki
22:38 rue_shop3 na, Ki introduced too much instability in this stuff last tiem for me
22:38 rue_shop3 I'm gonna go on a walk and dial up Kd to crazy numbers
22:39 hackman127 Anyone here use python? I'd like to get the status of keys pressed on the keyboard without having to go to some kind of gui like pygame. Think WASD controls.
22:39 Tom_itx not gonna work
22:39 rue_shop3 you dont think I can damp it out?
22:39 Tom_itx try it
22:39 Tom_itx then try what i said
22:39 rue_shop3 it'll only taka few mins, and its only 8
22:40 Tom_itx their pid has more than just PID init
22:41 Tom_itx they have a couple other terms i've not ever used
22:41 rue_shop3 hackman127, nope, pygame is the deal
22:42 rue_shop3 hackman127, getting raw keybaord stuff from linux is just evil
22:43 rue_shop3 yup, as I thought, toooo big a value and Kd adds to Kp instead of subtracting, so you get runaway
22:43 rue_shop3 whos stuff?
22:43 Tom_itx now back kp off and leave kd at 2
22:44 Tom_itx try 35
22:44 Tom_itx then move kd up beyond 2
22:44 Tom_itx after trying it
22:44 rue_shop3 or I just blew a transistor
22:44 hackman127 rue_shop3: Figures. Oh well, one key at a time I guess.
22:49 Tom_itx i forgot how to do a git update
22:49 hackman127 git pull
22:50 rue_shop3 Tom_itx, I always have to find the command line on the website
22:50 rue_shop3 yea, I shorted one of the driver transistors
22:50 rue_shop3 huh
22:51 hackman127 My brother got me started on SourceTree. It's pretty handy!
22:51 rue_shop3 ok Kp to 35, Kd to 2
22:51 Tom_itx they must have moved it
22:51 rue_shop3 see if your intuition is better than mine
22:51 Tom_itx then try 3
22:52 Tom_itx and lower kp to 33
22:52 Tom_itx or 22-25
22:53 rue_shop3 heh, its close when you see the fuse element sagging under the current
22:53 Tom_itx ?
22:53 rue_shop3 as the servo rings to position, and the fuses wire moves every time it changes direction
22:54 Tom_itx oh
22:54 rue_shop3 trying 33:3
22:55 rue_shop3 2 peaks at 33:3
22:55 rue_shop3 trying 25:3
22:56 Tom_itx you're gonna need floats to get it right
22:57 rue_shop3 at 25:2 its still 1 cycle ring
22:57 Tom_itx getting closer though?
22:57 rue_shop3 sorry its 25:3
22:57 rue_shop3 well, its 1 cycle
22:57 rue_shop3 and were at 25 gain, so it'll prolly hold the posision good
22:58 rue_shop3 hahah I just lost a grub screw
22:58 rue_shop3 guess it didn't like the ringing
23:00 rue_shop3 at Kp=25, it can get the shaft within +-45 degrees of target
23:01 rue_shop3 so I think Kp has to go up
23:01 Tom_itx i don't think so
23:01 Tom_itx but you can try it
23:01 rue_shop3 Kd should take care of its overshoot, and a Ki would take care of static error
23:01 rue_shop3 I have another dial too
23:01 Tom_itx go up 1 at a time
23:02 Tom_itx if you do
23:02 Tom_itx because you're close
23:02 rue_shop3 right now, the P can contribute 200 counts to the signal, I could bring that down
23:02 rue_shop3 so it saturates at, say 150
23:03 rue_shop3 termP = limit(error, -Plim, Plim);
23:03 rue_shop3 termD = limit(differ, -Dlim, Dlim);
23:03 rue_shop3 reaction = ((termP * Kp) - (termD * Kd));
23:03 rue_shop3 so Plim is 200
23:03 rue_shop3 Kp is 25,
23:04 rue_shop3 ya know, I dont think that order of ops is right
23:04 rue_shop3 I think the error should be multiplied by Kp and THEN bound
23:05 rue_shop3 this is what I hate about trying to implement PID in the real world
23:05 rue_shop3 honestly, the error will prolly never hit 200
23:05 rue_shop3 thats an inch or so out
23:09 rue_shop3 it would be nice to datalog the numbers
23:09 rue_shop3 see whats happeneing
23:10 rue_shop3 Tom_itx, what loop sample freq are you used to?
23:10 rue_shop3 I must be about 2Khz here
23:10 rue_shop3 I wonder if those time slices are too small
23:10 Tom_itx i don't remember
23:11 rue_shop3 the HC11 isn't a speed wizard
23:11 Tom_itx you tune it to your sample rate
23:11 Tom_itx 68332
23:11 Tom_itx was what i used
23:11 Tom_itx maybe it was 50
23:11 Tom_itx i really don't remember
23:11 rue_shop3 I'm using the overflow of the PWM timer to trigger the calculations
23:11 rue_shop3 the idea being there is no point in doing more than 1 calc per pwm cycle
23:12 Tom_itx unless there are errors to calculate in
23:12 rue_shop3 but if I dont get any enocoder updates in that timeframe, a pile of zeros go thru the math and screw it all up
23:13 rue_shop3 Kd would always come out zero, and have no effect
23:13 rue_shop3 which is kinda what I'm seeing
23:13 Tom_itx put some limits on it
23:13 rue_shop3 Kd can be 24 when Kp is 25, and there is no apparent damping
23:14 rue_shop3 I have an idea, I'll do the calcs every 4th pwm overflow
23:15 rue_shop3 ok, extra data, with every 4th overflow, the calculation rate is...
23:15 rue_shop3 112Hz
23:15 rue_shop3 so it was running about 448Hz
23:16 Tom_itx that's faster than my update rate
23:16 rue_shop3 I'm gonna drop that another step
23:16 Tom_itx says 20hz but i don't know if that's right
23:16 rue_shop3 ok lets try that
23:16 Tom_itx that will throw your numbers way off
23:16 rue_shop3 because dt isn't part of all this, because its constant
23:16 rue_shop3 I know
23:17 rue_shop3 so I'll divide by 22
23:17 rue_shop3 is about 20Hz
23:17 rue_shop3 so I'll put Kd back to 0 and Kp to ... 2?
23:18 Tom_itx maybe it was 100
23:18 rue_shop3 ok, 20Hz seems slow
23:18 Tom_itx i'm still looking
23:18 rue_shop3 I'll take it to 100
23:19 rue_shop3 89Hz
23:19 rue_shop3 ok 90Hz
23:19 rue_shop3 by the meter
23:20 rue_shop3 oh wait
23:20 Tom_itx near as i can tell it _was_ 100hz
23:20 rue_shop3 its toggling the led
23:20 rue_shop3 so, its double what I think
23:20 rue_shop3 so I'm at 200calc/sec
23:21 rue_shop3 ok 50Hz, aka 100calc/sec
23:21 rue_shop3 that means is was calculating at like 900x/sec
23:21 rue_shop3 heh
23:21 rue_shop3 nowonder Kd wouldn't work
23:23 rue_shop3 ok 1.25 turns of slop
23:23 rue_shop3 at Kp = 2
23:23 rue_shop3 I'm gonna go for 5
23:23 rue_shop3 wait, 1 would be 2.5 turns
23:23 rue_shop3 I want it within 1/8 turn
23:24 rue_shop3 says I want 20, lets see if its stable at 20
23:25 rue_shop3 that math worked, its +-22.5 of target
23:25 rue_shop3 and its just a little underdamped
23:26 rue_shop3 dial up ya think?
23:26 Tom_itx which one?
23:26 Tom_itx you can try it
23:26 rue_shop3 wait, I'm at idiot, Kp isn't dt dependent
23:26 Tom_itx it will likely overshoot
23:26 rue_shop3 I'll get the same results
23:26 rue_shop3 Kd wil be totally different
23:27 rue_shop3 I'll go to the 60 you thought first
23:27 rue_shop3 and try adding Kd
23:27 rue_shop3 Kp = 60; Kd = 0
23:28 rue_shop3 about a 5 peak ring
23:28 Tom_itx kd 2
23:28 rue_shop3 damn I didn't finish my avr scope
23:28 Tom_itx kp 40
23:28 Tom_itx or 50
23:29 rue_shop3 kp = 50; kd = 2
23:29 rue_shop3 this is like a good movie and I really need to go P
23:30 rue_shop3 huh, its ringing more
23:30 Tom_itx P isn't in the equasion
23:30 rue_shop3 kp 40 kd 2
23:30 Tom_itx yup
23:31 wolfmanjm use autotune... http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/
23:31 rue_shop3 its not arduino
23:32 rue_shop3 2 peak ring, higher freq, 40:2
23:32 wolfmanjm doesn;t matter it is the code that is imopriotant I run it on an Arm
23:32 wolfmanjm the code is not arduino specific
23:36 rue_shop3 ah
23:36 rue_shop3 I'm gonna play a bit more
23:37 rue_shop3 I'm gonna dial up Kd a bit more, and then I'm gonna turn down the rate the calcs are done
23:37 rue_shop3 this dosn't move too fast, so it would not surprise me if derror is still getting zeros
23:40 rue_shop3 this code worked with the encoder on an HP servo, the rate was much higher
23:41 rue_shop3 ok, halving the calc rate
23:41 rue_shop3 kp = 2
23:42 rue_shop3 much more unstable
23:43 rue_shop3 trying Kd = 1.5
23:44 rue_shop3 hmm
23:45 rue_shop3 not much better
23:47 rue_shop3 error = control - position ;
23:47 rue_shop3 differ = lastError - error;
23:47 rue_shop3 termP = limit(error, -Plim, Plim);
23:47 rue_shop3 shouldn't my differ be lastposition = position?
23:48 rue_shop3 I'm calcuating the rate the error is changing
23:48 rue_shop3 not the posision
23:48 rue_shop3 ok where the hell is my servo control book
23:49 Tom_itx have fun. i
23:49 Tom_itx m gonna go sleep
23:56 rue_more gnight
23:57 Tom_itx don't blow any fuses or worse yet... transistors
23:57 rue_shop3 I'm wondering how many lines are in the 1/8 turn I'm looking for
23:58 rue_shop3 I might be fussing over 1 line of the encoder
23:58 rue_shop3 this was not meant to be a really high rez machine
23:59 rue_shop3 mayebe 30 thou should be ok