Hot answers tagged

4

As you did not give details I assume the following: You supply the MEGA via USB or external 5-12V power supply the motors are supplied via an extra external 12V power supply with sufficiant amperage All cabeling is checked and correct Looks like this schematic (without 12V power supply attached to the motor shield) To your code: Get rid of the delay()s - ...


4

As already stated in the comments, the voltage of your power supply is the problem. The Arduino has a linear voltage regulator at the Vin pin. It dissipates the excess voltage as heat. The higher the supplied voltage, the lower the current, that you can draw before it overheats. The regulator on a genuine Arduino should go into thermal shutdown, while the ...


4

In short, I ended up creating a library capable to drive multiple DShot600 ESCs: DShot-Arduino It still need a lot more polish, but the bit-banging works really well. SPI method I tried the method @dannyf mentioned, which involved combining 3 SPI bytes to form 1 dShot bit and it actually works. But there's a few problem with SPI: It takes up the ...


3

An ESC is an Electronic Speed Controller. It's purpose is to control the speed and direction of a Brushless DC Motor. A Bushless DC Motor ("BLDM") is not like other motors. You can't just provide it power and it will spin. Instead it is made up of three (or multiples of three) electromagnets along with a permanent magnet on the rotor. Energising these ...


3

This is only a partial answer, about measuring pulse period or duration. For best accuracy, I would recommend using the “input capture” feature of a 16-bit timer. This is not as easy as using pulseIn() or timing the signal with micros(): you will have to carefully study the MCU's datasheet and manually configure the bits of some I/O registers. You will be ...


2

I just used a different motor-shield and it works now, thank you all for your replies and research in this!


2

When you set a servo motor to be in a specific position it is constantly and actively striving to keep in that position. The feedback from the internal potentiometer is constantly being processed and the motor adjusted to ensure that it remains at the right position. Potentiometers, of course, aren't 100% perfect, and there will always be a certain amount ...


2

For the benefit of anyone reading Jeremy Blum's Exploring Arduino book who is having the same issue- he has labelled the transistor wrong in the book so the collector and emitter are back to front. Turn the transistor around to face the other way and your issue will be resolved.


2

A servo motor doesn't just require a single pulse to send it to a specific angle. It requires a constant stream of pulses at the right frequency for it to track what the angle should be. By sending one pulse you're just hinting where it might like to go to, then stopping. It's never going to get there, unless you keep sending those pulses fast enough. Also ...


2

I think you may be confused as to what a "critical section" is. I see in your code where you are reading your button, but I don't see where you use it at all. To read your encoder with a critical section all you need is replace this: if( counter != temp ){ Serial.print("counter = "); Serial.print (counter); Serial.print(" ...


1

The sawtooth pattern you're showing looks like what I would expect from incomplete filtering of the PWM signal from the Arduino. I don't know if the variation is going to affect your motor controller or not. I suggest using a different low pass filter with a much lower pass frequency. That will slow down the response to changes in speed slightly, but ...


1

For this task you should use an extra power supply not running trough the Arduino. For this kind of setup I use PCA9865 16-channel servo dirver board cost around 5$, needs two pins only and can run all servos (strong 5V power supply provided => Amperage) simultaniously. For a max of 8 servos a 5V/2-2.5A power supply (wall wart) should be sufficient. See this ...


1

I never use TLE9879, but I could guess of why it doesn't work as expected. For ATMega328p-based Arduino boards (i.e. Uno, Nano and Pro Mini), it has pin 11, 12 and 13 as SPI’s MOSI, MISO and SCLK signals, but at the same time these signals are also available on those board’s In-Circuit Serial Programming (ICSP) header pin 4, 1 and 3, except for Pro Mini ...


1

NEVER drive a motor directly from an Arduino IO pin. You will kill the Arduino. It's not a question of voltage, it's a question of current, and that is where the transistor comes in. If you have a 3.3V Arduino (as it sounds like you have) then you may be able to drive the motor using the 3.3V output of the Arduino (VCC pin? Not sure with that model) and a ...


1

As far as I can tell from the picture you share that you don't have an external power supply connect to the shield to drive the "12 DC motors". Read https://learn.adafruit.com/adafruit-motor-shield/power-requirements for better understanding on how to power the motors.


1

