Author
Topic: Amateur Question (Read 2696 times)

I'm building a little tank robot with my son, but without much basis in electronics finding it a little difficult. Is there anyone who could help us with the electrics, am willing to pay for someones time to tell us how to design what we're after. I believe I can do the programming (am programmer by trade), but need to work out how to fit all the electronic components together with correct voltages etc.

We also want to be able to control the speed of the fan via a knob.We want the ability to set a timer, so would need a clock that the robot controller can grab the time fromLastly, we want the battery to be rechargeable without disconnecting anything (e.g. a separate cable that we can plug into a charger without disconnecting battery from robot)

I know it's a big ask, but if you're after a little cash throw me a quote :-))

[...] need to work out how to fit all the electronic components together with correct voltages etc.[...]Lithium Ion Battery Cell - 3.7V 2000mAh[...]Computer Fan specifications:Voltage, 12VVoltage Range, 6-13.8V

Not sure why you want a fan in the first place, but as a programmer, you can surely see the problem driving it.There might be some of the other stuff needing a bit more than 3.7V as well (Didn't check each part).

I know it's a big ask, but if you're after a little cash throw me a quote :-))

"A little cash"?... We don't need no stinkin' "a little cash"

If you start with the beginning... Not how you want to bake the cake or the list of ingredients, but your ideas of how it should be, the approx. dimensions and what it should be able to do, then it's easier to decide on the the rest.

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

Sorry about the brain fade. The fan although rated 12volts we are doing some testing as we don't want it to spin that quick, so a drop in voltage should be fine. I'll be testing that in the next week or so which will enable us to determine what we require better as far as voltage range to run the fan. It's difficult to explain but the fan is to create a small vacuum effect. I'm hoping that 3.7 volts will be enough to move it at the speed required. Otherwise we will look at 5v fans or higher rated batteries.

The Fan speed would be affected by voltage, so we basically need a knob that allows us to set the amount of voltage being received by the fan. It would only run when the unit is On (whether by setting the unit to On or when a Timer has activated). Thanks for the info on the controller!

I'll do our fan tests and get back to you with regards to that.

With regards to controllers I really don't understand how the voltage requirements work, for example the dual motor controller says:The motor supply voltage range is 4.5 to 13.5 V; the continuous current per channel is up to 1 A (3 A peak). The logic supply can be as low as 2.7 V, allowing operation with modern microcontrollers running at 3.3 V.The motors themselves will spin from 0.6v to 6V.However, if the battery is for example 3.7V then I could not supply 4.5V-13.5V controller for the motor supply voltage (even though the motor will run fine on 3.7V). So I'm confused as to why the motor supply voltage range on the controller has a minimum? (noting that the website says the controller and gearmotor are a great match)

The fan although rated 12volts we are doing some testing as we don't want it to spin that quick, so a drop in voltage should be fine. I'll be testing that in the next week or so which will enable us to determine what we require better as far as voltage range to run the fan. It's difficult to explain but the fan is to create a small vacuum effect. I'm hoping that 3.7 volts will be enough to move it at the speed required. Otherwise we will look at 5v fans or higher rated batteries.

