#robotics Logs

May 09 2018

#robotics Calendar

12:00 AM AchiestDragon: if i limit the current of each board ie each leg to 15a when under high load it will the motors will slow , the state machine and fets will cope , and if too high it will stop with a jam error rather than just blowing the fuse
12:03 AM AchiestDragon: it will also help stop over current drain on the lipos that are also likely to explode under over current
12:03 AM rue_mohr: oh I get it
12:03 AM rue_mohr: I know how to insert the state machine
12:04 AM rue_mohr: for the serial, which is slow as hell
12:05 AM rue_mohr: then the serial comms are still asynchronous
12:06 AM AchiestDragon: yea serial coms is not only async but by the time you decoded it its laggy and even more out of sync
12:07 AM AchiestDragon: its why i opted to swich to a gpio based state machine with serial just for status info
12:08 AM AchiestDragon: even at 115200 baud
12:08 AM rue_mohr: I have interrupt even driven code
12:08 AM rue_mohr: so NO serial in the irq
12:08 AM rue_mohr: so it sets flags for main to spool out the different messages
12:09 AM rue_mohr: which is all that main does
12:09 AM AchiestDragon: im using python multithreaded on the pi
12:10 AM rue_mohr: ouch
12:10 AM rue_mohr: uint8_t myMachine[] = {0,1,0,0,0,1,3,2,0,2,0,2,0,2,3,0};
12:10 AM rue_mohr: that is my state machine
12:10 AM rue_mohr: gonna sit down and write code generator code for it
12:10 AM AchiestDragon: need to split the code a bit as the pi3 is quad core and the python script although multithread still only uses 1
12:11 AM rue_mohr: I'v got the sitting part down, I just need the rest
12:11 AM AchiestDragon: lol
12:11 AM rue_mohr: my machines usualyl execute in about 5 instructions
12:11 AM rue_mohr: if not hardware implemented
12:12 AM rue_mohr: ugh, I'm supposed to be reverse engineering my brain too
12:12 AM rue_mohr: damnit, so much to do
12:15 AM AchiestDragon: 4 simultanius serial read streams , the leg position update calculations , the pwm arm control , the host vnc link over wifi etc ..... on the pi
12:16 AM rue_mohr: my mecha is going to use a PC pushing a kinematic stream to 8 loop controllers , over Toslink, to stm32 controllers running 8 axies ea
12:16 AM AchiestDragon: the servo version was doing 4 read 3 write serial streams and the sync on them was not that good , like a noticable delay on them
12:16 AM rue_mohr: with the PC having a tripple bonded wifi connection
12:17 AM rue_mohr: (different bands)
12:17 AM rue_mohr: :)
12:17 AM rue_mohr: wait
12:17 AM rue_mohr: 6 controllers with 8 channels?
12:18 AM rue_mohr: 6 controllers, 8axies ea, 24kBAUD ea
12:19 AM rue_mohr: mecha is 47 axis
12:20 AM rue_mohr: 24kBAUD for 8 axies
12:21 AM rue_mohr: using x86 to get FPU performance
12:21 AM rue_mohr: for kinematics
12:21 AM rue_mohr: exciting project, I wish it would hurry up
12:22 AM AchiestDragon: i poted to use a gpi type laching port expander to give me a 36 line latching ouput and a new data signal out and a done return , that way the pi just sends the data to the gip , trigers its new state , and waits for the done signal return
12:23 AM rue_mohr: yea, the stm32's need to run 32 solinoids ea
12:23 AM rue_mohr: so I'm prolly gonna use 74HC595
12:24 AM AchiestDragon: the adruinos just monitor the motors and stop them when they have moved one "step" when all active motros have moved there step the done signal gets returned to the pi ,, all motors in sync
12:25 AM rue_mohr: yup
12:26 AM AchiestDragon: the aadruinos can send actual pos data back to the pi over serial but its not relivent unless the pi loses track of what the motor pos should be
12:26 AM rue_mohr: my servo interface is...
12:26 AM AchiestDragon: so serial sync is nolonger a problem
12:27 AM rue_mohr: Commands:
12:27 AM rue_mohr: 0 Clear ping counter {always obey command}
12:27 AM rue_mohr: 1 pong if ping counter matches id and inc ping counter {always obey command}
12:27 AM rue_mohr: 2 listen (servo number) 256 = all {always obey command}
12:27 AM rue_mohr: 3 ignore (servo number) 256 = all {always obey command}
12:27 AM rue_mohr: 4 turn servo on {obey if listening}
12:27 AM rue_mohr: 5 turn servo off {obey if listening}
12:27 AM rue_mohr: 6 set servo position to argument {obey if listening}
12:27 AM rue_mohr: 7 get servo position {obey if listening}
12:27 AM rue_mohr: 15 send device model {obey if listening}
12:27 AM rue_mohr: so I can do bulk updates
12:28 AM rue_mohr: of up to 256 servos
12:28 AM rue_mohr: [0][c3][c2][c1][c0][v2][v1][v0]
12:28 AM rue_mohr: [1][v9][v8][v7][v6][v5][v4][v3]
12:28 AM rue_mohr:
12:28 AM rue_mohr: c0-c3 are command
12:28 AM rue_mohr: v0-v9 are value
12:28 AM rue_mohr: sync locked, 4 bit commands, 10 bit values
12:28 AM rue_mohr: Servo Sends:
12:28 AM rue_mohr: [0][p3][p2][p1][p0][v2][v1][v0]
12:28 AM rue_mohr: [1][v9][v8][v7][v6][v5][v4][v3]
12:28 AM rue_mohr:
12:28 AM rue_mohr: p0-p3 are paramiter number
12:28 AM rue_mohr: v0-v9 are value
12:28 AM rue_mohr:
12:28 AM rue_mohr: Paramiter numbers:
12:29 AM rue_mohr:
12:29 AM rue_mohr: 0 pong (value will be servo number)
12:29 AM rue_mohr: 1 servo position (returns position sensor value)
12:29 AM rue_mohr: 2 device model (returns 10 bit device model number)
12:29 AM rue_mohr: so far its been an awesome protocol
12:29 AM AchiestDragon: yea but if you have to update 18 servos to move thats 18 commands to send over serial and thers a noticable delay between the first and last
12:29 AM rue_mohr: the master can compress things by doing multiple updates too
12:29 AM rue_mohr: no
12:29 AM rue_mohr: there is a chain listen
12:30 AM rue_mohr: if the 18 servos are sequential, you can set chain mode and push all the positions
12:30 AM rue_mohr: hey
12:30 AM rue_mohr: this must be an old copy
12:30 AM rue_mohr: there is a cache position command
12:31 AM rue_mohr: you can cache a bunch of posisiton and have everyone apply them at the same time
12:31 AM rue_mohr: via a always_listen class command
12:31 AM rue_mohr: sorry
12:32 AM rue_mohr: yea
12:32 AM rue_mohr: 1 sec
12:32 AM AchiestDragon: i pushed next pos data to the arduinos while it was doing the current like a pre load buffer
12:32 AM rue_mohr: http://paste.debian.net/1023934/
12:33 AM rue_mohr: slightly newer version of the proto
12:33 AM rue_mohr: and I added a pin that I can physically query what the hell its address is
12:34 AM rue_mohr: its got bicolour status leds for each axis
12:35 AM rue_mohr: green = ready, at position, yellow = moving, red = off / error
12:36 AM rue_mohr: er, something like that
12:36 AM rue_mohr: lots of leds make for good show ;)
12:36 AM rue_mohr: esp if they are always changing
12:37 AM rue_mohr: its only PI, adding D was making it go crazy
12:37 AM AchiestDragon: https://github.com/achiestdragon/leggie/blob/master/leggie_arduino_pid/leggie_arduino_pid.ino for the servo version
12:37 AM AchiestDragon: commands documented in comments starting line 108
12:38 AM rue_mohr: I'm glad you didn't find anything better than pots for sensing position
12:38 AM rue_mohr: 3 years and I'm still trying
12:38 AM rue_mohr: I have a plan, I ahve some optical sensors and a piece of paper with a sine wave printed on it
12:38 AM rue_mohr: the idea is to make a 2 channel cos/sin optical pot
12:38 AM rue_mohr: resolver
12:39 AM rue_mohr: I also have some linear hall sensors to try it with
12:41 AM rue_mohr: lots of code!
12:42 AM AchiestDragon: i sort of did optical encoder just pulses and end stops , but you need to move it to one end stop on start , calibration is just counting the pulses from end to end , and you count as it moves , but opted for pots as the metal d shaped pot shafts work well as pivot shafts
12:42 AM rue_mohr: yea, abs position is ncie
12:45 AM AchiestDragon: i used dual gang sterio type pots , now have 2 per leg , so 4 pot track in total , still to figure out if i can wire them in some neat way to help iliminate track noise for when they wair
12:46 AM AchiestDragon: without making the adc input over complicated
12:46 AM rue_mohr: you have 2 axies on the one pot?
12:46 AM rue_mohr: concentric shaft?
12:47 AM rue_mohr: from aliexpress?
12:52 AM AchiestDragon: no ,, noisy pots , where the wipers get dead spots like you find on some old volume controls after a lot of use
12:52 AM rue_mohr: look how low you can put a low-pass filter on it before it cant keep up with the joint movement ;)
12:52 AM rue_mohr: about 1k and 47uF?
12:53 AM rue_mohr: my idea is to go with seperate pots, independently monitored, with an alarm if they severly argue
12:55 AM AchiestDragon: yea but thats going to be a 4 input comaritor or a number of analog ins , way too much
12:56 AM rue_mohr: I was thinking overseeign out of band controller
12:57 AM rue_mohr: the plan dosn't really include WHAT to do if there is a problem
12:57 AM rue_mohr: but its a 12' 1 ton? mecha, so....
12:57 AM AchiestDragon: if its a wipre dead spot and there wired in parallell as its a " collection of votage dividers with a common output " if one is oc the voltage would be the same , if its a track break then it would be different
12:57 AM rue_mohr: I agree
12:58 AM rue_mohr: oh, I was thinking of putting them 90 degrees out of phase, and checking the vector length to know if one is out... but that idea needs a lot of work
01:01 AM AchiestDragon: i was thinking more of something like a weatstone bridge type balance but would need diferential adc inputs and maybe comparitors
01:02 AM AchiestDragon: https://en.wikipedia.org/wiki/Wheatstone_bridge
01:02 AM rue_mohr: no
01:02 AM rue_mohr: your right
01:02 AM rue_mohr: make one positive rotation, and the other negitive
01:02 AM rue_mohr: read both, the average should always be ~512
01:03 AM rue_mohr: I like it
01:03 AM rue_mohr: where did you get the pots?
01:03 AM AchiestDragon: ebay
01:03 AM AchiestDragon: :)
01:03 AM rue_mohr: k
01:04 AM rue_mohr: I wont use ebay anymore, too many problems with not getting stuff and finding out protection had run out without notice
01:04 AM rue_mohr: and dissapearing listings
01:04 AM rue_mohr: and then there was the purchase I made where ebay took my money and the seller wasn't notified about the purchase
01:05 AM rue_mohr: things would randomly dissapear from my purchased items list, sometimes they would come back
01:06 AM rue_mohr: oh and there is no way to send a complaint to ebay about their system, all complaints have to be about a buyer or seller
01:06 AM rue_mohr: so f*** it
01:09 AM AchiestDragon: 90 ebay orders this year , and the only problems i had so far was from trying to sell my car , and buyers that did not turn up , and no coms so had to relist
01:10 AM rue_mohr: I did about 700 in a year
01:10 AM rue_mohr: I was having to manually track my purchases to get around their listing problems
01:10 AM rue_mohr: things that didn't arrive dissapearing from my purchased items lists
01:11 AM rue_mohr: spending hours to get support for ebay system problems, just to have them tell me to make paypal sort it out
01:17 AM rue_mohr: ah I see here, this is a state machine on a state machine
01:17 AM rue_mohr: huh
01:18 AM AchiestDragon: the 5mm motor flexi shaft couplers i got where from malaisia , after odering them and they said they shiped ebay removed them and there listing but they still arrived
01:18 AM rue_mohr: did they dissapear form your purchased items list, so you could not dispute them if they didn't arrive?
01:20 AM AchiestDragon: no , showed as an item bu with no discription , and no way to leve feedback when they did
01:20 AM rue_mohr: ... so if it didn't arrive, you would do what?
01:21 AM AchiestDragon: couple of months back there was an outage of items on bought list , but only for a day then they where back , prob a server issue
01:21 AM rue_mohr: and how do you know how much purchase protection time is left on your purchased items?
01:22 AM rue_mohr: ea, they have those problems ALL THE TIME
01:22 AM AchiestDragon: well if they had not arrived in the time i could get a paypal refund
01:22 AM rue_mohr: only if its iwthin so many days
01:22 AM rue_mohr: 'so many' is apparently not defined with a start and length
01:23 AM rue_mohr: aliexpress is much better, its not the same, but better
01:25 AM AchiestDragon: other thing you should look at is delivery times , and buy from suppiles that do it in a reasnable lenth ,, some usualy the realy cheap chinese ones ship by surface ie boat that takes months if the container does not fall of the ship in the process
01:25 AM rue_mohr: yup
01:25 AM rue_mohr: I would only buy from 98%+ sellers
01:26 AM rue_mohr: or 99, cant recall
01:26 AM AchiestDragon: or end up beeing hostage to pirates and gets resold in india
01:26 AM rue_mohr: starting to do that on ali now too
01:26 AM rue_mohr: ah, so I can buy my missing stuff from sellers in india?
01:26 AM rue_mohr: THEY GIVE ME SUCH GOOD DEAL!
01:26 AM rue_mohr: :/
01:27 AM AchiestDragon: i usualy look for places with uk stock first , because thats usualy delivery within a week and no import tax to worry about
01:27 AM rue_mohr: yea, not a problem in canada
01:28 AM rue_mohr: the problem in canada is the 7 MONTHS it takes the mail system to process the packages
01:28 AM rue_mohr: (ok, that was peak, but GEEEEEEEEEEEEEEEEEEEEEE)
01:30 AM AchiestDragon: ho yea , its like they take the mail on a round trip to the north pole sorting office a few times before delivering it
01:30 AM rue_mohr: no, it sits in burnaby vancouver, at the sort facility for up to the 7 months
01:30 AM rue_mohr: I have had proof
01:30 AM AchiestDragon: that sucks
01:31 AM rue_mohr: they fixed the problem by refusing to track international packages
01:31 AM rue_mohr: during the transition it was clear what was happeneing
01:34 AM AchiestDragon: in the uk uk to uk is usualy about 3 days by carrier and 4 to 5 by post
01:36 AM AchiestDragon: from china to uk usualy 2 weeks , if not by boat ,
01:39 AM rue_bed: gnight
01:39 AM rue_bed: tell me how the driver works out
01:40 AM AchiestDragon: will ,, its 7:30 am here btw
01:41 AM AchiestDragon: breakfast time
01:51 AM AchiestDragon: so canada , reason for package delay at sorting office package was in container lost under snow for 6 months
06:24 AM SpeedEvil: AchiestDragon: :)
05:20 PM AchiestDragon: well fixed the h-bridge schematic , it was wrong , the p drive is posative for on the n drivers need it inverted , not so bad since theres 6 in a 74hc04 just enough https://github.com/achiestdragon/leggie/blob/master/schematics/h_bridge.pdf
09:02 PM rue_mohr: hey I was right
09:12 PM z64555: about which thing
09:12 PM * z64555 hasn't been keeping up
11:34 PM AchiestDragon: and sorted the current limiting / power regulators and power distribution schematic https://github.com/achiestdragon/leggie/blob/master/schematics/power_dist.pdf
11:35 PM AchiestDragon: although still to calculate the values