Hot answers tagged

18

Specifics Looking at the PID Basic Example I think that you just need to instantiate two copies of PID controller, one for each wheel, encoder and pwm: PID leftPID(&InputLeft, &OutputLeft, &SetpointLeft,2,5,1, DIRECT); PID rightPID(&InputRight, &OutputRight, &SetpointRight,2,5,1, DIRECT); Then, in your loop() equivalent, you just ...


14

You are going about this incorrectly. The reason why pololu is telling you to connect the two pins is because the sleep pin has a pullup resistor on their breakout board. Connecting reset to the sleep pin is equivalent to connecting the reset pin to high. You can achieve your goal by connecting reset pin to high (5V through pullup resistor) and connect ...


11

There's more than one way to do it (TMTOWTDI). There are a several ways to connect 8 analog inputs to an Arduino. Add an analog multiplexer, as georgebrindeiro suggested. Such as: (a), (b), (c), (d), etc. Replace the Arduino with one that has enough analog inputs already built-in. Such as the Arduino Mini with 8 analog inputs, the Arduino Due with 12 ...


10

The short answer is "yes". I'm assuming you are describing an architecture that looks broadly ;-) like this: Real-time system <--> Soft-time system This is a very common robot architecture. The real-time system (RTS) (for example, an Arduino with appropriate firmware) handles the low-level sensor farming (conditioning, data packaging, management, and ...


10

How Servos Work Based on these details of your question: I just got a kit [...] continuous servos [...] plugged it into the microcontroller Combined with your "Arduino" tag, I'm betting that you are working with hobby (RC) servos modified for continuous rotation. Standard servos work by receiving a pulsed signal with a 20ms period (50Hz). Regular ...


9

The Arduino is really an AVR Atmega328p. The Arduino is a fine off-the-shelf implementation of this microcontroller, but if you make many of them, you can buy the chip for less than $3 each in bulk, and it requires very little circuitry to run on its own -- a crystal and a couple of capacitors to run at 20 Mhz, or not even that if you can run at the built-in ...


9

There are a number of things to consider for your project. Since you are asking for the learning algorithms, I asume your hardware is or will be up and running. When getting your robot to learn, you should differentiate between on-line and off-line learning. Further, there is on-system and off-sytem learning, which can be combined with the previous category. ...


9

If I understood your question correctly, you have a problem understanding binary numbers, right? Think of a decimal digit. A digit is only either of 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9, right? But a 7-digit number can be between 0000000 and 9999999. I presume you do understand this. Now a decimal number, for example 2569 is actually a short form of writing like ...


8