Assuming that your motor is connected to pin 8, and you want to set that signal high, you have to define it: #define motor 8 void setup() { pinMode(8, OUTPUT); } void loop() { digitalWrite(motor, HIGH); // put your main code here, to run repeatedly: } Since you use it also in setup, also replace it there: #define motor 8 void setup() { ...


1

First you need to think about your axes configuration, then about the actual implementation. I for example can directly think of 2 options: You could arrange your axes perpendicular to each other, like a Cartesian coordinate system. Here you might need more parts to build it, than with other arrangements, though it is a sturdy system and the positions and ...


1

It's not possible with the servo alone, but you could add feedback. Some options: An encoder (may be expensive or not available for your servo) will tell you the position. You could also make your own encoder by connecting a potentiometer to the axis. The resistance of the pot will be related to the position of the servo. if you don't need to be exact ...


1

How can I implement this? Is it possible to read Servo's statement? No, it is not possible. When you do a servo.write() it just changes the PWM duty cycle. It's then up to the servo to use that to set its position. The Arduino has no concept at all of the current position of the servo. Btw, I don't want to put delay after write(), so other than that ...


1

Can you clear one thing that you are giving power to dc motor from 5v pin given on Arduino board or from your ac to dc power supply. If you are giving power to the motor from 5v pin of Arduino Uno then there is a high possibility that the motor is not getting sufficient current because 5v supply on Arduino comes from onboard lm1117 5v voltage regulator and ...


1

There are two possibilities: Easy way (but with limitations) I see a delay of 200 (ms)… So if you want to have it working for a minute, than use 60,000. If 60,000 is not accepted (maybe the input argument is a signed integer, having a max value of 32,767), than use a for loop and do a delay of a second for 60 times. This solution will make it not respond ...


1

Do you want i and x to increment at the same rate 0-255 then x to remain 255 while i increases to 500? this should do what you want. i and x increase together until x reaches 255 then it wont increment. int x=0; for (int i=0; i<500; i++) { digitalWrite(DIR,LOW); digitalWrite(PUL,HIGH); Serial.print("i = "); Serial.println(i); Serial.print("x ...


1

The TIP120 is a poor choice because of the approximate 10% - 14% voltage drop across it. Try the circuit with a logic level, low Rds MOSFET. For a more in-depth answer, please see this answer: https://electronics.stackexchange.com/a/388468/165322


1

Basically you can't. PWM value required to turn to a specific degree will depend on motors, on voltage, on hardware, in the current velocity of the car and probably on the surface under the wheel. Also keep in mind that real cars don't turn like that (at a fixed angle). Instead, driver constantly adjusts the position of the steering wheel, while looking at ...


1

Short answer: You have a blocking delay interrupting your button debounce time of 100ms. Your button library has a debounce time of 100ms. This means you must be holding the button down for more that 100ms before it will register as pressed. You have a 3 second blocking delay at the end of your loop. When you call delay(XX), your processor cannot do ...


1

Arduino really isn't the best processor for a drone. It can certainly be done however. You can buy a MultiWii flight controller which is based around an Arduino Mega and functions as a drone flight controller. You can't just ask which motors and ESCs to use. How heavy is your drone? How fast does it need to fly? Is there a payload? To figure out which ...


1

You have two possibilities of powering the shield according to the adafruit documentation. A: power the Arduino over the power plug (not the USB plug) of the Arduino and set the VIN jumper. B: Leave the VIN jumper off and power over the power connector of the shield. Don't try other possibilities. They may kill the shield or the Arduino. The reason ...


1

Here is a program that should fade the LED as you specified. Initially the LED is off. If you press the button the LED starts fading within the time frame to its maximum. Then it switches to zero waits a couple of seconds and starts fading from new. If you press the button a second time the LED stops fading and is set to darkness. ;-) This happens emediately,...


1

Another answer chrism didn't mention is to use an "absolute position rotary encoder". It's a device that outputs a bit pattern using "gray code" or "grays binary" that tells you the position of the shaft. The more bits in the encoder, the more precisely you can measure the position. The "gray code" bit pattern enables you to read the changing position ...


1

There are multiple ways to to this. The easiest and most commonly used way is to use a limit switch as home position sensor. At startup the device will first drive the motor in the direction of the limit switch, until the switch get's activated. Now the the absolute position on this axis is known and you can go on from there. (CNC machines and 3D printers ...


Only top voted, non community-wiki answers of a minimum length are eligible