Recent Posts

Pages: [1] 2 3 ... 10
1
Well, you need to define UINT_MAX before you can use it. Try to add
Code: [Select]

#define UINT_MAX 65535

Or
#define UINT_MAX ((unsigned int)~0)

But yeah - better to include limits.h (if that's the correct one).
2
Project Guidance / Re: PWM as Analog Audio Gain C...
Last post by mattlogue - Today at 05:15 am
Thanks. I'm using speakers which produce a variety of tones, including a paging horn located outside. It will be used as an alarm of sorts.

I wanted to control the amplitude of the square wave (tone) of any given frequency, since the PWM (analogWrite) is 490 or 890Hz about, i'd have to filter that out with a RC network. I think I got it figured out after a hour or so tinkering with it and watching the scope.

See the above link to a JPG schematic. It works surprisingly.

3
Software / Re: Cómo realizar una comunica...
Last post by surbyte - Today at 05:10 am
iré haciendo obervaciones conforme lo voy analizando.

Al comienzo del loop pones inicio como una llamada de un  goto?
Code: [Select]
inicio;

Creo que ahi tienes un pequeño problema.

En tus rutinas terminas con return inicio pero eso no funciona como creo te imaginas. Ahi inicio debería ser una variable y devolver un valor y no saltar a la posición inicial del loop(). No se si esa es tu intención.

Esperaré a que respondas.

En mi compilador tu código ni siquiera compila. Esto ocurre porque no uso el IDE y mi compilador es mas estricto que el IDE.

Ves la serie de errores relacionadas con inicio?

Code: [Select]
D:/Dropbox/Arduino/Foro/Borrar/Borrar_2/Struct/Borrar_2.ino: In function 'void estacion1()':
D:/Dropbox/Arduino/Foro/Borrar/Borrar_2/Struct/Borrar_2.ino:195:20: error: 'inicio' was not declared in this scope
Serial.println("voy a estacion2");
^
D:/Dropbox/Arduino/Foro/Borrar/Borrar_2/Struct/Borrar_2.ino:195:20: warning: return-statement with a value, in function returning 'void' [-fpermissive]
D:/Dropbox/Arduino/Foro/Borrar/Borrar_2/Struct/Borrar_2.ino: In function 'void estacion2()':
D:/Dropbox/Arduino/Foro/Borrar/Borrar_2/Struct/Borrar_2.ino:341:20: error: 'inicio' was not declared in this scope
D:/Dropbox/Arduino/Foro/Borrar/Borrar_2/Struct/Borrar_2.ino:341:20: warning: return-statement with a value, in function returning 'void' [-fpermissive]
D:/Dropbox/Arduino/Foro/Borrar/Borrar_2/Struct/Borrar_2.ino: In function 'void loop()':
D:/Dropbox/Arduino/Foro/Borrar/Borrar_2/Struct/Borrar_2.ino:355:3: error: 'inicio' was not declared in this scope
*** [.pioenvs\megaatmega2560\src\Borrar_2.ino.cpp.o] Error 1
4
General Electronics / Re: Is it acceptable to overlo...
Last post by ted - Today at 05:02 am
I bought this DC-DC converter.

https://www.banggood.com/Waterproof-DC-12V-24V-To-5V-10A-50W-Step-Down-Converter-Regulator-Power-Module-p-1181731.html

http://www.wengaoelec.com/12V-24v-to-5V

According to the specifications it's good for 5V 10A and it has Short circuit protection, Over load protection, Over temperature protection, Over voltage protection
 think?


Built-in over/under voltage input, overload, overhead, and short circuit full protection

Would it make it better if I would add a big capacitor (i.e. 4,700uF) on the output?

The answer is in specification, converter will shut down and you need to turn power off/on to activate it. Overload protestion oftem is time dependet.
Capacitor will make worse, 4,700uF for 10A is not much, but if you add 10 times more = 4700uF that can cause overload by capacitor itself.

5
Will these servos physically move as fast as you want? I mean, take this:

Code: [Select]

loop() {
  servo.write(45);
  delay(2000);
  servo.write(135);
  delay(2000);
}


If you do that, do the servos swing through 90 degrees at the speed you need? If not, then it isn't code that's the problem: those particular servos just plain won't do what you want.

If they will, and the problem actually is the sequencing of servo writes in the code, then what you want is do-able. But I suspect it will take a fairly severe restructure to do, because if the code is written properly with millis for timing then you could make those writes happen whenever you like. If you can't do that, then the code must have delays and blocking loops, many of which will need to be unrolled into state machines.

Without revealing your own proprietary code, I'd be interested in links to those snippets you mentioned. I'm having trouble with servos myself :) .
6
Project Guidance / Re: Vinyl record lathe cutting...
Last post by SRWilson - Today at 04:58 am
Please forgive the thread necromancy. Having said that, there are some things in order.

