<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Crazy design!  I don't know if I could have figured that out.  Cool that you did! <br><br>> Date: Sat, 9 Apr 2016 18:57:16 -0500<br>> From: jake@spaz.org<br>> To: maltman23@hotmail.com<br>> CC: sudo-discuss@lists.sudoroom.org; adam@aperture.systems; organic_unity@yahoo.com; emmaselephants33@gmail.com; echoudhry@gmail.com<br>> Subject: RE: [sudo-discuss] vending machine homing switch mystery solved<br>> <br>> mitch there are 42 motors, arranged in a row/column grid<br>> <br>> this way there are no extra wires.  you have to be able to detect the <br>> "home" state of each product independantly!<br>> <br>> the other vending machine, a "snackshop II" uses a totally different <br>> system.  AC power is wired to all the motors through their homing switch, <br>> so they will automatically turn until they are at "home" position.<br>> <br>> Then there is a single wire from each motor to the appropriate button on <br>> the front of the vending machine, and when the meatbag presses the button <br>> of the product they want, current flows through the money-counting circuit <br>> (and through diodes corresponding to the 5-bit value of nickels to charge <br>> for the product!) and if the mortal has paid for its food, the circuit is <br>> closed and the motor runs despite its Home position - but only for long <br>> enough for the motor to leave "home" and then the home switch runs the <br>> motor until it gets home again - after the user has been served.<br>> <br>> we use this charlieplexed optocoupled-triac board for that machine:<br>> <br>> https://github.com/sudoroom/hackomat<br>> <br>> -jake<br>> <br>> On Sat, 9 Apr 2016, Mitch Altman wrote:<br>> <br>> > That is a bizarre way of detecting "home".  Since there's a switch, wouldn't it be easier to just connect the switch directly to the Arduino to detect "home"?<br>> > <br>> > <br>> > -----------------<br>> > > Date: Sat, 9 Apr 2016 17:42:06 -0500<br>> > > From: jake@spaz.org<br>> > > To: sudo-discuss@lists.sudoroom.org; adam@aperture.systems; organic_unity@yahoo.com; emmaselephants33@gmail.com; echoudhry@gmail.com<br>> > > Subject: [sudo-discuss] vending machine homing switch mystery solved<br>> > ><br>> > > so i've been working on the black sudoroom vending machine (vending1):<br>> > ><br>> > > https://sudoroom.org/wiki/hack-o-mat<br>> > ><br>> > > which had previously been hacked by students at UC Berkeley (i think)<br>> > ><br>> > > I believe it's a Snacktron like Emma and Ed's machine.<br>> > > (unlike our brown vending machine which is a snackshop II)<br>> > > pictures of their machine can be seen here:<br>> > > http://spaz.org/~jake/pix/vend/<br>> > ><br>> > > they had ripped out the original control unit, and wired it up with a<br>> > > bunch of reed relays and an arduino. The motors of the vending machine<br>> > > are wired as a grid of rows and columns, so the controller needs to be<br>> > > able to enable a single row and column in order to power one product<br>> > > motor.<br>> > ><br>> > > But it also needs to be able to detect when the product motor has rotated<br>> > > a full turn, and is back at the "home" position where it needs to stop.<br>> > > There's a "home" sensor on the back of the motor, but the way it's wired<br>> > > was a mystery for a while. Here's some pictures of the homing circuit:<br>> > ><br>> > > http://spaz.org/~jake/pix/vend/IMG_20160401_015211.jpg<br>> > > http://spaz.org/~jake/pix/vend/IMG_20160401_015700.jpg<br>> > ><br>> > > as you can see, the only difference between the button being pressed or<br>> > > not pressed, is that the 420nF capacitor is in parallel with the motor or<br>> > > not. Since the whole thing is in series with a diode (to protect against<br>> > > trying to turn a motor backwards) we were stumped as to how to detect<br>> > > whether a motor was homed or not.<br>> > ><br>> > > Thanks to Zach who donated some test equipment including this awesome<br>> > > signal generator (along with a nice power supply and bench multimeter):<br>> > > http://imgur.com/LTSFfOe<br>> > ><br>> > > I was able to connect an AC waveform in series with a 12VDC supply to one<br>> > > of the motors, and figure out how to detect whether the home switch is<br>> > > closed or not. Basically, you make a 31KHz (or similar frequency)<br>> > > squarewave in series with the power supply, and watch the current through<br>> > > the motor. If the button is open and the capacitor is not in-circuit, the<br>> > > motor's inductance absorbs the AC and the current draw is relatively<br>> > > smooth. But when the motor arrives at the home position (when you need to<br>> > > stop delivering product!) the capacitor gets switched in, and now you'll<br>> > > see a lot of the AC on the current path of the system.<br>> > ><br>> > > Here is a video showing the voltage across a 22-ohm series resistor while<br>> > > the motor is rotating with 12VDC:<br>> > ><br>> > > https://www.youtube.com/watch?v=xHIGDw5HRCg<br>> > ><br>> > > apparently it takes that motor about 11 seconds to dispense a product and<br>> > > finish returning to home position, assuming the product weighs nothing.<br>> > ><br>> > > by the way, you'll notice that i'm using the old analog oscilloscope.<br>> > > Unfortunately the LeCroy 9510 has started crashing, basically<br>> > > bluescreening. It probably needs to be opened up and cleaned, as it got<br>> > > wet after a fire before it was donated to sudoroom.<br>> > ><br>> > > Or maybe someone wants to donate a nicer oscilloscope to sudoroom?<br>> > ><br>> > > anyway, now I know how to detect the motor homing signal, and I just need<br>> > > to wire up this machine to its arduino to detect the signal and dispense<br>> > > product more accurately. If anyone wants to help, please let me know.<br>> > ><br>> > > by the way, if you are wondering how the UC students detected when the<br>> > > motors were finished dispensing product, the answer is absurd:<br>> > ><br>> > > they put a laser beam across the path where product would fall when<br>> > > dispensed, and they watched for the laser beam to be interrupted.<br>> > ><br>> > > did it work? I don't know. probably the semester ended and they got<br>> > > their grade and moved on, and then they donated the vending machine to us.<br>> > ><br>> > > -jake<br>> > > _______________________________________________<br>> > > sudo-discuss mailing list<br>> > > sudo-discuss@lists.sudoroom.org<br>> > > https://sudoroom.org/lists/listinfo/sudo-discuss<br>> > <br>> ><br>                                        </div></body>
</html>