Most 12V fans completely stops working at around 6V (5..7V).For any kind of useable vacuum (I'm imagining you want to increase traction?), especially with such small fan, you don't want to feed it a lower voltage, rather up it around 25% of rated voltage (i.e. 15V for a 12V fan), as the air flow will fall more or less exponentially with the voltage and the small fans, especially the thin ones moves very little air, compared to their larger cousins.

The Fan speed would be affected by voltage, so we basically need a knob that allows us to set the amount of voltage being received by the fan. It would only run when the unit is On (whether by setting the unit to On or when a Timer has activated). Thanks for the info on the controller!

It's better to control the fan with a PWM signal from the controller (via a transistor) and that way you can turn it on/off by the program as well and the speed can be changed based on some sensor input if required, or by a potentiometer (a "knob") connected to the controller.

I'm not aware if you got some of the stuff already, but you don't need the motor controller, as it's alreasy included on the Baby Orangutang board (same H-Bridge chip).

With regards to controllers I really don't understand how the voltage requirements work, for example the dual motor controller says:The motor supply voltage range is 4.5 to 13.5 V; the continuous current per channel is up to 1 A (3 A peak). The logic supply can be as low as 2.7 V, allowing operation with modern microcontrollers running at 3.3 V.The motors themselves will spin from 0.6v to 6V.However, if the battery is for example 3.7V then I could not supply 4.5V-13.5V controller for the motor supply voltage (even though the motor will run fine on 3.7V). So I'm confused as to why the motor supply voltage range on the controller has a minimum? (noting that the website says the controller and gearmotor are a great match)

The controller (Baby Orangutang) has got an LDO voltage regulator at its input, which means that it needs a minimum of 5.2V (to stay in regulation).The H-bridge motor voltage is taken from the battery voltage, same as the input of the regulator (so 5.2V minimum).You should use PWM to slow the motors, just like the fan, but when you include the losses and the weigth of the fully loaded 'bot, you probably end up needing a higher voltage than you think now.The minimum voltage is dictated by what voltage the components need to work reliably and if just one component needs 5.2V, it doesn't help that some of them can work from 2.7V.Your motors may be able to turn unloaded from 0.6V, but don't expect to see it move at that low voltage when loaded (i.e. when trying to move the 'bot).

This is a slow moving vehicle so lower voltage will be fine. Longest possible battery life is important as is the smallest size (therefore the choice of battery Li-Ion seems like the best option - if you have another suggestion for a 5v battery that is similar size and would have a similar life that would probably be ideal).

Slow it down by PWM. When you get a bit more into it, use encoders on the wheels, then you can program the controller to keep a certain speed (even if the battery voltage falls while discharging).You haven't revealed the size of neither the 'bot, nor the battery you have in mind, so I have to be general about it. Within a given chemistry, the Watt-hour rating roughly follows the size, so if you need twice the voltage in the same size, the available capacity (mAh) will be halved.With a rechargeable battery, runtime isn't all that important, as long as it allows you to run it for a reasonable time, so I'd recommend getting a 2-cell lithium battery, as 1Ah (1000mAh) would still give you at least an hour or two, depending on how the motors are run - even with both motors blocked, you'd still have juice fr more than half an hour (but your motors would die screaming long before your battery went flat).

You'd be looking for a battery specified as 2S (for 2 Series connected cells), or just go with two single cells - sometimes you can find cheap cell phone or MP3-player batteries (I got some intended for a handheld Gameboy of sorts at around $3 a pop).

A small circuit should be included to keep the cells balanced on both charge ad discharge, especially when you want to charge them on-board.

This is good for up to 300mA max. and your motors takes more.Beefier boost converters can be found though and you don't need a SEPIC converter if you just need boost, like if you used either a single lithium cell or two NiMH cells. and wanted eg. 5.5V out. A SEPIC regulator converts both up and down, so if set for eg. 5V out, it will be so over the entire input range (1.5V to 12V with the mentioned converter).