The 40mA current limit is the Absolute Maximum that an I/O pin on the ATmega328P can supply. Vcc on the ATmega can draw up to 200mA. From page 313 of the datasheet: The 5V that connects to Vcc and powers your chip comes from one of two places. Either the USB connection, which in most cases is limited to supplying 500mA. Or an external power supply (wall ...


8

When using a PID loop to steer using line following, then your set point will always be the same. You will always want the line to be in the same position with respect to the robot, for instance in the centre of your sensor. So if your line sensor outputs a value from -1 to 1 with 0 being the centre of the sensor, then you will want your set point to be ...


8

Raspberry Pi has only one hardware PWM channel and Linux distribution it runs is not a real time system, so software PWM may be very unstable. You are not guaranteed, that your program will be executed at exact frequency you want, so you will have trouble getting precise timing required to drive servos. If you already have Arduino Mega and SSC-32, I would ...


7

There is not a specific set of learning algorithms that you will need to implement. Genetic algorithms (GA), neural networks (GA), and reinforcement learning (RL) have all successfully been applied to the problem of gait generation. I can also conceive of ways to use unsupervised learning methods to approach this problem but I can't say for certain whether ...


7

I'd recommend getting your hands on a 3pi and an Arduino. They both use the same chip, and are a great place to start. Get yourself some tools. A soldering iron with a sharp point. A multimeter. Some breadboards and some wire. Actually, just look here: Ladyada's Equipment List


7

If you are running on a fixed track, by far the easiest method is to use a pair of endstops. Typically these would be mechanical, magnetic or optical. Mechanical A mechanical endstop could be as simple as a physical barrier at the end of your track, much like a train track buffer stop. Your vehicle would bump up to buffer, detect that it wasn't moving and ...


7

You'll have to determine yourself whether a motor controller shield is compatible and can be stacked on your existing shield. In some cases, you can use Arduino's SPI. In other cases, you'll need to check whether the pins that your shield uses would conflict with the pins needed by a motor controller.


7

Even very small errors can bother the balancing. Small errors such as: Weight of the quadcopter is unbalanced. One motor is rotating faster/slower than others due to manufacturing or your power-source. Air resistance and wind. Unbalanced propellers due to manufacturing. Strong magnetic forces. You simple can not send the same motor speed to all motors ...


6

It depends - on the number of landmarks in the feature map, and how much time you're willing to invest tuning the algorithm for speed, and a number other parameters which you may or may not be able to control for a given application. Edit: As a thought experiment, I think it would theoretically be powerful enough to do extremely simple near-real-time SLAM ...


6

The Arduino has always been horifically underpowered. You can get a stack of stm discovery or other ARM based dev board for the price of a single arduino, and each one of those boards will be orders of magnitude more powerful than the arduino. The ubiquity of the arduino has also hampered many projects that should have known better. Quadrotor ...


6

Can I get away with all the ground being common? That's exactly what should be done. Do I need two sets of capacitors? Yes, you usually want to keep all capacitors as they are even if you are cascading voltage regulators. They help keep the regulator stable and avoid sharp voltage variations. Be aware that either regulator might limit the amount of ...


6

An optical encoder is fairly simple to add to an existing wheel. Essentially you mount a photosensor that can detect notches or patches on a disk as it rotates with the wheel. You could use through hole light detection as well. The circuit design is fairly straight foward And your arduino program counts the number of pulses it receives. Knowing the number ...


6

Your hardware configuration sounds wrong... your trying to provide all the drive current from the arduino Given your description, your using a bipolar (NPN or PNP) transistor, I'd wire up as: Base: To arduino Collector: Motor -ve (motor +ve to Vcc) Emmitter: Ground Alternatively: Base: To arduino Collector: Vcc Emmitter: Motor +ve (motor -ve to Ground) ...


6

Milk is readily available in plastic bags inside cardboard boxes, as illustrated in the picture below of part of a cafeteria-style milk dispenser. Flow of milk is controlled by pinching off the white plastic tube that comes out of the bottom front edge of the box. To resupply the machine, you get a new box of milk from a larger refrigerator, rip open a tab ...


6

The short answer is yes, but the long answer is that you're approaching the code the wrong way and will need to rewrite things a bit. It looks like you're attempting to read a button and have it flash some LEDs while at the same time having your stepper move back and forth. The problem is your delay(5); commands, which pause the execution of your code. ...


6

It looks like your proportional gain is too high. You seem to be constantly increasing RPM on one motor while locking in the other one to make the system rotate. This isn't a good control strategy as eventually those are going to both saturate and you will lose control. Also as time increases your ability to command the system decreases. So you need a ...


6

Stereo vision and SLAM are pretty heavy algorithms, both in terms of the processing power and RAM required. You can forget about running this on a little microcontroller like an Arduino. These run at tens of MHz, and have only a few KB RAM. At the very least you'll need something running at hundreds of MHz with hundreds of MBs of RAM. You didn't say exactly ...


6

The first thing to realise is that this is not a control problem, this is a planning problem. If you conflate the two, you are making life much more complex than it needs to be. Solution - Motion planning The traditional way to achieve what you want is to have two loops. The outer planning/supervisory loop generates way-points for specific points in time, ...


6

Assuming a constant update of 5Hz, your sample time is (1/5) = 0.2s. Get one position of the target, p1. Get a second position of the target, p2. Target speed is the difference in position divided by difference in time: $$ v = (p_2 - p_1)/dT \\ v = (p_2 - p_1)/0.2 $$ Now predict where they will be in the future, where future is $x$ seconds from now: $$...


5

Here's a paper that seems relevant: Policy Gradient Reinforcement Learning for Fast Quadrupedal Locomotion. Abstract: This paper presents a machine learning approach to optimizing a quadrupedal trot gait for forward speed. Given a parameterized walk designed for a specific robot, we propose using a form of policy gradient reinforcement learning to ...


5

Typically, tracking the position and orientation of a vehicle is not accomplished by looking at the wheels — it's done with navigation sensors. If you were attempting to have closed-loop control (i.e. servo control) of your motors then wheel-mounted position sensors might be appropriate. But if the goal is to support "autonomous driving", then I don'...


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