Hot answers tagged

3

Having only the proportional term of the PID regulator will most definitely leave you with oscillations. If you think about it, it's quite similar to a linear harmonic oscillator F=k*x (formula for spring motion). Adding a derivative term should damp out those oscillations. If after waiting for the system to stabilize you see it stabilized with some offset ...


3

While I do not know how to fix the root cause of the problem, a work around is to use closed-loop feedback. If you can measure the speed of each wheel (for example, with encoders), you can use a PID-like algorithm to adjust the speeds of your wheels so the robot goes straight. A compass or gyroscope would also be suitable for this task.


2

It is not possible to use the micro-controller directly as an H-Bridge. A micro-controller is a micro-controller and an H-bridge is an H-bridge. You need both of them to control a motor (or something equivalent). I will suppose that you are using motors and not servo. Let's say you want to use your micro-controller as an H-bridge. You have two cables from ...


2

The SAM chips have ARM cores, so you should look compiliing with arm-none-eabi-gcc and flashing/debugging with openocd instead. OpenOCD is a program that communicates with debugging probes for a number of processor/microcontroller architectures, analogous to avrdude for AVR. You will have to figure out how to configure openocd to talk to your board. A quick ...


2

Choosing a different controller is really unnecessary. Its absolutely common to implement long delays with 16 bit timers. The only thing you need to to is using a simple additional counter variable (software pre-scaler). Timer/Counter2 allows Clocking from external 32kHz low frequency crystal (watch crystal). So a good option would be, to use such a ...


1

Firstly, the Arduino IDE already uses the AVR GCC compiler. Put another way, all of your Arduino (.ino) code gets transformed into a C++ (ie .cpp) file and then gets compiled with AVR GCC. The easiest way to move to Atmel/Visual Studio is to use Visual Micro. It is a great product, the documentation is good and the transition is almost seamless. To migrate ...


1

I never worked with Arduino, but there is a lot going on behind the scenes in the Arduino Serial class. The examples below should get you started, its not supposed to be compilable or functional as a whole. The example is for UART0. Serial.begin() performs the low level initialization. If you do this manually it will look something like this: void ...


1

Ok I actually was able to make it work. First of all in the beginning of the testing I used my own program which generated PWM signals. I wanted to make them 50Hz with 1.5ms of duty cycle being neutral position (of stick of the controller for example), 2ms max and 1ms min. Unfortunately when I connected my microcontroller to the CC3D I wasn't able to get ...


1

I don't think you'll be able to use PID control successfully because you don't have a continuous feedback signal. Your feedback is binary on each of three sensors. From your description, you need to monitor or eliminate the gap between the sensors. Monitor meaning add more sensors in the gap, and eliminate meaning move the existing sensors close enough ...


1

Your PID calculation is all wrong. You have: //calculate power_difference of motors power_difference = error/(Kp/100) + derivative*(Kd/100); First, you need correct error terms. You calculate: //make calculations error = position - 2500; derivative = error - lastError; I'm assuming here that 2500 is the signal you are expecting if you are exactly ...


1

After reading AVR and CrossPack docs, I've found really easy to do this. For AVR development environment setup, do the following thing: Install xCode on your Mac, choose latest version. Now install CrossPack. This will do all the environment setup. CrossPack installs required libs to support USBasp as well. To create project using xCode: Create new ...


1

Yes, torque control of a motor with an AVR microcontroller is possible. In fact, torque control of a joint is common practice in robotics. This is a good example of a feedback loop. There are many ways to measure the torque of a motor. An expensive way is to use an off-the-shelf strain gauge based force/torque sensor on the output. A cheaper way is to ...


1

So, the calibration code was essentially correct. The problem was in my Makefile dependency code. For previous tests i used a range from 0.5 to 2.5ms and that was clearly too much for this ESC. I tried to decrease the range to 0.8ms - 2.2ms, but my makefile didn't notice the change and kept uploading the old version ... After a clean rebuild the ESC is ...


1

I'm not really familiar with Atmel microcontrollers, but I'm assuming you're using some Arduino variant. Here's a pretty thorough tutorial about using an Arduino with a SN754410 h-bridge (found it via the SN754410 Sparkfun entry). It seems the only thing the tutorial lacks is controlling the motors via PWM, which of course means you will only be able to ...


1

You are setting the UBRR register incorrectly: it should not directly hold the desired baudrate, but a value that depends on your CPU speed (which you defined as the macro FOSC, but never used) and the baudrate. The exact calculation is described in the ATMega8535 datasheet (p.147). See the AVR UBRR Calculator for easy calculation of the proper UBRR ...


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