Do you have a soldering iron intended for electronics assembly? (You need it)Do you have a multimeter? (Even the cheapest sub-$10 'meter will make your life a lot easier building this and can be used for a lot of other stuff as well).What should the robot do besides driving?

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

So my questions are:1. Given the Baby Orangutan can control two DC motors, and I have two gearmotors, where does that leave me with the fan? What would I need to control that via PWM, and how to attach a knob to control the fan speed?2. Do I need a step up/down regulator if I'm connecting the DC motors directly to the Baby Orangutan and everything will run at 5V?3. What do I need to charge the battery on board?4. What else do I need (apart from a fair bit more knowledge :-)))?

I'll be getting a new soldering iron before I start this (my old one is not looking in great shape!), and have a multimeter.

[...] should I be looking at: [snip] - my max length for the battery is 68mm so this will fit.

That sounds like a good choice, but be aware that chinese batteries are very oft4en extremely over-rated - in some cases real capacity can be down to half. I don't know this seller of course, so they may be legit, but I'd still check up on some non-chinese batteries as well (I can try finding something later if you come up empty handed, but after this post, I'm venturing out into the Big Room for the rest of the day).

If the battery is 1200mAh and the motors each take say 100mA on average (if driven more or less continuously), you'd have around 5..6 hours of runtime a charge.For the PCBoard, a matrix-board (Vero Board) of some persuasion may be the easiest

So my questions are:1. Given the Baby Orangutan can control two DC motors, and I have two gearmotors, where does that leave me with the fan? What would I need to control that via PWM, and how to attach a knob to control the fan speed?

1a) Exactly where you need to be The fan should be controlled from an I/O-pin, via a small signal transistor like BC337 or 2N2222 and one or two resistors, I'll draw you a schematic later.1b) Your controller (Baby Orangu) and you caan read a potentiometer either via an A/D-C pin or via a digital pin.Alternatively you could make a tiny cheap circuit to drive that as a separate entity, but then you loose the direct program control over it - (might be worth it for now though, to simplify things). An external fan controller could be made to boost the voltage if you need to go with a 12V fan.

2. Do I need a step up/down regulator if I'm connecting the DC motors directly to the Baby Orangutan and everything will run at 5V?

No, but the motors won't see the full 5V (I guess that's fine anyway).For now, just run everything on 5V. It's fairly easy to change later, if you eg. want a higher speed. Especially if you use pin headers for connecting the motors and everything else.

A 2-cell lithium charger, preferably with balancing and a 3 pin polarized connector mating the battery.Later on, you can use the controller as a charge controller as well, but you need a bit of experience first, as lithiums are not something to play with blindfolded.

The locomotion parts (belts and rollers in your case), a chassis to hold everything together, a head full of hair to pull (way better than throwing a PC through the window ) and patience towards yourself.

Programming exercises:Start with flashing a LEDs from the controller, then 2 LEDs and when you have that down, start getting a motor to run forwards and backwards - one step at a time is the right pace.

I'll be getting a new soldering iron before I start this (my old one is not looking in great shape!), and have a multimeter.

Great. If you plan to mak a lot of robots or other electronics for years to come, don't get a cheap soldering iron.My personal preferance is a Weller soldering station with adjustable temperature - the one I use the most is a Weller WTCP50 (50W and you change the temperature by using a bit made for 600, 700 or 800°F, on newer models you set the temp. on a dial/knob) - I bought it around 1976 and for a good part of the time, it has been on 24/7. I have cleaned a switch inside it around 3 times, but never had to replace any part (other than bits of course, but there's years of service in a Weller bit).Whichever you get, be sure to get a solder sponge for wiping the tip, prior to each joint you make and keep it damp at all times when you use it (not wet, just damp - the purpose is to keep it soft and able to withstand the heat).

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

I'm not trying to scare you into a more expensive battery! I personally wouldn't pay the extra for something I used myself... If it was for my grand children OTOH, I'd pay ten times that to keep them as far as possible from even the tiniest chance of malfunction

And I honestly believe that lithiums only get bad if mistreated physically, if bad from the production line, it would likely burst into flames while bouncing down the conveyor belt, rather than months later. Common sense is a must with any chemistry

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

I actually bought the Venom battery yesterday, as long as it will suit I'm happy. It's a small size for 1300mAh at 7.4v which was my main requirement :-)

Looking forward to getting all the bits and pieces. In the mean time, as funny as it sounds, my son has one of the large snap circuits kits so going to do a bit of a hands on refresher with that first for both of us!!

I actually have a Venom Pro Charger I bought when my son was playing with some RC Trucks a couple of years ago. The one I have supports fast/slow charging pretty well any LiPO battery, so at this stage I'll just use that ;-))

I actually bought the Venom battery yesterday, as long as it will suit I'm happy. It's a small size for 1300mAh at 7.4v which was my main requirement :-)

No problem then - and if your charger is guaranteed to work with a 2-cell lithium, it should be OK.

Does your charger have a balance connector (for the 3 thinner wires separate from the main output wire from the battery)?

