#robotics Logs
May 08 2018
#robotics Calendar
02:23 AM Jak_o_Shadows: veverak, be careful with the stm32 i2c slave, it's known to be trickly
02:27 AM Jak_o_Shadows: ah, cool.
03:48 AM veverak: Jak_o_Shadows: why is so?
03:54 AM Jak_o_Shadows: Lack of docs, and a slightly broken state machine - you can definitely get it working, but it's a little tricky
03:55 AM veverak: hmm
03:58 AM Jak_o_Shadows: This is the f1 series anyway
03:59 AM Jak_o_Shadows: There's two versions of the i2c hardware - the newer stuff it is different
04:00 AM Jak_o_Shadows: I have found ##stm32 very knowledgable (albeit somewhat ...)
04:02 AM veverak: Jak_o_Shadows: thanks
04:02 AM Jak_o_Shadows: aha. Yes. I have been very helpful
04:52 AM joga_ is now known as joga
08:46 AM rue_mohr: oh yea, just DONT use the hardware for doing it
03:52 PM Miyu is now known as hackkitten
07:05 PM SpeedEvil is now known as Guest5013
07:10 PM rue_shop4: ok, I have a new bearing to playw ith
07:49 PM BitEvil is now known as SpeedEvil
08:12 PM rue_shop4: built, works awesome
09:14 PM z64556 is now known as z64555
09:25 PM rue_mohr: you would think that interrupt based code and state machines would go nice togethor
10:05 PM AchiestDragon: depends ,,, interupts are asyncronus while state machines tend to be syncronus you need to ensure your state machine is async compatable
10:06 PM rue_mohr: well, the required intermediate flag layer is what giving me implementation issues
10:07 PM AchiestDragon: Jak_o_Shadows: and by design the state machine in logic is usualy way faster than the interupt responce handler
10:07 PM rue_mohr: uint8_t myMachine[] = {0,1,0,0,0,1,3,2,0,2,0,2,0,2,3,0};
10:07 PM rue_mohr: ;)
10:09 PM AchiestDragon: wha Jak_o_Shadows sorry cat on keyboard typo
10:11 PM AchiestDragon: feeds cat before it attacks me while im typing again
10:14 PM rue_mohr: AchiestDragon, were you the one in china?
10:15 PM AchiestDragon: state machines in software usualy suffer from the usual problems associated with logic simulation hdl/vhdl as the input changes are async rather than sync
10:16 PM AchiestDragon: china ? no im in the uk unfortunatly
10:16 PM rue_mohr: takes me a while to mask and shift the bits to make the offsets and use the results
10:22 PM AchiestDragon: just finished working out the state machine for doing the walking gate motor sync for the robot today , 6 * 8 bit latches , 6* quad 2 input and gates 6*tripple 3 input or gates a 74hc139 3 arduino nanos and a rpi3 ,2 160*100mm bits of stripboard
10:23 PM AchiestDragon: and 6 tripple 15a h bridges for all 18 motors
10:24 PM rue_mohr: whaaaaat
10:25 PM rue_mohr: I can do it with a 27512, 74574 and a 555
10:25 PM rue_mohr: ;) jk, I'd have to see
10:30 PM AchiestDragon: https://lh3.googleusercontent.com/-tcF7Jo08Ds4/WvJqfFQpMkI/AAAAAAAABq0/RcO8q5iJDtYiZRjBkg_qckyk34FyLnhewCJoC/w928-h1238-n-rw/IMG_20180506_222914.jpg one of the 6 h bridge boards
10:31 PM rue_mohr: wtf, iceweasel cant open that image
10:32 PM rue_mohr: WHY
10:32 PM rue_mohr: its not an image
10:32 PM rue_mohr: I need a proper file
10:33 PM AchiestDragon: https://drive.google.com/file/d/11yOHVQchfOHpnUMJfMfO-cIegqy_1yiO/view?usp=sharing
10:33 PM AchiestDragon: ?
10:33 PM rue_mohr: yes that works
10:34 PM rue_mohr: thats a bunch of transistors, whats the voltage your driving?
10:34 PM AchiestDragon: 36v
10:34 PM rue_mohr: oo, right up there
10:34 PM rue_mohr: and the chips are directional logic?
10:35 PM rue_mohr: and the small transitors are a class A level shifter with a totem fet driver?
10:36 PM rue_mohr: if so, how do you keep the P channel fet drive to 10-12V?
10:37 PM rue_mohr: do they give you current feedback?
10:37 PM AchiestDragon: well the drivers should do 60v ,,, the chips are dual 2 to 4 line decoders hcf4555be's as they provide the needed simultanious output change like diferential outputs and are cheaper and more common than a speciaist logic driver
10:37 PM rue_mohr: yup
10:37 PM rue_mohr: I used a 7400
10:37 PM AchiestDragon: 1 min finding link
10:37 PM rue_mohr: BUT
10:38 PM rue_mohr: I decided that I had SO many motors, it was worth it to build a dc-dc that gave me +- motor power so that I could use just 2 driver transistors per motor
10:38 PM rue_mohr: (18)
10:38 PM rue_mohr: it saved me 36 transistors
10:39 PM AchiestDragon: https://github.com/achiestdragon/leggie/blob/master/schematics/h_bridge.pdf
10:39 PM rue_mohr: erp
10:40 PM rue_mohr: you cant put 36V across the gate of those fets
10:40 PM rue_mohr: they cant only take 20V
10:40 PM rue_mohr: can only take
10:41 PM rue_mohr: you need some cleverly placed resistors between the class A and the totempole
10:41 PM rue_mohr: dont forget to actaully connect the E pins to something ;)
10:42 PM rue_mohr: (3.3-0.7)/470
10:43 PM rue_mohr: 5.5mA drive on the bc547, whcih should be ok, I think the gain is typ 180-250
10:44 PM rue_mohr: BUT your 1k pullup is 1/4W?
10:44 PM rue_mohr: zippo:/files/programming/c/statenachine-race# ohm -r 1000 -v 36
10:44 PM rue_mohr: Wattage is: 1.296000
10:44 PM rue_mohr: Current is: 0.036000
10:44 PM rue_mohr: Voltage is: 36.000000
10:44 PM rue_mohr: Resistance is : 1000.000000
10:45 PM rue_mohr: 10 ohms is ok for the gate-anti-resonance resistor,
10:46 PM AchiestDragon: k , the way the state machine works is to let the pi set the direction and what motors are to move using gpio lines and the laches as a expander , the arduinos wat for a motro to change 1 degree step then turn that motor off , when all done it enters ready for the next
10:46 PM rue_mohr: the 4555 outputs, low = high, = high = on
10:46 PM AchiestDragon: if a motor is sticking and takes too long it shuts down and creates a jam error
10:46 PM rue_mohr: wait. for the N channel
10:47 PM AchiestDragon: and on change of position the arduinos report the new pos to the pi over serial
10:47 PM rue_mohr: so, the P side is turned off by a low, and the N channel is turned on by a low
10:47 PM rue_mohr: only one output can go low at once
10:48 PM rue_mohr: so (P,N) the options are DISABLED, DRIVE LOW, DRIVE HIGH, EXPLODE
10:49 PM rue_mohr: OFF,OFF : OFF,ON : ON,OFF : ON,ON
10:50 PM rue_mohr: 0,1 : 0,0 : 1,1 : 1,0
10:50 PM rue_mohr: so your 4555 cant do DRIVE_HIGH, it can do DISABLED, DRIVE LOW, and EXPLODE
10:51 PM rue_mohr: (I might be wrong, I'm having mind problems right now)
10:51 PM rue_mohr: AchiestDragon, your going to tell me if I'm right about any of these, right?
10:53 PM rue_mohr: if I'm right, your fets will explode from gate voltage, the 1k resistors will catch fire, and it'll blow the input power fuse via the H bridge shorting the supply.....
10:53 PM AchiestDragon: input 00 ouput 0111 in 01 out 1011 in 10 out 1101 in 11 out 1110 only one is low at once ,,
10:53 PM rue_mohr: yes, you need both low to do DRIVE LOW
10:54 PM AchiestDragon: its not the first time i used this design , i have an old set i built some time back they work find
10:54 PM rue_mohr: the P channel fet is on when the gate is low
10:54 PM rue_mohr: ok
10:55 PM AchiestDragon: i still need to test this one though before i build the others
10:55 PM rue_mohr: like I say, now it not an ideal time for me to try to work that out, a few inversions and I get lost
10:56 PM rue_mohr: wait
10:57 PM rue_mohr: yea, the class A transistor is taking 5ma and driving 36mA, thats ok
10:57 PM AchiestDragon: no there not inverted out there pos out , only one high at once ,
10:57 PM rue_mohr: I did some little fet driver boards, with basically that base drive circuit
10:58 PM rue_mohr: first transistor inverts the signal when it changes the logic level
10:58 PM rue_mohr: Q21, input high, output low
10:58 PM rue_mohr: Q17/22 are noninverting
10:59 PM rue_mohr: Q19 input low, output high -- input high, output float
10:59 PM rue_mohr: stick around a min, I want to show you the cute little fet driver modules I did
11:00 PM AchiestDragon: k
11:01 PM AchiestDragon: i need to recheck if they need inverting outputs i can just use a 74hc139 rather than the hcf4555
11:01 PM AchiestDragon: same pinout but inverting outputs
11:03 PM rue_mohr: rlly?
11:03 PM rue_mohr: the '139 and the 4555?!?!?!?!
11:03 PM rue_mohr: cooool
11:03 PM AchiestDragon: the old one had the first transistor (inverter ) ommited on the n fet drive , so inverted that line
11:05 PM AchiestDragon: yea there the same pinout but the 4555 has none inverted ouputs while the 139 has inverted
11:07 PM rue_mohr: AchiestDragon, http://ruemohr.org/~ircjunk/images/p1100059.jpg
11:08 PM rue_mohr: but, since then, I'v discovered that the LM386 works well, and that pin 3 on a 555 drives (totempole) 600mA
11:08 PM rue_mohr: and obviously the 555 can do level conversion
11:08 PM rue_mohr: I thought that little board was totem, apparently its not
11:09 PM rue_mohr: its meant to sit right infront of the fet, almost wired directly across
11:13 PM AchiestDragon: https://drive.google.com/file/d/10trkiCShfPvafDj8zjJ5s8RJEKYNp4Iu/view?usp=sharing
11:15 PM rue_mohr: hah! arms, cool
11:16 PM AchiestDragon: well suitable use for all the bits of the servo version
11:17 PM AchiestDragon: i have a spare 32 chan pwm driver board for the rpi so can drive them from that ,while not needing pid feedback for the arms
11:18 PM AchiestDragon: and with no real weight load for the arms the servos should be fine
11:20 PM rue_mohr: when can you test the motor driver?
11:21 PM rue_mohr: .. AchiestDragon how many kg of filament do you have into that?
11:21 PM rue_mohr: I'm guessing about 12 or more?
11:23 PM rue_mohr: I'd still like to design nice little drivers that sit on the back of the motor
11:23 PM AchiestDragon: about 8
11:24 PM rue_mohr: wow
11:25 PM rue_mohr: expensive project!
11:26 PM AchiestDragon: the 18 motros weigh 400g each
11:27 PM rue_mohr: with the actuators...
11:27 PM rue_mohr: right?
11:28 PM rue_mohr: AchiestDragon, do you know the max load for the mtoors?
11:28 PM AchiestDragon: still trying to make it as cheap as posible , building the drivers for example i got the components for all for under £30 rather than arround £45 for a dual hbridge board assembled and would need 9 of those
11:29 PM rue_mohr: max motor current?
11:30 PM AchiestDragon: https://product.mabuchi-motor.com/detail.html?id=129
11:31 PM rue_mohr: WHOLY GEEZ STALLS AT 130A!?!?!
11:31 PM rue_mohr: lets just say 20A
11:31 PM AchiestDragon: the ones i got are rated up to 36v ,, bat voltage for motor supply is going to be around 26 to 30v
11:31 PM rue_mohr: are you actaully using irf640?
11:32 PM AchiestDragon: yea
11:32 PM AchiestDragon: irf640 n and irf9640 p's
11:32 PM rue_mohr: 0.18 Rdson
11:33 PM rue_mohr: zippo:/files/programming/c/statenachine-race# ohm -r 0.18 -i 20
11:33 PM rue_mohr: Wattage is: 72.000000
11:33 PM rue_mohr: Current is: 20.000000
11:33 PM rue_mohr: Voltage is: 3.600000
11:33 PM rue_mohr: Resistance is : 0.180000
11:33 PM rue_mohr: zippo:/files/programming/c/statenachine-race# ohm -v 2 -i 20
11:33 PM rue_mohr: Wattage is: 40.000000
11:33 PM rue_mohr: Current is: 20.000000
11:33 PM rue_mohr: Voltage is: 2.000000
11:33 PM rue_mohr: Resistance is : 0.100000
11:33 PM rue_mohr: you would be better off with a bad BJT...
11:34 PM rue_mohr: @ 20A load
11:34 PM rue_mohr: your dropping 2x that too
11:35 PM rue_mohr: so @20A your dropping 7.2V
11:35 PM rue_mohr: and dissipating 144W
11:35 PM rue_mohr: ? :/
11:35 PM rue_mohr: I dont want to seem pesimistic about your design
11:35 PM AchiestDragon: hopefully the motors should not stall and the load should not be so high while not lifting the robot
11:36 PM AchiestDragon: ha ,, i am , but try it and see i guess
11:36 PM rue_mohr: when you apply the real world, most engineering stuff goes out the window
11:36 PM AchiestDragon: yea
11:36 PM AchiestDragon: if it fails , look at how to fix why
11:36 PM rue_mohr: oh, er, just a note too, the 640 is only rated to 18A
11:37 PM rue_mohr: <fuse size suggestion>
11:37 PM rue_mohr: oh, and it can only dissipate 50W
11:37 PM rue_mohr: ohm -r 0.18 -p 50
11:37 PM rue_mohr: Wattage is: 50.000000
11:37 PM rue_mohr: Current is: 16.666666
11:37 PM rue_mohr: Voltage is: 3.000000
11:37 PM rue_mohr: Resistance is : 0.180000
11:37 PM rue_mohr: so its only good for 17A
11:37 PM rue_mohr: huh
11:38 PM rue_mohr: if your motor driver dosn't work out, can I help design a new one?
11:40 PM AchiestDragon: the 36v version is lower current than the 18v version , winding sdiferent but same motor frame ,, so 12 to 40v , current no load 1.4a and 65a stall current
11:41 PM rue_mohr: fuse @ 17A
11:41 PM rue_mohr: *just a suggestion*
11:41 PM AchiestDragon: yea
11:42 PM AchiestDragon: i still have some 3d printed fan shrouds / mounts and fans to go over the driver boards also
11:55 PM AchiestDragon: i should look at doing some supply current limiting like https://i.stack.imgur.com/4YTF0.png
11:56 PM rue_mohr: fuses work
11:56 PM rue_mohr: I could give you the circuit I used on my hex, its designed to be ___FAST___
11:56 PM rue_mohr: unfortunatly, its too fast, 1 pwm pulse clicks it out
11:57 PM rue_mohr: needs a filter
11:57 PM AchiestDragon: yea but fuses will just stop it and need to be replaced when they go , current limiting will just limit it while the loads high
11:57 PM rue_mohr: its resistor and relay based
11:59 PM rue_mohr: 0.01 ohms
11:59 PM rue_mohr: digitally monitorable and resettable
11:59 PM rue_mohr: the computer can argue with the overload, but not just hold it