#robotics Logs
Dec 20 2019
#robotics Calendar
01:39 AM Jak_o_Shadows: ah, dammit. Helps if you remember what you're doing
01:44 AM Jak_o_Shadows: hey, of course it stuffs up if you try to set servo 30 to a value, instead of setting the servo to 30
02:58 AM Jak_o_Shadows: Hey rue, what was your usb servo driver code/interface like. What did it do?
02:58 AM Jak_o_Shadows: I remember being able to queue up commands or something?
03:07 AM Jak_o_Shadows: cause I think for mechanicla reasons, this needs them to execute at close to the same time
01:05 PM marder is now known as katsumi
06:52 PM logb0t_ is now known as logb0t
06:56 PM armyofevilrobots: @rue_shop2 Yep! SOrry for laggy response. Tons of mishaps on the road last night.
07:13 PM Jak_o_Shadows: Hmm. How often do y'reckon servos need to update?
07:13 PM Jak_o_Shadows: How often do they get new values as well?
07:28 PM Jak_o_Shadows: Hmm. If I use a uint16 as the designator for what servo, I can set simultaneous things by treating it as a bitmap
07:35 PM rue_mohr: Jak_o_Shadows, I use a mod of the ssc8 protocol
07:35 PM rue_mohr: I have a protocol for me robot where you cache the next positions and trigger them all at once
07:36 PM Jak_o_Shadows: Yeah, that's what I seem to remember
07:36 PM Jak_o_Shadows: How did the cacheing bit work?
07:36 PM rue_mohr: armyofevilrobots, yea, after you said that we looked up and down the driveway, there was a firetruck 50' down the road both ways
07:36 PM Jak_o_Shadows: and did you interpolate? Could you schedule future execution?
07:36 PM Jak_o_Shadows: rue, also, you're on fire too?
07:36 PM rue_mohr: Jak_o_Shadows, the servos need an update pulse every 20ms
07:37 PM rue_mohr: the hgher level does the interpolation
07:37 PM rue_mohr: no, last night my neighbours neighbours garage caught fire
07:37 PM rue_mohr: me and visitor didn't even notice
07:37 PM Jak_o_Shadows: ah, ok. Cause y'know, it's summer in Australia here.
07:37 PM rue_mohr: but I did point out that an emergancy vehicle stopped not too far away
07:38 PM Jak_o_Shadows: The level NOT on the uC does the interpolation?
07:38 PM rue_mohr: correct
07:39 PM rue_mohr: packet
07:39 PM rue_mohr: [0][c3][c2][c1][c0][v2][v1][v0]
07:39 PM rue_mohr: [1][v9][v8][v7][v6][v5][v4][v3]
07:39 PM rue_mohr: c0-c3 are command
07:39 PM rue_mohr: v0-v9 are value
07:39 PM rue_mohr:
07:39 PM rue_mohr: Commands:
07:39 PM rue_mohr: 0 listen (servo number) 256 = all {always obey command} // sticks through listen once
07:39 PM rue_mohr: 1 ignore (servo number) 256 = all {always obey command} // overrides listen once
07:39 PM rue_mohr: 2 One Time listen (servo number) {always obey command}
07:39 PM rue_mohr: 3 set flags (flags) (+toggle debug) { bitwise obey }
07:39 PM rue_mohr: 0 enguage cached position {always obey command}
07:39 PM rue_mohr: 1 turn servo on {obey if listening}
07:39 PM rue_mohr: 2 turn servo off {obey if listening}
07:39 PM rue_mohr: 3 set cmdpos to curpos {obey if listening}
07:40 PM rue_mohr: 4 set servo position (position) {obey if listening}
07:40 PM rue_mohr: 5 set cached position (position) {obey if listening}
07:40 PM rue_mohr: 6 get servo current (servo number) {servo number}
07:40 PM rue_mohr: 7 get servo position (servo number) {servo number}
07:40 PM rue_mohr: 8 send device model (servo number) {servo number}
07:40 PM rue_mohr: Servo Sends:
07:40 PM rue_mohr: [0][p3][p2][p1][p0][v2][v1][v0]
07:40 PM rue_mohr: [1][v9][v8][v7][v6][v5][v4][v3]
07:40 PM * zhanx looks at rue_mohr
07:40 PM rue_mohr: p0-p3 are paramiter number
07:40 PM rue_mohr: v0-v9 are value
07:40 PM rue_mohr: Paramiter numbers:
07:40 PM rue_mohr: 0 servo position (returns position sensor value)
07:40 PM rue_mohr: 1 servo current
07:40 PM rue_mohr: 2 device model (returns 10 bit device model number)
07:42 PM rue_mohr: Jak_o_Shadows, I realize some of that is a bit vauge, tell me anything you dont get
07:43 PM rue_mohr: the protocol can be used for controllers with "any" number of servos
07:43 PM rue_mohr: so you could take a tiny85 and have it operate 1 servo
07:43 PM rue_mohr: or, in my case, take an atmega32 and have it run 4
07:44 PM rue_mohr: (io limit, 1 analog for feedback position, 1 analog for motor current, 1 dig output for pwm, 1 dig output for direction)
07:44 PM rue_mohr: not using serial interfaces in the servo loop means that less timeing issues
07:48 PM rue_mohr: Jak_o_Shadows, ...
07:48 PM rue_mohr: you ok?
09:12 PM Jak_o_Shadows: Sorry, had to duck off for christmas shopping
09:36 PM SpeedEvil is now known as Guest45471
09:39 PM Jak_o_Shadows: Ok. I think i get the listening/not listening bits. and the commands. But looking a bit up, is it fixed length? How does the basic protocol do things
10:10 PM Jak_o_Shadows: and I don't think I understand how multiple commands are sent in a single packet. Like, wht applies to what
10:17 PM Jak_o_Shadows: ok, I found your github project about it.
10:23 PM Jak_o_Shadows: ah, you have a slightly different setting thing to me.
10:24 PM Jak_o_Shadows: Your "position" is directly used. Whereas I offload it to external chip, so I have a manual setting stage in there.
10:31 PM Jak_o_Shadows: But that's ok - I'll just have a hidden layer, and update if required at every like 60ms or somethin
11:02 PM rue_mohr: two bytes
11:02 PM rue_mohr: the first bit identifies the initial byte
11:03 PM rue_mohr: just one command per two bytes
11:03 PM rue_mohr: Jak_o_Shadows, and have your updater skip updates for the same position
11:03 PM rue_mohr: its meant for that compression
11:04 PM rue_mohr: only write values that changed
11:04 PM rue_mohr: AND if channels are the same, write them at once
11:09 PM Jak_o_Shadows: ohhh, the commands are bits.
11:09 PM Jak_o_Shadows: of course
11:09 PM Jak_o_Shadows: yeah, skip if not updated was the plan.
11:09 PM rue_mohr: :)
11:09 PM rue_mohr: sorry yea, those are bit fields
11:10 PM rue_mohr: and the "write multiple" thing
11:11 PM Jak_o_Shadows: ah, so it's a 2 byte overall - have to send both.
11:11 PM rue_mohr: iirc, "one time listen" can be "stacked"
11:11 PM Jak_o_Shadows: Cause you wanted 10 bit resolution
11:11 PM rue_mohr: yes
11:11 PM rue_mohr: because the adc is 10 bits
11:11 PM BitEvil is now known as SpeedEvil
11:11 PM rue_mohr: and so my analog servo loop controller is 10bit
11:13 PM rue_mohr: enguage cached position is global
11:13 PM rue_mohr: you dont have to make people listen for that
11:13 PM rue_mohr: the processing time to figure it all out is SO much less than the data transfer time
11:15 PM Jak_o_Shadows: So how many sets of 2 bytes do you need to set a servo position?
11:15 PM Jak_o_Shadows: You send one saying what servo - then another saying the value?
11:15 PM rue_mohr: yes
11:16 PM Jak_o_Shadows: ok. Ok. getting to hange of it.
11:17 PM rue_mohr: if you need to set evreyone to positon 82, you send listen, address 256 : set position, 82 : ignore, address 256
11:17 PM Jak_o_Shadows: Why 256 as the "all"
11:17 PM rue_mohr: or listen once, address 42 : listen once, address 94 : set position, 82
11:18 PM rue_mohr: its an "ALL CALL"
11:18 PM rue_mohr: aka, you want to turn off all your servos at once
11:19 PM rue_mohr: its targeted at analog servos, you power up in an off stte
11:19 PM rue_mohr: state
11:19 PM rue_mohr: the idea is that you do a "set command postion to current position" to make sure then servo wont move when it comes up
11:19 PM rue_mohr: then turn on power
11:20 PM rue_mohr: then move to where you want
11:20 PM Jak_o_Shadows: ah, yup.
11:20 PM rue_mohr: (for startup)
11:20 PM zhanx: rue_mohr, i should use that also
11:20 PM rue_mohr: "send device model" can be used to scan for installed servos
11:22 PM Jak_o_Shadows: TBH, I'm thinking about just grabbing your code and using it.
11:23 PM rue_mohr: hey I'd love to see it in use
11:23 PM rue_mohr: I have a command line utility you can use to manually operate servos on a bus
11:23 PM rue_mohr: its C for linux
11:23 PM rue_mohr: dunno if I posted it
11:25 PM rue_mohr: I hope I have it, iirc the last robotics kid stole the harddrive after one of my buddies TOOK THE DRIVES DAMN JUMPERS
11:27 PM rue_mohr: ooo thankyou!
11:28 PM rue_mohr: its using one of my dos like terminal interfaces thats exactly what Im working on just now
11:29 PM rue_mohr: Jak_o_Shadows,
11:29 PM rue_mohr: do you have something that will simulate a serial port (arduino or usb adapter or whatever?)
11:29 PM rue_mohr: and are you using linux?
11:30 PM rue_mohr: ok, gone again...
11:32 PM rue_mohr: Jak_o_Shadows, wait
11:32 PM rue_mohr: github,? I dont see it here
11:34 PM rue_mohr: oh maybe your looking at the stm32 one
11:35 PM rue_mohr: but...
11:35 PM rue_mohr: what...
11:36 PM Jak_o_Shadows: https://github.com/ruenahcmohr/m328hobbydriver/blob/master/main.c ?
11:36 PM Jak_o_Shadows: sorry
11:36 PM rue_mohr: the stm32 one is based on the SSC with some twists
11:37 PM rue_mohr: oh that one is too
11:37 PM Jak_o_Shadows: Also, nah, windows. I'd probably translate the desktop utility to python, I don't think I have a compiler/etc for C
11:37 PM Jak_o_Shadows: which one am I looking for?
11:37 PM rue_mohr: that post I did
11:37 PM rue_mohr: is something thats not here
11:38 PM rue_mohr: http://ruemohr.org/~ircjunk/robots/buddy_III/servo32/adc_pwm_PI_uart4/main.c
11:38 PM rue_mohr: its there
11:38 PM rue_mohr: its a quad analog servo loop controller
11:38 PM rue_mohr: that interface I described is in there
11:39 PM rue_mohr: *BUT* it looks like I did a cached position thing in what your looking at
11:39 PM rue_mohr: oh yea
11:39 PM rue_mohr: in what your looking at
11:39 PM rue_mohr: I pulled a trick with the servo number
11:40 PM rue_mohr: AAABCZZ is a bitfield
11:41 PM rue_mohr: yea, the 328 is my max res, max stability servo pulse controller for hobby servos
11:41 PM rue_mohr: I did a 33 servo version for stm32 that uses 4017 as exapanders
11:41 PM rue_mohr: or was it 24
11:42 PM rue_mohr: the stm32 can be pushed up to 44 servos
11:42 PM Jak_o_Shadows: TBH, i'm just using a i2c expander for the moment.
11:42 PM Jak_o_Shadows: I wouldn't mind swapping that to timers - but that's a slightly future problem
11:45 PM Jak_o_Shadows: You don't happen to have a interrupt driven USART one?
11:45 PM Jak_o_Shadows: just before I do it
11:46 PM zhanx: Neuromod, rue_mohr
11:46 PM zhanx: rue_mohr, he has questions for you
11:46 PM rue_mohr: The answer is unequivicably: 42.
11:47 PM zhanx: Neuromod> Alright, I'm kinda new to FPGAs, and was coding this UART receiving module, and I decided to implement a FIFO for it. But now I'm realizing the FIFO is pretty useless, it adds a lot of complexity to the wa
11:47 PM rue_mohr: needs to be authed' eh?
11:47 PM rue_mohr: whaaaa?
11:47 PM zhanx: might be
11:47 PM rue_mohr: fifo is that you want for a comm buffer
11:48 PM zhanx: Neuromod, if need be pm the questions to me or him
11:48 PM rue_mohr: but I cant speak much to FPGAs yet
11:48 PM rue_mohr: I'm _almost_ started with my first one
11:48 PM rue_mohr: and I'm making just as much progess with hardware based fsms
11:48 PM Neuromod: alright
11:48 PM Neuromod: finally
11:48 PM zhanx: you got it
11:49 PM * zhanx steps out as middle man
11:49 PM Neuromod: alright, I understand hat FIFOs are important, because you cant process data sometimes unless you get the complete chunk...
11:49 PM Neuromod: thanx zhanx!
11:50 PM zhanx: Neuromod, welcome to the madness that is robotics, we make stuff
11:50 PM rue_mohr: hmm, its important to distinguish fifo from a packet buffer
11:50 PM Neuromod: but I implemented a FIFO module which Im thinkign now it might be pretty useless
11:50 PM rue_mohr: how big are the packets you need?
11:51 PM Neuromod: not much really....but my point is... instead of using a FIFO of whatever size inside of a uart receiver module, it appears to me now that it would have been better to ditch it from the uart module and leave it to whoever conencts to the uart module to handle the stream
11:52 PM rue_mohr: well
11:52 PM rue_mohr: some steams can be handled by a state machine
11:52 PM rue_mohr: and some you need to buffer up a packat and re-arrange it
11:53 PM Neuromod: why do i believe so? because the fifoed uart rx module requires me to manipulate wires such as readenable, available, etc
11:54 PM rue_mohr: ok, but lets step back and look at what your trying to do
11:54 PM zhanx: Neuromod, what is the end goal
11:54 PM rue_mohr: what is the nature of the packets your dealing with?
11:54 PM Neuromod: the "caller" gets pretty complex... so i thought maybe instead of using a fifo in the uart... uart could just "tick" that there is a byte available and the "caller" would have to get it in the next clock
11:54 PM zhanx: are you like me feeding 20 serials to 1 port?
11:55 PM Neuromod: im coding a crude rf transmitter
11:55 PM zhanx: Neuromod, you need to mod rue's servo call center for it
11:55 PM rue_mohr: heh
11:55 PM rue_mohr: so
11:55 PM zhanx: rue_mohr, you know i am right on that
11:55 PM rue_mohr: Neuromod, your dealing with a transmitter thats much slower than your data source, right?
11:55 PM Neuromod: bu i wouldnt say that matters to my question... its more abstract....
11:56 PM zhanx: Neuromod, end goal is the key to it really
11:56 PM zhanx: there is a reason you are using a FPGA
11:56 PM Neuromod: no, transmitter is just a pin...
11:57 PM rue_mohr: right, but your data source can probably easily outpace your transmitter
11:57 PM zhanx: Neuromod, so you know, we no steal idea's here for things
11:57 PM rue_mohr: fifo is good when you have two data sources with different speeds
11:57 PM zhanx: cause rue would be a millionaire if he did
11:57 PM Neuromod: ok letme explain with my current project. Im coding an FM transmitter, so im running a clock at around 300Mhz and it will switch pin pretty quire to transmit music and stuff..
11:57 PM rue_mohr: one source that generates data bursts, and another that can trickle read
11:58 PM Neuromod: no worries i plan to release this anyway
11:58 PM rue_mohr: k, adc steam of 8Khz or more is pretty demanding
11:58 PM Neuromod: maybe i could show code
11:58 PM rue_mohr: *but* you shouldn't need a cache
11:58 PM rue_mohr: or fifo
11:58 PM zhanx: pastebin the code if needed
11:59 PM rue_mohr: if your holding data for that, your taking too long
11:59 PM zhanx: don't be rue and flood it
11:59 PM * zhanx eyes rue meanly
11:59 PM rue_mohr: void dialog(char * string) {
11:59 PM rue_mohr: int start = 21;
11:59 PM Neuromod: my point is more about how this is interfaced.. hae you checked nandland page?
11:59 PM rue_mohr: nope
11:59 PM Neuromod: ok my fifo si similer letme find you the link