You can make a lithium monitor yourself. All it needs to do is, to keep the cells from becoming too flat - they shouldn't get below ~3V/cell, or 6V in your case - most cells will accept down to somewhere in the interval around 2.4V to 2.6V, but 3V is a good point, in case you don't get them to a charger right away.

A monitor can either be a complete cut-off at 6V, or it could include a flashing LED and/or a beeper warning a bit before the point is reached - both warning and cut-off can be made with a cheap dual op-amp like LM358, a voltage reference and a little "glue" components and there's monitors for a simple "voltage reached" in a TO-92 case (like small signal transistors) which work as well.

Looking forward to getting all the bits and pieces. In the mean time, as funny as it sounds, my son has one of the large snap circuits kits so going to do a bit of a hands on refresher with that first for both of us!!

Oh, he must be older than I first imagined then

I don't know much about those kits, or what components they hold, but if you're interested, I have a circuit for driving a 12V fan with 6V to 14.5V out, set by a potentiometer and powered from 5VSimple circuit, but slightly complex behaviour, so I don't know how much you'd learn from it though.

Yes the charger has about 20 different connectors for all kinds of batteries :-) Works fine. Will look into a lithium monitor a little bit further down the track.

The SnapCircuits kit only has about 6 resisters so nothing as complex as you're imagining I don't think. Billy is 11 years old!

We've done some tests on the fan side of things, built the base out of acrylic and lo and behold you were right, we need as close to 12 volts as possible to run the fan fast enough to pick up anything apart from balls of styrofoam. We also had a play in solidworks and re-did the concept so that it's smaller. This unfortunately makes our battery useless so back to the drawing board on that one.

Trying to balance size (making it as small as possible) vs length of operation is oh so much fun.

The space we have available is 57 x 20 x 27mm. We can probably extend the 27mm or 57mm sides a little if necessary, but the 20mm is fixed. Given we are after a 11.1V minimum for the fan now which are we better off doing:1. 11.1V battery with smaller mAh2. 7.4v battery with larger mAh where I'd need a step up voltage regulator

The green leads on either side connect to two motors which I can control the speed of through PWM beautifully.

Problem 1: My initial problem is that the power on/off button on the switch simply doesn't work. I've resoldered it a few times and for some reason pressing the button does absolutely nothing, the unit always stays on. I've tried everything I can think of.

