Arduino stuff

Recently got my Omega2 arduino kit. It's alright. Everything seems a bit on the cheaper end (like only getting 20 fucking m-m jumpers and piss all resisters docs.onion.io/omega2-arduino-dock-starter-kit/index.html#whats-included). Did all the tutorials they offered ( docs.onion.io/omega2-arduino-dock-starter-kit/experiments.html ). I've got 2 DC motors but both either don't turn on at all, turn on and work fine when connected directly to the power, restart the entire device, or don't work when powered through, say, a button or something (It's completely random what they do). I don't have the PWM expansion ( onion.io/store/servo-pwm-expansion/ ). My aim is to learn how to create my own RC cars and from there move on to more technical stuff like manual transmission and so on. I'm also looking for a program that can feed constant inputs to a remote server while at the same time having configurable GUI. If this isn't possible, any tips on how to get about writing something like this would be great. I understand this is a very long stretch for the time being.

Anyone got any tips on what to read up on to help me out? Tips on what I'm doing wrong? Help without the condescension would be very much appreciated.

Other urls found in this thread:

adafruit.com/product/154
learn.sparkfun.com/tutorials/transistors/applications-i-switches
twitter.com/SFWRedditVideos

You could use the matlab interface creating a GUI and running in real time (maybe over xbee if you want to don't wireless) over Simulink. I'm controlling a golf cart for my uni thesis running everything in matlab and using the arduino as an interface. Also (this running in win10) i create a GUI using an raspi 2b (running win10 core) connected to a screen to get info over the cart.
Maybe there is another way but that it's whats been working for me.

>>> doing it wireless*

>dc motors being erratic
What are you connecting to power them? I'm ok with motors.

>pwm
You can do this with any pin really to check it works, although without the pwm expansion you'll be eating cpu time. Not much of an issue since the cpu is fairly capable.

Can't really help with the other part although like this user says matlab can do it. I never used it for a gui so idk.

Exactly, the pwm part it's cpu heavy, that is why you vuld use your own cpu (through matlab) for the process and only use the arduino as an interface

The omega2 does have a cellular expansion available (albeit expensive) and was considering that in the future. It has built-in wifi and only needs a power source via microusb. I see that xbee is its own cellular system. Simulink seems very interesting, will definitely look into it (saving the thread for later (it's 5 am and haven't slept)) and not quite understanding the use of Matlab.

Got an old DC motor hooked to the 5v and ground ports of the arduino (not directly but if there's basically any resistance between them, they don't work). If the PWM is that important, to the point where the CPU will have enough of a workload added onto it for 2 people to make a point of it, I'll consider investing in it. Right now, I'm looking for alternatives for the sake of education. I'm not an engineer and have studied nothing about power and electricity so I wouldn't have the slightest clue on anything.

>I've got 2 DC motors but both either don't turn on at all, turn on and work fine when connected directly to the power, restart the entire device, or don't work when powered through, say, a button or something (It's completely random what they do).
I've never used a DC motor, but (full rotation) servos are supposedly much easier to work with.

The kit came with a standard sized and sub micro servo. Both have a 180 degree rotation though sadly. What about full rotation servos is so much easier to work with? I wouldn't imagine them being as fast or efficient if they work anything like the ones I have (don't expect them to be anywhere near as slow but I wouldn't expect them to match a DC motor). The DC motors are to be used as the engine of the RC and I plan to put the sub-micro to use as the steering column.

With servos, you just have to send them pulses to make them spin forwards or backwards. That way you can control the wheels individually, and don't even need a separate servo for steering.

Wouldn't that result in a pretty slow RC? Googled "full rotation servo" and got adafruit.com/product/154 . No idea if this is what you're referring to but a rotation speed of .18s/60 degrees (1.08s/revolution) isn't really what I'm looking for.

The dc motor will require the 5V (if it's a 5V motor) to run. DC motor speed is proportional to voltage. If you want to vary the speed, the pwm will do the job of controlling the voltage and hence the speed.
Current is proportional to torque, so the more you load the motor the more current it will draw.

You can connect the motor directly to a 5V supply and use pwm to switch a transistor which connects the motor to ground. This way the motor is free to draw as much current as it needs, something which a pwm pin will struggle to do.

As for the cpu, eh it can work but it definitely is intensive. There are ways to get around this but just for the sake of getting a motor to spin it will be fine. Any more and you should worry about it.

My current end goal is having 2 motors and a servo being controlled at the same time. I don't want extreme precision but I do want it to have several speeds dependent on the position of a slider or otherwise.. I'll definitely be investing in the PWM expansion when I can afford it.

I did read up on torque and power earlier and was wondering what the difference between using a pulley and a gear is. I understand a pulley allows the shaft to rotate the same direction as the motor but wouldn't just telling the motor to run backwards while connected to the shaft with a gear work just as well?

Could you please clarify a bit more on the transistor system? Found out the kit didn't come with a transistor. From my understanding, it has an input (or 2 if you use the output of the input of 1 as the input while the first input becomes output) and then a ground pin. Is there a set amount a transistor amplifies power? How do I know which to use and for what reason?

Also I can supply photos of both DC motors if it helps any. I have no information on either of them.

>2 motors and servo
Yeah that's going to need that pwm expansion really. Save the arduino itself for control and just tell the expansion when to change to a different pwm so it offloads the actual pwm.

>pulley/gear
Just fit/attach the motor in 'reverse' and don't worry about a pulley.

>transistor
Ok to be simple a transistor is a switch. It has three pins, the source, drain and gate. The most common are npn transistors where the source is connected to ground, the drain to the input and the gate is for control.
Sending HIGH to the gate will turn the transistor on, so it completes the circuit. Sending a LOW to the gate will turn it off and makes like an open switch, stopping current flow.

>transistor system
Its a 1 quadrant chopper drive if you want to find info specifically for how you want to set up your motors. Pic related.
Alternatively you can do like in this link learn.sparkfun.com/tutorials/transistors/applications-i-switches
Same thing really, the switch can go before or after the motor. Link is preddy gud for basics.
>transistor amplification
Nah that's different, they are BJT transistors.

Use something like the 2N2222 as a switch. Or search for switch transistors.

Found a 10-pack of 2n2222 for like $3 on eBay. So these things are software-controlled switches, then? That's pretty awesome. Was wondering how I can control the direction the motor spins. Couldn't figure out a way but I'd assume this would work well with it. Have one on either side and bridge the one you want on to be negative, right? Would there be a simpler way of doing this? The PWM expansion has 16 sets of pins so it wouldn't be wasting space I guess? If that's not it, I'm well out of ideas. I don't really know what are and aren't parts with electronics since I'm fairly new and my current items are very limited,

Trying to draw up a schematic of what I'm imagining but can't seem to get it to work out how I'm imagining it. Guess I'm wrong after all

There we are. Was going about it the completely wrong way. 1 = on, 0 = off. Am I wrong in thinking this or is this correct?

Pic related would give the same results. I feel like this'd be the best option but any advice is always welcome.

Use diodes in those places, no need to thank me.

Would the diodes just be there to conserve/make the most out of the input? I'm not sure what the purpose is in the picture.

Also the servos I have both have capacitors welded on. One has the capacitor touching both terminals and the other has the capacitor only on the input. Any idea what the reason is?

Sorry for being a time waster. Just feel like now would be the best time to get answers for specific questions

The diodes are there to sabe the transistors from dying.
You power up a motor. It has coils that store current while moving. When you stop providing power to the motor, the built up current much be discharged, usually through the transistors, fucking them up. With the diodes, all that current flows through them to GND.

Wouldn't the diagram be directing the current to the bottom 2 transistors and into the bottom 2 terminals? Should I have a ground somewhere around there for them to go to or are they facing the wrong way or something?

Feel free to leave the thread if it's starting to get annoying. I greatly appreciate the help you've provided

Scratch that bottom terminals part.

The discharging current has reverse polarity, so the diodes are correctly placed to direct the current to GND.

Also, do not connect the power transistors directly to the control unit (are you using an arduino?). They have shit output current.
Use another set of two transistors for "w" and "x" to act as toggles, with the arduino attacking the transistors' gates.

Oh gotcha. Wasn't aware that's how they worked. Any more general tips I wouldn't be aware of?

Im using an Arduino dock for an omega2 and eventually the pwm expansion. Basically everything goes through a mini pc and atmega328p

The comment you linked and my last one were the last useful tidbits in this H-bridge crash course, I think.

You can also make double H-bridges with transistors connected in a darlington arrangement and deliver more power (by a factor of a hundred or a thousand so, if you want). Go nuts.

then use the transistors I mentioned. This way you can also power any motor you want, if the power transistors can handle it. I once used a double H-bridge with a simple arduino to power a massive motor. The power transistors were also huge and needed computer sized heatsinks kek.
Just be careful not to fuck the power transistors, they can get expensive.

Do you know how to calculate the nedded current to deliver to the transistors gate and all that stuff, or are you just trying stuff to see what's good and bad? I'd recommend you read a bit about transistors and the math behind it. It make things much simpler.

>Double h bridge
How would that work? Are they separate or inside each other?

Are Darlington transistors generally what people use to amplify power?

>How would that work? Are they separate or inside each other?
Like pic related, with the first transistor attacking the second transistor's gate, with both emitters and collector connected to each other.

>Are Darlington transistors generally what people use to amplify power?
For some uses, yes. Especially to amplify current. For amplifying voltage you have opamps, mostly (which can be made with a bunch of transistors too). Some darlingtons come in the same package, others you can make by using two separate transistors.

Last question before I head to bed, would using the Darlingtons and diodes with the second drawing I put up (with a pwm terminal connected to 2 transistors) work? The diagrams I've seen online all use separate terminals for the 4 transistors. Any reason why other than flexibility?

Also I take it 'double H bridge' refers to the use of 2 transistors at each point?

Oh and in terms of learning the maths, are there any good sources you'd recommend? If not just for transistors, maths for different parts would be awesome. Should I just stick with soarkfun?

The four connections are for flexibility.
Also, one last tip regarding h-bridges and motors: one output for clockwise movement, the other for counterclockwise, both for active brake (if you activate both outputs, , the motor basically doesn't know which way to turn, so it immediately stops). Careful though, time the duration of having both outputs active, because the current buildup will be very big.

Yes, double H bridge is using two transistors at each point, using the configuration I posted.

Sorry, but I can't help you there, my sources are all in my language wich will be like chinese to you. Just search google for information. Sparkfun is crap.

Alright well thanks a lot for the help, dude. Couldn't have asked for better help. Also thanks for your time and patience. I hope the rest of your week goes great. Have a good one, user. :)

I'm in the middle of writing my thesis (not related to electronics) and talking about stuff like this for a while is good to vent frustration. Thanks!