8

The processor has to execute something. You will always have an "endless" loop even if you're doing some work in an interrupt handler. The best solution depends on exactly what you're trying to do. The main advantage of using interrupts is they allow you to service events in real-time while your main program is doing something else. Timer interrupts ...


8

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, ...


7

Yes this is entirely possible, and as FuaZe said, it's called a bootloader. You essentially have two programs on your chip, each with their own memory area; the bootloader and the application. Preferably, the bootloader area is write-protected to make sure you don't accidentally destroy it. With the bootloader, you can use any algorithm you want. If you ...


6

Yes. If you only run it in feed-forward mode and do your training off-line somewhere else: I programmed a 3-layer (5-5-2) feedforward ANN on an Arduino UNO. It ran on a mobile robot. Whenever the robot would hit something, it would re-train the network. The feedforward portion of the net ran in real-time; while the back-propagation training took on the ...


6

In general you don't need to learn assembly to be able to program a microcontroller. As long as you know C, it's enough for you. Knowledge of assembly of course would help. Specifically, it would help in writing optimized code (or rather, not writing stupid code) as well as having a good estimate of how fast or slow a piece of code could be. Sometimes in ...


5

This is one of those "open-ended" questions that the moderator doesn't like. So I'm going to leave you with some short, general answers. These are based on over 20 years in industry designing various bits of hardware and software for embedded systems: Learning enough about microprocessors so that assembly language programming comes naturally will be a big ...


5