Problem 2: I really don't know how to proceed as far as voltage/resisters etc. to connect the following components: -A: Reflectance Sensor (http://www.pololu.com/catalog/product/959). I intend to use this to detect if the robot has moved under something.B: Accelerometer (http://www.pololu.com/catalog/product/1251). I intend to use this to determine if the robot is moving and in which direction.C: The 12 volt fan. At the moment I don't have a step up voltage regulator but intend to purchase this if suitable (http://www.pololu.com/catalog/product/2120). The fan needs to be able to be turned on and off by the Baby Orangutan controller. At this stage lets not worry about making it adjustable. Like to get as close to 12V to it as possible.

I'm assuming I can power both the accelerometer and reflectance sensor off the VCC 5V pin on the Baby Orangutan. The supply current should be sufficient for both.

Had no problems with the reflectance sensor which is great.

The fan is another issue entirely. I need to be able to turn it off/on through the Baby Orangutan. So I assume I would connect something like this:main power feed -> step up voltage regulator (set to 12v using the on board POT) -> 12 volt fanHowever, what do I need to enable the orangutan to turn it on and off?Should I use this switch (http://www.pololu.com/catalog/product/750) which can programatically be turned off and I assume on.Or can I just use a basic three pin transistor?

Problem 1: My initial problem is that the power on/off button on the switch simply doesn't work. I've resoldered it a few times and for some reason pressing the button does absolutely nothing, the unit always stays on. I've tried everything I can think of.

I cannot find a schematic for it on the Pololu site, did you get it with the switch and if so, can you post it?It's imposssible to trouble shoot a circuit "blind".

Problem 2: I really don't know how to proceed as far as voltage/resisters etc. to connect the following components: -A: Reflectance Sensor (http://www.pololu.com/catalog/product/959). I intend to use this to detect if the robot has moved under something.

"Under something"?Did you notice the..."Optimal sensing distance: 0.125" (3 mm)Maximum recommended sensing distance: 0.375" (9.5 mm)"? Other than that they're not complicated at all and the page gives a full description on how to use it.

Just note the "external components (such as voltage dividers) are required when interfacing the board’s g-Select and Self Test pins with 5V systems" and you should be good.The A/D converter reading it should be set up for 3.3V, if that's possible at all, to give the best resolution.

C: The 12 volt fan. At the moment I don't have a step up voltage regulator but intend to purchase this if suitable (http://www.pololu.com/catalog/product/2120). The fan needs to be able to be turned on and off by the Baby Orangutan controller. At this stage lets not worry about making it adjustable. Like to get as close to 12V to it as possible.

The one I designed do change with the input voltage and the PCB are for through-hole components, as ithe intention is to make it easy to get parts for and contrary to ready made units, gives you insight in how it works (although a thorough walk-through isn't in the documentation yet). Made with SMDs it could be just as small, but that's not the point for me - simplicity, basic component selection and the potential to teach people how it works is.I'll PM (since it's not yet as fully documented as I want it) you a file with this variable switcher, if you want it, but do not publish or redistribute it!

The component list that I posted has changed a little, mainly to linearize the potentiometer/output voltage dependency, as it started out as exponentially ugly as the Pololu switchers and that makes it very hard to set the output voltage, as most of the range lies in the last 10% of the potentiometer range. Mine is linear now, with a 30° rotation per volt (on a common 270° pot) and its efficiency from 9V to 15V averages to ~90%

It's easy to make it controlable by a logic level, but it's not included as is, as most people will want it to be on when powered and extra (idle) components are banned in my circuit

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

Firstly you are a champion. Thanks so much for helping with this. I think I've nearly got the electronics side of things down using the off the shelf components now. One day I'll try to disect and build from scratch rather than just assembling components, but for now I nearly have enough working to finish building the design in solidworks, 3d print the pieces and assemble!

I got the ambient light reading perfect using the reflectance sensor by breaking one of the resistors which turned off the IR emitter. This enables me to detect changes in ambient light (e.g. when it moves under something).

Accelerometer works okay, will figure out whether I can get enough data from it to determine movement and collisions on the first build, I think it should be okay. I don't want to use the wheel encoders due to space. I don't see the need to even connect the self-test or g-select pins.

I used a transistor to turn on/off the fan which works brilliantly and was far easier than I'd imagined. So I'll just put the voltage booster (when it arrives) between the transistor and the fan and that should be good.

2. How to charge the battery. The Lipo has a power output (2 pin) and balancing output (3 pin). To charge can I just splice the power output? Or should I splice both allowing the charger to use the balancer as well? Or is there a better way of doing it?

I don't see a way to read back the value to the IC. Ideally I want the robot to detect it's low, say under 6.5V, then I'll swap green headlights for red ones, then if it drops to 5.5V or below to switch off.

You're right... They're meant to be read off directly by eye.

You don't need a monitor anyway, a voltage detector that tells the controller when the battery falls below ~6.0V will be more than sufficient. They are made by several manufacturers (and in several voltages) and come in (amongst others) a TO-92 package (like a common small signal transistor) which makes them easy to use, just connect B+, ground and the output (to an I/O line) - it doesn't get any simpler

You can use two if you want the "near flat" indication of course and you can even use the same type, as they can be modified with a couple of resistors.

Your next 'bot will use this signal to return to it's charging base for an automatic recharge of course

2. How to charge the battery. The Lipo has a power output (2 pin) and balancing output (3 pin). To charge can I just splice the power output? Or should I splice both allowing the charger to use the balancer as well? Or is there a better way of doing it?

I'd make up a charging lead of a good quality (i.e. the fattest gauge of copper you can find) cat-5 cable (Ethernet cable) and mount an RJ-45 socket on the 'bot.Then connect the other end to two 4mm "banana" jacks (I guess from the pictures in the manual) and whatever the needed connectors are for temperature monitor- and balancing ports.No need to chop up the temperature monitor that came with the charger, just measure it at two temperatures (like eg. 25°C and 45°C) and get an NTC resistor with the same parameters.

Mount the NTC in touch with the battery and wire this, the balancing connector and a tap into the power connector the RJ-45 socket.

Just in case you should wanna ask if the temperature monitor is absolutely necessary... No, but... Summer of '74, I poured around 0.25l benzine into a glowing hot oven full of glowing embers (don't ask ) *kapoof* and I spent the rest of that summer in a hospital bed (2nd and 3th degree burns from my waist up to my forehead) and from what I've heard about lithium fires, they're nastier than benzine and your son is 11 - well... You decide whether you need it Good thing though, you heal better when you're young

The outer pins of the balancing connector is connected to the same points as the power connector, but in a Kelvin configuration, where the wiring resistance of the power plug etc. doesn't influence the voltage read by the balancing wires.

If you can't find good quality cat-5 cable, you can add a 2-wire lead of a heavier gauge to the cat-5, but then you'll need another plug or the RJ-45 and an extra two conductor plug - Either way, make sure you cannot easily charge without the temperature monitor and balancer in place.

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

Fan obviously connects to ground to complete the circuit as does the Baby Orangutan.

So if I'm getting this at all...lol...your saying that that 5V on the base is the limit, and I should reduce that by a couple of volts. So if I for example:If I want to drop by 2 volts I would work out the required resistance:(2 Volts / 0.2 A = 10 ohms)

So I would really want to put a 10 ohm resistor between the base and the baby orangutan.

If I'm off the mark here, could you please try to explain it to me or point me in the direction of resistance for dummies..haha :-)

The base current is 20mA (the output from the Baby Orangutan digital IO pins)

This is the MAXIMUM current output from the processor pin. Not the base current.

Quote

I can't seem to find an output value for it for the base current at all in the documentation.

You won't. The base current is set to Collector current divided by current gain of the transistor (Hfe). The transistor you linked to has an Hfe of 96 to 246 (use 100 or 150 for calculations).

You need a resistor in series from the processor output to the transistor's base. This resistor sets (limits) the current to the base. With the emitter grounded (NPN), the base is about 0.6V maximum (one diode drop). So, the base resistor needs to drop 5V - 0.6V = 4.3V.

How much current does the fan draw? Lets assume 0.2A, which would be the collector current.With an Hfe of 100 you need 0.2/100 = 0.002A of base current.The series base resistor is then calculated with Ohm's Law, 4.3V / 0.002A = 2150 Ohm. Since I used the minimum Hfe a slightly higher value resistor will work so use a 2.2K.This will turn the transistor fully on when the processor's output is high (logic 1).The fan is connected between the +5V PS and the collector.

Regardless I still need to drop the base resistor as you said to 4.3V, so to do that I would need to do:

Calculate base current:0.1 / 100 = 0.001A

Resistance calc:4.3V / 0.001A = 4300 OhmSo 4.3K resistor

Now things I don't understand:1. How did you reach 0.6V with the emitter grounded?2. When you say the fan is connected between the +5V PS and the collector, what do you mean? The fan is currently connected to the emitter and back to the main ground?

So, with a converson efficiency of slightly below 90%, you need around 1.1W into the converter.As around 0.2V is dropped over the transistor and your battery is flat at say 6V, you need to calculate for a worst-case 5.8V source, which gives ~190mA.

Personally, I'd shoot for ~230mA (to have overhead) and with a hFE of 100, the minimum base current to make this happen is 2.3mA.Since you use the transistor as a switch, you want it to saturate hard, so a base current of 5mA would be better.This gets you to a resistor value of 860 Ohm and the next lower standard value is 820 Ohm (although it would work with 1kOhm, as this would give 4.3mA, which is still a reasonable current for saturating the transistor.

The 20mA that the controller is spec'd for is what it can handle (max.), but it's up to the user to make sure of that - Eg. connecting LED's directly between an I/O and ground only works on controllers that have current limited outputs - on all other controllers it's taking them far beyond the max limits and while it may work for a while... Even if they're cheap, it makes sense to make them last