Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Re: adding a new chip to uno board on: April 16, 2014, 08:31:12 pm
United States
Ohio

Why?
2  Using Arduino / Microcontrollers / Re: adding a new chip to uno board on: April 16, 2014, 08:00:27 pm
i've got the boards.txt and the avrdude.conf edited. what i found is i can burn a booloader to both boards with no errors but i can't compile for the 328 w/no P.

i did a thorough reading of the data sheets and the only difference between the 328P and 328 is power consumption. the P is a pico power part.

how can i add the 328 part to the compiler so it compiles like the 328P?
3  Using Arduino / Microcontrollers / Re: adding a new chip to uno board on: April 16, 2014, 08:24:24 am
as i mentioned earlier the boot loader is only a convenience for setting the configuration fuses for a fresh chip. after the boot loader is programmed the first time we program using ICSP the boot loader is erased.

when using ICSP to program avrdude does a signature check every time that's why i need additional entrys in the config and board files.

thanks for positing the changes i need to make. i will make them and try it out this evening. i will let you know how it works.

thanks a bunch
4  Using Arduino / Microcontrollers / Re: adding a new chip to uno board on: April 15, 2014, 08:42:59 pm
we use ICSP programmer to program our boards. (such as an avr pocket programmer or the usbtiny isp)loading the boot loader on a virgin chip is merely a convenience because it also sets the fuse setting in the  process.  

the chips are surface mount packages making them very difficult to replace after they are soldered on.

from what i have read the chips we have posses no less functionality than the native uno chips and i have already successfully run sketches on them. the inconvenient part is whenever i need to go back to an uno board i need to edit my avrdude.conf file to change the signature number.

if it is not possible to have one board with two chip options listed with avrdude then how would i go about creating a custom board entry with all the same tributes as an uno except the signature?
5  Using Arduino / Microcontrollers / adding a new chip to uno board on: April 15, 2014, 07:22:15 pm
i'll say it out right i have some stupid team members.

we are building a robot. in this robot there are 4 atmega 328p chips. all of our boards are custom made. to our dismay after we built up the boards and tried to program the boot loaders they would not program. after some investigation i found that the wrong chips were ordered. instead of 328p we got 328. i found that by changing the signature in the avrdude configuration file from 1E 95 0F to 1E 95 14 for the 328 chip it programs just.

the problem is there are at least 4 people doing development of software and we are using out old robot (which has the correct chips in it) for testing.

my question: is there a way to edit the configuration and board files to allow the IDE to program both chips seamlessly under the uno board moniker without constantly re editing the configuration file?
6  Using Arduino / Programming Questions / Re: logarithmic scaling on: December 14, 2013, 09:59:40 am
the motors we are using are ampflow A23-150. these motors are definitely powerful enough the problem is that the robot weighs 51 kilos. getting that kind of mass moving is tough.

you guys convinced me of the look up table idea. i checked and an int array[255] only takes up a quarter of the uno's memory.

what i did was use matlab to generate a matrix like what el_supremo suggested

Quote
One way to approximate the exponential curve would be to break it into several linear pieces. At the moment, at any point in the acceleration (and, presumably, deceleration) you are using the same linear constant to increase the speed. You could keep track of what stage of the acceleration you are at (as you do now) and map that into one of, say, five constants such as 1, 3, 7, 3 and 1, or whatever is appropriate. If it doesn't take long to get up to full speed I doubt that you'll notice the difference between that and a true exponential.

but i took it to the next level. i generated a time delay value for every motor speed and then i used the current motor speed as an index to look up the dely time.

the pseudo code looks kind of like
if ((currentTime - storedTime) > lookUPtable[currentSpeed + 127]) // the plus 127 shifts the index to align speed with delay
{storedTime = currentTime;
increment motor speed + or - one}



here is a graphical representation of that data set. close to zero speed the delay between steps is long ( 77 milliseconds)
out at the fringes of either reverse or forward the delay between steps is short ( 2 milliseconds).
i also scaled the total delay from stop to full speed such that it was no longer than the linear implementation which was 10 milliseconds. with 127 steps it ends up 1.27 seconds .

if anyone is interested i can share the matlab code
7  Using Arduino / Programming Questions / logarithmic scaling on: December 12, 2013, 08:12:36 am
my team and i built a robot. it is driven via WiFi tank style. we pass it a byte of data for motor speed. stop is zero. full forward is 127 and full reverse is -127. the robot is quite large and the motors can't just be commanded to the desired speed. we use a function that compares the current speed with the commanded speed and then increments and decrements the current speed accordingly. the incrementation is done with a timer. if current time minus the previous time is greater than a preset constant the speed is incremented by one step. this ramp function is linear.