There is at least two modalities along which servos (continuous or otherwise) usually fail: gear problems and motor breakdown. When the gear fails (broken tooth, hard point, etc.), the servo may get stuck, free moving or any combination. When the motor breaks (usually the brushes inside the DC motor are the culprit), the servo stops working altogether (as ...


5

The signals to the ESC's using PWM should be sent after the PID algo is done processing the errors. The output calculated from the PID is the PWM value to be sent to the ESC's to actuate the motors in such a way that they move to reduce the error thus obtaining the desired orientation So the right order is: Read RX signal Calculate desired pitch, roll, ...


5

There are 2 main reasons why the MER is still operating long after it's 90 Sol planned lifetime. The first is political, strategic, and can be summarized as 'Under promise, over deliver'. When a PI (principal investigator) proposes a high-risk scientific mission like this, they always frame the goals of the project such that their project is viewed ...


4

I would just like to add few points to other posts. My personal opinion is that endless while loop has no sense in systems which read from snsors or write to actuators as both has some physical constrains, eg. There is no point in reading from sensors at 1Mhz if the sensor has stability cycle before meassurent is accurate at 100Hz. Same goes to motor drivers....


4

Further to Guy's answer, using a timer interrupt to generate accurate intervals adds determinacy. For example, at any given time, you know exactly what the processor is doing, and all activities are performed at specified rates. You also should schedule at determined rates as otherwise you have no basis for time constants and such like, which will be ...


4

The simplest sensor you can build is a weight on a string. Lower it down until the tension of the string is reduced. I assume you want sonar. So just go buy one they are dead easy to interface to. You can buy these at marine hardware stores. They are not cheap. Look for a depth finder that has "NMEA" output. You may have heard of NMEA as the data format ...


4

Controlling a flying robot (or anything else) is a very complex subject (well, people are doing PhD on it..). I can recommend this free online course on the subject (I have taken it myself). It will give you a little taste of what it is.


4

As a professional robotics engineer (with an Electrical and Computer Eng bachelors, although I focused more on the CE side), this depends entirely on what aspect of a robotic system you'd like to work on. Robots are interdisciplinary systems by definition, and you will always need a team with a broad skill-set to build one. That being said, there are places ...


4

The first thing is to make sure that the cameras will get the coordinates of the object at the same time (I don't know if Pixy has a FREX or STROBE signal for synchronization), or that the object is not moving. Then, have a look at OpenCV, it has a section on 3D calibration and reconstruction (i.e. find the depth of an object based on the coordinates of two ...


4

As extension to this answer, I'd like to share with the community a Simulink model implementing the system described above. It does not represent a solution for the code reported by CroCo but it may give a better insight and, as such, it might be helpful. The system is depicted below: In red we have the blocks running at $1\,\text{KHz}$, which deal with ...


4

Not all fixed wing aircraft are inherently instable. That feature greatly depends on the center pressure and gravity center designed position. Passenger aircrafts are quite stable, and fight planes are just the opposite in order to achieve fast maneouvres, among other reasons. Read this aviation thread where this question was replied.


4

One of the most common controllers is a computed-torque controller, also known as the inverse dynamics. The preceding controller is based on the feedback linearization principle which is an approach that maps a nonlinear model into a linear one and treats it as such as we will show momentarily. Consequently, one can utilize linear controllers such as PD and ...


3

The major disadvantage of assembly language is that it is different for each processor that you use. Therefore there is a big learning curve whenever you change processor. Clearly, if you only ever plan on using a single processor (or family of processors) then this is less of an issue; however, life is rarely that simple. Equally, assembler allows you to ...


3

I'd also like to stress that the comparison between polling (i.e. checking if a interrupt flag has been set) and interrupt vectors (i.e. an ISR, or function that's loaded when a interrupt has occurred) should be more than just evaluating the efficiency/simplicity of executing a block of reactionary code. The interrupt controllers of most modern micros are ...


3

It certainly sounds like the joystick is broken, but in Robotics, nothing is certain. Some things to try: Swap over the X and Y wires going to the Arduino. Which axis exhibits the problem now? Disconnect the joystick from the Arduino, and power it up on its own. Using a multimeter, measure the voltage on the X axis wire as you move the joystick. Does this ...


3

You can control brushless motors 2 ways control with a hall effect sensor http://scholar.lib.vt.edu/theses/available/etd-09152003-171904/unrestricted/T.pdf sensorless(back emf) control http://www.pmdcorp.com/downloads/app_notes/BrushlessSensorConfig.pdf or you can buy an esc (elcetronic speed control) My advice If you are not knowledgeable about electronic ...


3

Yes indeed, it's possible to embed neural network in microcontrollers. There are many such examples of this in the scientific literature but I can cite a striking example of what can be done with a very simple MCU if you're smart enough. In Evolutionary Bits'n'Spikes, the authors describe the implementation of a real time spiking neural network AND a genetic ...


3

I would create a small sketch that allows you to communicate over serial port that will let you create a GUID on the desktop computer and write it to the EEPROM of your uno to a known location. Then later on in your networked arduino code you can use that saved value. I've done this before and it's pretty simple to implement. You can even copy / paste ...


3

The answer to this question depends entirely on the type of connection you are using to build your network. Assuming that when you say you have arduinos "on a network" you are using ethernet shields or similar to put them on an ethernet network, one way to accomplish your goal would be to take advantage of the MAC address on the ethernet shield as this is a ...


3

"All I need to do".... Famous last words. This is a very complicated project to attempt for multiple reasons. I'll try to break down these challenges. For documentation, the datasheet has all the information that you need, but there is probably not any code available that is ready to use. Sparkfun has recently introduced a 'degree of difficulty' rating for ...


3

Complex systems of differential equations governing a physical phenomenon under study are solved by means of a computer always in a discrete way, meaning that the differential equations are integrated step-wise with the integration steps decided according to some smart set of rules. This does happen therefore also within Simulink and even when you select ...


3

You've asked more than one question, so I'll try to answer them in order. The Robotics community has not yet hit the limits of current hardware, so very little work is being done on the exotic cutting edge like neuromorphic hardware. The exception to this is software neural nets, which have come in and out of fashion for decades, and the Nv artificial ...


3

I have done this myself, controlling the exact position of a brushless DC motor as its velocity ramps up and down. And I did it using a position controller only. Sounds obvious, but it worked extremely well. The integral term of the controller is key to this. Since you want the position error to be as close to zero as possible the whole time, but you need a ...


3

Ideally, when you raise the collective all the way up, all the ESCs put out their max power and the quadcopter goes straight up. Different ESCs will end up producing different maximum thrusts; and also will ramp up (and down) differently with sudden changes in control signal. As you probably already know, if one rotor of a multirotor vehicle has more (or ...


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