Groove depth should be constant. If you go to the Aardvark Mastering site, you'll find the RIAA mechanical standards for records. This is helpful information to have, since you'll be pretty much mastering your own work. Depth is where the advance ball comes into play. From the sounds of things, you're pretty far ahead already.

As per groove spacing, how it was done in the days of analog 2-track, was to use an extra head in front of the playback head for the loudness information to speed up or slow down the feedscrew. This look ahead information gave the lathe a chance to be prepared, so that when the audio caused the cutting stylus to move, it had plenty of space when it hit. Somehow I recall the cannon shots of the Telarc recording of the 1812 overture.

One more thing. Don't forget to have a vacuum to collect the chip, if you're cutting true lacquer. This is extremely flammable stuff. Think of nitrate film stock, and you have an idea.

I'm assuming at this point, you already have a cutting head you'd like to use with your lathe. The Presto lathes were really solid. While not quite a Scully, they could give surprisingly good results if you are mindful of its limitations. As is anything else in recording! :-)

Hope these points can be food for thought. Good luck with your project! ^_^
7
Proyectos / MOVED: Cómo realizar una comun...
Last post by surbyte - Today at 04:54 am
8
Project Guidance / Optimization of Quadcopter Dro...
Last post by bob10113 - Today at 04:54 am
Hello everyone,

Just as a disclaimer, this code compiles fine and runs on the drone. I just have a few questions about optimization and implementation.

First of all, data processing has been a killer. I started off this project about a year ago, trying to use all the sensors I could get my hands on. After messing with the ADXL345 accelerometer for forever, I finally decided to just use the L3G4200D 3-axis gyroscope. Even after extensive use of running averages and exponential filters, the ADXL345 was simply just too noisy and I cut the code from the program.

Are those two sensors quality enough for a project like a quadcopter? I acknowledge my code may be at issue here (I can upload the paltry processing for the accelerometer if need be), but still - the values were all over the place.


Getting back on track, does the code itself seem like it's on the right track? This is my first experience with a PID (or PI in my case) controller, IMU input, PWM output - the whole bits. I'd really like someone to take a look at the Control Section of the code (especially the PI code) and see if I'm at least in the ballpark. It's located at the bottom of the code. The loop time of the program is at about 8ms, which is disappointing because the L3G4200D could use some extra speed for processing noise out.

And now - the final question..

My motors have recently started stuttering often. I'm nearly positive it's not wiring, as they never stutter if I can get them started. I know the ESC's are rated for 1000us - 2000us PWM pulse, so it's not that - unless pausing the interrupts for a few microseconds would interrupt the pulses enough to cause the problem. I tend to think it's the battery (3c LiPo) causing the issues, but I'm not sure. I've been getting some erratic voltage outputs from the battery - in the ballpark of 14v - 15v, but then again, it could be the $15 multimeter.

Thanks

 
-*edit*- I tried to tag the code in, but it was too long.. I attached it below.




9
There are some better ways of encoding the alphabet. See this link. Post #8 has code to try.
10
Code: [Select]


Yes, copy to the scratch pad. Then post a reply. See the very first item above the text is "</>". Click on that and the cursor will be automatically positioned for you to copy what is on the scratch pad. On a PC, use ctrl-c. And your code will go right to proper place.

Paul
Pages: [1] 2 3 ... 10