i want to command the motors in a more logarithmic fashion. the closer the current speed is to zero (stopped) the longer the wait time is between steps and the closer it is to full speed the shorter the time between steps is.

for the life of me i can't think of a simple way to do this. one way that i've thought of is to use exponential decay. divide the delay time by a constant to the current speed power. the problem is i don't want to burden the processor with lengthy floating point calculations.

another way is to use an array with all of the delay times precalculated. the problem would be that the array is very large. 255 integers would eat the 328's memory alive.

are there any tricks that can be used to ramp the motor speeds in a logarithmic fashion?
8  Using Arduino / Programming Questions / Re: variable scope arduino vs c++ on: April 30, 2013, 09:41:32 pm
i guess what i'm asking, is there a way to keep variables local to void loop without them being screwed up by a redecoration when void loop repeats?

or is the only good way to work with void loop is using global variables.

(from what i have read about c++; int main is where one would declare local variables and int main does not repeat unless the programmer makes it repeat with some sort of a loop where as long as the variable declarations are kept outside that loop there is no problem and the variables stay local to int main)
9  Using Arduino / Programming Questions / variable scope arduino vs c++ on: April 30, 2013, 09:29:07 pm
i have a few questions on variable scope and the differences between arduino and c++.
first any variable declared outside of all functions is a global variable. i totally get that.

a variable declared inside a function is a local variable that can only be accessed by that function. this is where it gets fussy.

for example

 
Code:
void loop()
{ int bob; // this declares an integer bob
int steve = 5; // this declares the integer steve and sets it to five}

if i were to run this code the declaration of bob as void loop repeats would not affect the value of bob after a value is stored.
but would steve be redeclared with the value 5 every time void loop repeats?

if it does always reset to 5 how can variables get an initial value inside a local scope without declaring them globally?
10  Using Arduino / Sensors / IR sensor as a cheap lidar on: April 25, 2013, 09:50:08 pm
has anyone tried to use a sharp IR sensor as a cheap form of lidar?
i was thinking that if this sensor is mounted on a servo a FOR loop could advance the servo one degree at a time and take a reading from the IR sensor populating an array with the readings.

does this sound like i would work or are there pitfalls that i'm not seeing?
11  Using Arduino / Programming Questions / Re: bootloader delay on: April 15, 2013, 06:56:24 am
as accurate as possible.
i'm competing in a sumo bot competition and there is a five second delay before starting.
if i start too early i'm disqualified.
if i start a second late the other bot has a jump on me.
12  Using Arduino / Programming Questions / Re: bootloader delay on: April 14, 2013, 07:52:36 pm
how can i find out what bootloader i am using and where do i find the delay for that boot loader.

i'm using an arduino uno rev3 with ATmega328
the boot loader was installed by arduino software version 1.0.4

(i have a programmer and i have removed and replaced the bootloader many times. but in my current project the arduino board is buried beneath a shield so i can't access the programming connector without major disassembly. i do have easy access to the regular usb port and that is the way i would like to program it in this case.)
13  Using Arduino / Programming Questions / bootloader delay on: April 14, 2013, 06:28:36 pm
i need a sketch on my arduino uno to start exactly five seconds after i turn on the power.
is there a way to see how long the bootloader waits to see if a sketch will be uploaded before starting the currently loaded sketch?
my plan is to add a delay at the very end of void setup that way the sketch start time would be
(bootloader) plus (delay) = 5 second delay before void loop
this way if i know the bootloader delay i can then do the math for the added delay

14  Using Arduino / Motors, Mechanics, and Power / Re: arduino motor shield on: December 11, 2012, 01:14:29 pm
what i'm working on is a sumo bot. (two robots go into a a round ring and try to push each other out, the robots must be fully autonomous). i want to make the code with as few lines as possible to allow for the greatest speed. they way i'm designing my code is that when the bot detects an object it will drive at it full speed. as soon as no object is detected it will kick on the brakes because it is very easy to drive out of the ring. then all that needs done is one of the motors switched into reverse and to turn the brakes off the cause the robot to spin locating the target. then another quick tap of the breaks and switch the one motor back into forward and off we go after the opponent. in this scenario the motors are always at full speed and i don't constantly have to command the PWM up or down.

does this sound reasonable?
15  Using Arduino / Motors, Mechanics, and Power / arduino motor shield on: December 10, 2012, 10:30:50 pm
i am using an arduino motor shield r3 to drive two brushed dc motors.

on the motor shield can the brake function be engaged without stopping the PWM command to the motors.
for example if the robot is driving forward full throttle (PWM at 255) and a obstacle is detected and i want the robot to stop until the obstacle is gone can i engage the brakes with out dropping the PWM to zero. so when the brakes are disengaged the robot will continue full speed. or will doing so fry the board by short circuiting it.

is the board protected?
Pages: [1] 2