I painted the disc a pale grey to look like the white of the eye in shadow, then epoxied it to the side of the servo and waited overnight for the glue to be nice and hard. Really, I should have measured it up to be sure it was exactly centered, but instead, I just eyeballed it.
Just Brown and Servo download movies
I was really stumped, tried a second servo with the same results, and was about to settle for being Nervous Tic Moody when I decided to download the spec sheet to try and understand the motor better. To my surprise, the pulse durations needed to make the motor swivel were much greater than the ones being produced by the Servo Driver library included with the Adafruit tutorial. After I modified the library, I was getting a good 120º of swivel, which was actually too much for my setup, I tweaked the values to get a swing from about 20º to 75º that looked good to me.
A side effect of this decision is that the circuit board would spend the evening jabbing me in the eye as the servo swivelled, even after I covered the whole lot with a leather pad. Nothing major, just mildly annoying.
After starting this project I found that Trinket 5v boards just aren't recognized by a lot of modern computers. I ended up using a Trinket m0 and adapted the bionic eye CircuitPython code to match what was done here. The m0 was recognized immediately and you just drag and drop the code in a code.py file along with the servo library. Also make sure your m0 is updated to support CircuitPython 7 or greater or the servo library won't work. Hope this helps someone:import timeimport randomimport boardimport pwmiofrom adafruit_motor import servo# we are intentionally avoiding Trinket Pin #1 (board.A0)# as it does not have PWM capabilitytilt_servo_pin = board.A2 # servo control line (orange) Trinket Pin #0# servo object setup for the M0 boards:tilt_pwm = pwmio.PWMOut(tilt_servo_pin, duty_cycle=2 ** 15, frequency=50)tilt_servo = servo.Servo(tilt_pwm)# servo timing and angle rangetilt_min = 35 # lower limit to tilt rotation rangemax_rotate = 55 # rotation range limited to half circlewhile True: # servo tilt - on average move every 500ms if random.randint(0,100) > 80: tilt_servo.angle = random.randint(tilt_min, max_rotate) time.sleep(.25)
To those who have never worked with trinket and do not have programming experience, I found the instructions on the Trinket link confusing. I wish there was a video tutorial. I searched and found that programming my eye after all the work was beyond my abilities. To those in the same category, here is my brut force solution. I just grabbed the Servo and ran it hard back and forth until all the gears were stripped. Now the eye would sit in place but swivel freely back and forth and I was much better at controlling it than the random movement program I think this set up uses. I bought a dial to control my servo as if I was ever going to get that far. Ha Ha. The problem is in the Adafruit Arduino IDE set up guide instructions. Lots of steps that are glossed over as being easy or simple I found simply were not. So I hope this short cut helps anyone who still wants to finish their project but finds the deadline creeping up on them. Here is the final result. I used a 30mm glass eye and used a belt sander to sand the back flat as I wanted more than half an eyeball showing. I used a different bigger can and lid, but otherwise followed the instructions. I was able to cut my strap slits with a sheetrock knife and used hot glue to attach it back on itself so that the sharp cut did not cut the strap. I sewed a stretching fabric connector in the back to keep it firmly in place all night. .
I finally made it to the end with all the electronics and wiring after a couple of weeks. First time for me. I have a twitchy motor like you mentioned. I'm having a hard time seeing what changes you made in the download of the servo library. It looks like the code from the adafruit github page. What changes need to be made to make it more than twitch? Or maybe I do have it but just have weak connection here. This was a very fun and humbling project. Thanks so much.Actually, I redownloaded and saw the updated times 500,2400. What are the other 2 values in that line ,micros = map(a, 0, 10, 1000, 3400); What does the 0,10 mean. I have been futzing with them for half hour trying to get it to swivel equally on both sides and I can't deduce what these values mean and can't get it to swivel right.
To get the ball rolling, this step will explain one of the most important aspects to any electrical system, and something that can sometimes cause confusion or can be overlooked... "Amps" (also referred to as "Current" or "Amperage").What are Amps and Current..."Current", is a measurement of how much electrical charge flows through an electrical circuit. The more charge that flows, the bigger the current. Current is measured in units called amps. The symbol used to define amps is depicted with an "A". As an example, "10A" is a smaller current than 20A.The definition of "Current" from the Oxford English Dictionary...Quote:1.) A body of water or air moving in a definite direction, especially through a surrounding body of water or air in which there is less movement:2.) A flow of electricity which results from the ordered directional movement of electrically charged particles:You will see one thing in common in both of the above statements... direction. Current, only travels one way, which is from a power source to a device. A device will "suck" (referred to as "draw") only the amps it needs from a power source. It is very important to know that in any electrical system, amperage will present problems if you try to attach a device that will draw more then the circuit or power source can handle. This could be through the cables, connectors such as jacks and terminal blocks, or other devices that the same current passes through. Issues can also arise if the device in question draws current away from other devices connected to the same circuit.One thing that gets overlooked quite often, is how important current is. EZ-Robot has this covered with their Revolution robots by supplying LiPo battery packs (more info about batteries in step 4). But when it comes to custom made robots, or indeed powering a revolution robot with something other than the supplied battery, problems can sometimes arise. Below are a few examples of questions that people ask quite regularly on the forum..."Why won't my robot won't move.""My EZ-B keeps cutting out. why?""Why does my EZ-B keep resetting?""Why does the EZ-B in my robot keep browning out?"Sometimes, the reason maybe that the battery needs charging, an i2c cable is lose, or an initialization script has not been run. But the most common reason, is inadequate current. For example, someone will use a wall adapter with the correct voltage instead of a battery, and will try to move servos or motors connected to their EZ-B. The problem comes when they find out that the wall adapter is only supplying 2 amps, where as a single servo could need 3 amps and more for "servo inrush". Servo Inrush.This term is used to describe the action of a servo, or indeed a DC motor, when it first begins to move. Lets use a single EZ-Robot HD Servo for example. When the servo begins to move, a very brief (few millisecond) surge of current is drawn which can be 3 Amps or more depending on the weight of what the servo is moving or lifting. The current then drops to its "running" current which is usually around 200mA (milliamps). So a 2 amp power supply will not be enough to handle the 3+ volts for the servo inrush.The following is a quote from one of EZ-Robots valued community members, Dave Schulpius, and gives a very good and simple analogy of an electrical circuit... Quote:A comparison I like to use for electrical theory is it's like water in a pipe:*The water is the current (amps). It does the work. *Pressure behind the water is the voltage. It pushes the water along. *The pipe is the conductor (wire, connectors or traces) and needs to be the proper size and type (resistance) . It carries the water along through the pipe that the pressure is pushing.And if you like pictures...With a large water pipe (large gauge wire or cable), the more the current can flow and deliver more amps. This turns the waterwheel (or servo).With a narrow water pipe (small gauge wire or cable), far less current can flow, and delivers less amps which is not powerful enough to turn the waterwheel (or servo). Or to put it another way, you drink a glass of water.The Math.As the main culprit of current draw on a robot are motors and servos, you will need to work out the inrush current for every servo and/or motor that you are going to use, whether servos are connected to an EZ-B, or DC motors are connected to a motor controller with separate power supply. From each servo or motor, you add up their "inrush current" figures, and that is the minimum current you need to supply. To do this, count up the number of servos, number of motors etc. Multiply the number of servos and motors by their inrush current. Add everything together and that's the minimum amps to aim for.Let's take a typical setup. Say you are running three servos with an inrush current of "3A", and two DC motors with an inrush current of "5A" and one DC motor with an inrush current of "3A" all at the same time...2x 3A = 6A2 x 5A = 10A1 x 3A = 3AThe total inrush current works out at "19 amps". This would be your minimum current needed that your power source should deliver.If the power supply you are using cannot provide the amount of current that is needed, it will cut out, or in the case of an EZ-B, brown out ("Brown Out" is the term used when the EZ-B becomes unresponsive. Turning the power off and on again ("Power Cycle") will put the EZ-B back on normal operating mode).You may see the term "mAh" or "aH" mentioned a lot around the place. "mAh" means milliAmp hours, and "aH" is amp Hours. This will mainly refer to a batteries capacity, meaning how long a battery can run a device at a certain amperage. For example a LiPo battery that is rated at "1000 mAh", would be completely discharged in one hour with a 1000 milliAmp load placed on it. Now if this very same battery had a 500 milliAmp load placed on it, it would take 2 hours to drain down. If the load was increased to around 15,000 milliAmps (15 amps), the time to drain the battery would be only about 4 minutes. To Summarise Amps.! Not supplying enough amps will cause problems, and the servo will not move. ! Supplying to many amps won't cause any damage as the servo will only take what it needs. To use another analogy, we will use three drinking straws... small, medium, and very large.You take a drink of water with a small straw. You take a big suck, but you won't get very much drink and you may not be satisfied.You take another drink of water with the large straw. You will probably get too much drink and won't be able to take it. But, your brain knows this, so if you know not to use the large straw, or suck gently and just what you need, much like a servo for example. The circuitry knows what how many amps it needs to operate, and wont take more than it can handle.Finally, you take a drink of water with the medium straw. You get just the right amount of drink you want.! Caution is needed though. Using "very" high amperage and encountering a short circuit can cause a lot of damage, so use correctly rated fuses or circuit breakers where possible.The following is a quote from an 80's movie that best describes the power of amps when discussing touching the third rail of of a train track...It's not the volts that will kill you... It's the amps! *eek* 2ff7e9595c
Comments