#robotics Logs

Dec 06 2017

#robotics Calendar

12:10 AM rue_mohr: FB = (adc - 512) * 8;
12:13 AM rue_mohr: Err = Ctrl - FB;
12:13 AM rue_mohr: Err *= Kp;
12:13 AM rue_mohr: D = Err - oldErr;
12:13 AM rue_mohr: I += Err;
12:13 AM rue_mohr: O = (Err + (D/Kd) + (I/Ki)) / 8;
12:13 AM rue_mohr: ok I think thats my pid loop
12:15 AM rue_mohr: I need to work out how to prevent saturation tho
12:39 AM rue_mohr: wait I have to divide th output more
12:39 AM rue_mohr: 8 is to 1024
12:39 AM rue_mohr: I need 256
12:40 AM rue_mohr: 16 is 512
12:40 AM rue_mohr: 32 is 256
12:40 AM rue_mohr: O = 128 + ((Err + (D/Kd) + (I/Ki)) / 32);
12:40 AM rue_mohr: have you ever suspected you were in an empty room?
12:40 AM rue_mohr: yes
12:40 AM rue_mohr: when?
12:40 AM rue_mohr: when I didn't hear a reply from anyone
12:40 AM rue_mohr: or any other noise?
12:40 AM rue_mohr: yes
12:41 AM rue_mohr: gee, glad thats not me right now
12:41 AM rue_mohr: you be that
12:42 AM rue_mohr: the loop gain is 4, but I fixed that in that last line
12:42 AM rue_mohr: so what should Kp Ki and Kd be?
12:42 AM rue_mohr: this is where you need to play with it
12:42 AM rue_mohr: mey, how about we use a m328?
12:42 AM rue_mohr: sound good
12:42 AM rue_mohr: but its after bedtime
12:45 AM rue_mohr: so, for tommorow, an m328 WHOLY CAT FART BATMAN!
12:45 AM rue_mohr: OH GEEZ
12:45 AM rue_mohr: just NO warning, dang
12:46 AM rue_mohr: I'm dizzy
12:46 AM rue_mohr: ok, I'll need an m328, on a breadboard with an RC filter, and the little digital scope
12:47 AM anonnumberanon: Pid is applied to compensate what?
12:48 AM rue_mohr: I'm using it to control an RC filter from the pwm to the adc
12:48 AM anonnumberanon: I struggled with it for weeks on my quadcopter build
12:48 AM rue_mohr: its trickey to implement properly
12:48 AM anonnumberanon: Yeah
12:48 AM rue_mohr: mostly cause of digital saturation
12:49 AM rue_mohr: integrators dont work as well in reality as they do in math simulations
12:49 AM anonnumberanon: Although i had a proper design except it wasnt running at a constant refresh rate. That defeats the PID.
12:50 AM rue_mohr: the pwm system makes a good regular interrupt
12:50 AM rue_mohr: and if you only do one calc per PWM pulse, your totally good
12:51 AM anonnumberanon: With a quadcopter P does the work, D smoothes it out and I is the magic touch fine tune.
12:51 AM rue_mohr: yea, just a tiny bit of I
12:51 AM anonnumberanon: Sure. I wasnt timing my loop though so pwm was being sent untimed
12:51 AM rue_mohr: the value of 1 integrated 1000 times a second will quickly saturate an 8 bit value
12:52 AM rue_mohr: anonnumberanon, that throws of the meaning of Kp and Ki
12:52 AM anonnumberanon: It still ran the motors fine but not the pid
12:52 AM anonnumberanon: I was using floats
12:54 AM anonnumberanon: An ESC is a very docile animal :)
12:55 AM anonnumberanon: In other news i still havent found a proper source for motors.
12:55 AM anonnumberanon: There is a regular size free copier but 45 minutes away
12:56 AM anonnumberanon: I would get nice rods from it and some gears but surely no good motors
01:00 AM anonnumberanon: Oh u got a digital scope now? What kind self made? 5 dollar one on aliexpress?
01:01 AM rue_mohr: DSO138
01:01 AM rue_mohr: https://www.thingiverse.com/make:413106
01:01 AM anonnumberanon: Why are you sending pwm to adc
01:02 AM rue_mohr: to made a dac
01:02 AM rue_mohr: one with a good response
01:02 AM rue_mohr: to made?
01:02 AM rue_mohr: made?
01:02 AM rue_mohr: wtf?
01:02 AM rue_mohr: how did that key jump hands?
01:03 AM rue_mohr: I left myself 1 bit for antisaturation
01:03 AM anonnumberanon: Cute. What mcu does this one use?
01:03 AM rue_mohr: stm32F103
01:03 AM anonnumberanon: Ofc
01:04 AM anonnumberanon: Cheapest good mcu right now
01:04 AM rue_mohr: yes, must collect them all!?
01:04 AM rue_mohr: !!
01:04 AM anonnumberanon: I should order a bunch before the word gets out about this
01:04 AM rue_mohr: I got a soic chip-clip I'm going to set up for flashing t13s
01:04 AM rue_mohr: it did, prices are going up
01:05 AM anonnumberanon: Fak
01:05 AM rue_mohr: prices will double when it get picked up by a commercial reseller
01:05 AM anonnumberanon: Not recently tho?
01:05 AM rue_mohr: up! up! up!!!
01:05 AM * anonnumberanon ebays
01:05 AM rue_mohr: no, no
01:05 AM rue_mohr: axiexpress
01:06 AM rue_mohr: $2.50usd or less for the win
01:06 AM anonnumberanon: I dont really want to program mcus in c anymore
01:06 AM rue_mohr: start using intel cellerons then
01:06 AM anonnumberanon: But its tough going all asm from scratch
01:06 AM rue_mohr: you will need the extra punch
01:07 AM rue_mohr: dos sure runs fast on a procesor with enough L1 cache to fit the whole damn thing
01:07 AM anonnumberanon: Well avr can do almost everything i want
01:07 AM rue_mohr: yea
01:08 AM rue_mohr: thats part of the problem I have
01:08 AM anonnumberanon: If i get into arm all limits disappear
01:08 AM rue_mohr: I got into the stm32 as a replacement when microchip ousts all the good avr and leaves just a mess
01:09 AM anonnumberanon: If anything just for the frequency they provide out of thebox
01:09 AM rue_mohr: heh
01:09 AM rue_mohr: you know direct io ops push it down to like 10Mhz?
01:10 AM rue_mohr: your 72Mhz if you keep your distance from the io pins
01:10 AM anonnumberanon: At 48mhz you have enough machine cycles to do powerful things before the end of that crucial 1-microsecond window...
01:11 AM anonnumberanon: Io takes time?
01:11 AM anonnumberanon: IO
01:11 AM rue_mohr: direct io comes with a pile of wait-states
01:11 AM rue_mohr: so you want to do everything thru the subsystems
01:12 AM anonnumberanon: https://www.google.com/search?q=how+fast+is+direct+port+manipulation+with+arm&ie=utf-8&oe=utf-8&client=firefox-b
01:12 AM anonnumberanon: Lets see..
01:13 AM rue_mohr: waaaaaaaaaaaaaaaaaaaait states
01:13 AM rue_mohr: its like having a 4Ghz x86 thru a parallel port
01:13 AM anonnumberanon: But their not particularly painful to deal with are they?
01:13 AM anonnumberanon: The susystems
01:13 AM rue_mohr: the only new thing is that you have to have looooooooots of code to initialize aaaaaaaaaaaaaaall the subsystems
01:14 AM rue_mohr: you have to turn on all sorts of switches to use stuff
01:14 AM rue_mohr: but, only once
01:15 AM rue_mohr: wtf, what causes 67 downloads of my things from thingiverse on a random day?
01:15 AM rue_mohr: must be people scraping
01:15 AM anonnumberanon: This price seems okay to me https://m.ebay.com/itm/STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-for-Arduino-/232564766661?nav=SEARCH
01:16 AM anonnumberanon: The chinese man
01:16 AM rue_mohr: no!
01:16 AM rue_mohr: thats $5 ea!!!
01:16 AM rue_mohr: screw that
01:16 AM anonnumberanon: 3 dollars
01:16 AM rue_mohr: oh, still too much
01:16 AM anonnumberanon: Math where?
01:16 AM rue_mohr: its almost midnight, ssh
01:17 AM rue_mohr: https://www.aliexpress.com/item/1pcs-STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-arduino/32720697607.html
01:17 AM rue_mohr: tahts $2.30cad, so thats GOT to be cheaper
01:18 AM rue_mohr: https://www.aliexpress.com/item/1pcs-STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-arduino/32721093906.html
01:18 AM rue_mohr: and thats cheaper again
01:19 AM rue_mohr: https://www.aliexpress.com/item/10pcs-STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-arduino/32721357634.html
01:19 AM * rue_mohr drools
01:19 AM rue_mohr: I'M NOT DOING THIS
01:19 AM rue_mohr: GET ME OUTA HERE
01:20 AM rue_mohr: NO MORE BUUUUUYing stuuuufffffffff.....
01:20 AM rue_mohr: stuuuuuuuuuuff
01:20 AM rue_mohr: mmmm buuuy stuufffff
01:20 AM rue_mohr: NO! NO!
01:20 AM rue_mohr: close window! close window!
01:21 AM rue_mohr: ooo I should post, on thingiverse, a spagetti blob, to see how many false downloads there are
01:22 AM rue_mohr: use it as a noise offset
01:23 AM anonnumberanon: Some come with the stlink programmer
01:24 AM rue_mohr: the programmer is like $2 get 3
01:25 AM rue_mohr: I can setyou up with the toolchain as its a bit ugly at this stage of its life
01:26 AM anonnumberanon: I have a usb to ttl programmer for avr. That wont work?
01:27 AM anonnumberanon: Yes i need a toolchain and a cheap painless programmer like for avr
01:28 AM rue_bed: stlink
01:28 AM rue_bed: its like $3
01:29 AM rue_bed: I suppose I should proof out the pid code on the pc
01:30 AM rue_bed: thats a great thing about C
01:30 AM rue_bed: proof stuff out on pc and move to avr
01:40 AM anonnumberanon: Oh wait 72 mhz nkt 48
01:40 AM anonnumberanon: Not 48
01:44 AM anonnumberanon: Setting or clearing any combination of bits in an I/O port (even setting some and clearing others) should require at most three instructions; when repeated such instructions should take one instruction each. Unfortunately, it seems many vendors (ST among them) tend to define I/O libraries which generate subroutine calls even for common operations such as that.
01:44 AM anonnumberanon: (Pasted)
01:57 AM rue_bed: you can run it at 48 if you want
01:58 AM rue_bed: no think on it, you have a low freq io bus (10Mhz, maybe 20) and your 72Mhz needs to do a fetch
01:58 AM rue_bed: so there are wait states for the processor while reading/writing the bus
02:17 AM anonnumberanon: Please post source for this I'd like to read up on it.
02:21 AM anonnumberanon: Maybe this https://vjordan.info/log/fpga/stm32-bare-metal-start-up-and-real-bit-banging-speed.html
02:24 AM anonnumberanon: Yeah i think this is it
02:48 AM anonnumberanon: Now with an stm32f4 io speed is asteroid impacting fast
02:48 AM anonnumberanon: https://vjordan.info/log/fpga/stm32f4-bare-metal-start-up-and-real-bit-banging-speed.html
02:48 AM anonnumberanon: $9 dev boards on ebay
04:29 AM AchiestDragon: with most cpus you can set a dio line , regardless of cpu freq, what the issue is , is becuase of i/o propigation delays there is a delay in the data change time at i/o rate ,, the wait is needed if you wish to clock an i/o pin
04:34 AM AchiestDragon: as the dio logic may opperate at a diferent rate also on some chips reading dio status also sufferes the same delays ,
04:37 AM AchiestDragon: the best idea is to write your code so if you need to set a bit wait and then read it to see if its set ,, is to try to do something else rather than a wait , like check some other status or something to save cpu cyles , like multy thread tasking
04:52 AM micmac_: hi
04:55 AM micmac_: i'm doing an engineer project in computer vision, and I'm trying to understand detectors/descriptors evaluation methods as stated in papers from Mikolaczyk http://www.robots.ox.ac.uk/~vgg/research/affine/
04:56 AM micmac_: I wondered if any of you had opencv code to share with explanations for correspondence / repeatability and such metrics
04:59 AM micmac_: the papers are a little hard to read, so if you had any other source of information explaining this more easily that would be welcome
05:49 AM anonnumberanon: 25 microns cnc, good?
07:57 AM SpeedEvil: micmac_: do you have more specific questions?
07:58 AM SpeedEvil: repeatability is just the accuracy to which you can repeat a measurement.
07:59 AM SpeedEvil: Also - isn't there a #opencv channel
08:05 AM micmac_: SpeedEvil: no more question yet. thanks for your answer. I'll check the opencv channel.
08:33 AM SpeedEvil is now known as Guest42443
08:37 AM BitEvil is now known as SpeedEvil
08:57 AM rue_mohr: anonnumberanon, na, you want my work, I'v made a proper makefile that can upload to it
08:59 AM anonnumberanon: Lost logs. On phone im saturating with cnc research right now what u referin to, the arm toolchain question?
08:59 AM rue_mohr: yes
08:59 AM anonnumberanon: Ok yes i would really appreciate it.
09:00 AM rue_mohr: http://ruemohr.org/~ircjunk/programming/c/stm32/
09:00 AM rue_mohr: somewhere I hav a tgz of everything
09:00 AM anonnumberanon: Thanks
09:00 AM rue_mohr: that just a blink
09:01 AM anonnumberanon: Or ill torrent or wget it?
09:01 AM anonnumberanon: Thers a. Torrent at the bottom
09:02 AM rue_mohr: http://ruemohr.org/~ircjunk/programming/c/stm32/stm32.tgz
09:02 AM rue_mohr: reposted
09:02 AM rue_mohr: you will need help with it so ask questions
09:03 AM rue_mohr: but with that you can write a project and just do a make; make install
09:04 AM anonnumberanon: Ok
09:05 AM anonnumberanon: Im hesitating between 2 cnc builds right now
09:05 AM anonnumberanon: Ill still do the ghetto build by the end of the week tho i dont want to get shot
09:07 AM rue_mohr: time is running out ya know
09:08 AM rue_mohr: you have it all gued togethor less the motors right now, right?
09:08 AM rue_mohr: glued
09:11 AM anonnumberanon: I am starting with workbench + vise
09:12 AM anonnumberanon: While searching for an ewaste center
09:14 AM rue_mohr: no you dont need any of that
09:14 AM rue_mohr: cardboard, knife,and gluegun
09:15 AM rue_mohr: it dosn't have to be strong, durable, or accurate
09:16 AM rue_mohr: failure means you will never build anything :(
09:16 AM anonnumberanon: Ok so i just need 3 steppers?
09:16 AM rue_mohr: steppers are good
09:16 AM rue_mohr: you want drivers too
09:17 AM anonnumberanon: Yeah im not to date on that
09:17 AM rue_mohr: but it dosn't matter if you have 3 whole printer pcb's hung off of it with an arduino hacked into them for control
09:18 AM anonnumberanon: There is this but then wer talking about a real non ghetto machine already
09:18 AM anonnumberanon: https://www.amazon.com/SainSmart-TB6560-Axis-Stepper-Motor/dp/B009A5246O
09:18 AM rue_mohr: your neighbours probably have old inkjet printers they are getting rid of, or would if asked
09:24 AM armyofevilrobots: I’ve been buying new ones lately. They’re so cheap:
09:25 AM armyofevilrobots: https://www.aliexpress.com/item/Free-shipping-3PCS-Nema17-Stepper-Motor-42-motor-Nema-17-motor-42BYGH-1-7A-17HS4401-motor/32665922113.html
09:25 AM rue_mohr: ....
09:25 AM rue_mohr: their nice, but ya know I have the 3 milkcrates of them?
09:27 AM armyofevilrobots: Hehe; yes, there is that.
09:27 AM rue_mohr: technically, I dont even like steppers that much, but they sure are convienient
09:27 AM armyofevilrobots: Prefer servos, but they are pricy.
09:28 AM anonnumberanon: Ok come drop off a crate tomorrow after work
09:28 AM anonnumberanon: Thanks
09:28 AM rue_mohr: anonnumberanon, neighbours, scanners, inkjet printers
09:29 AM rue_mohr: old printers lurk in the back of closets and in crawlspaces
09:29 AM rue_mohr: and in attics and under piles of shoes
09:30 AM rue_mohr: in storage lockers
09:33 AM anonnumberanon: Yeah im confident ill find some. And with my battery drill it will be faster to take apart than last time i did that.
03:36 PM SpeedEvil: https://www.chess.com/news/view/google-s-alphazero-destroys-stockfish-in-100-game-match
03:36 PM SpeedEvil: (stockfish = current best chess playing program, and alphazer learnt to beat it in four hours.)
03:36 PM SpeedEvil: ^o
05:06 PM henriksod1 is now known as henriksod
09:26 PM mrdata_ is now known as mrdata
10:39 PM rue_mohr: so I got a package from china today, 100pcs lm393 and 100pcs MC34068
10:40 PM rue_mohr: ... but I didn't get those two chips from any one seller
10:41 PM rue_mohr: I did get 200 lm393 from one seller, but this was shipped 'aliexpress' and thats not what any of the packages shipped with
10:41 PM rue_mohr: I'm wondering if this is something that slipped thru the cracks or if its a mixup somewhere
10:42 PM rue_mohr: I dont know if I need to mark a package recieved
10:42 PM rue_mohr: my system works fine if a) I use it b) the shippers dont screw up