Saturday, June 18, 2011

TC2 - Analise PRM - Probabilistc Roadmap Method

To terminando meu TC e os testes sobre o metodo PRM.
Abaixo algumas imagens dos roadmaps gerados pela minha versão do algoritmo.
Testei a geração de 128 a 256K nodos de configurações.
Neste momento, testo as rotinas de interconexão entre nodos: Center Line Check, Line Check, rotate-at-s e incremental.
Ainda irei implementar a versão binaria.
Estou utilizando o WinBGI para exibição. Pra simplificar a vida. Mas vou atrelar a minha rotina do winapi+opengl.
Desenvolvido com o IDE DEV-C++ em C.

Roadmap gerado com poucos nodos - uns 1000

Roadmap com uns 5000 nodos.

Cheguei a 65536 nodos. Os testes são em 2D. Pretendo talvez no futuro testar em 3D. Mas agora não existe tempo. Tenho que entregar este trabalho!
E ainda tenho alguns testes a fazer.

Friday, December 17, 2010

Input DIrector - Multiples computer from just one interface

I was looking for a tool that allow me to control multiple computer from just one key/mouse.
I know, for long time external key/mouse/display swicthers; they are very nice, but I really want a software to do the job, possible over TCP/IP that control the direction of input data between several computer.
I was almost sure that will find some already done ver internet.
And I found! 2 options! InputDirector and Synergy.
I install and right now testing the InputDirector.
And really works nice!
If you have multiple computers, like notebooks and desktops, and don't like to have to change between keyboards and mouses, this is a really nice software.
It is very light running, and use very few machine resources()compared to several simple comercial softwares like MSN)
Take a look at: http://www.inputdirector.com/index.html and enjoy!

Thursday, October 14, 2010

Debounce Machine! A state approach.

UPDATES IN RED at: 12-11-2010

Reading HackaDay, just can't let to present my debounce routine.
Make my interpretation of it at 2007 with PIC programming.
I start build my debounce routine with a state machine approach.
This way the routine can be solid as stone.(I think least)
And was much more easier to accomplish the right behavior that I wait for.
More, my implementation doesn't force delays, is pretty simple and straight-out - use few bytes of program.
Many keys can be debounced with minimum amount of memory.
Just one byte per key; or less; even a nibble can be used.
And can be combined on a already existent code and interrupt routine.
As I saw on other sites ahead hackaday, it is a low pass filter too.

Below the schematic of all thing.

Created with DiaPortable.

This state machine can be implemented in various ways.
The actual implementation work checking and changing the state on every interrupt (if need).
I prefer compass everything at 5ms interrupt at my routines (due the use I am making).
However if you use a more fast interrupt routine, don't worry, since you may DEFINE the HIGH boundary with a bigger number.
With 4 states (above machine), and 5ms INTs, it can debounce a key in 20ms.
This debounce can be easily converted into code using (I use this way, you are free to chose whatever you want):

  • a variable to register the state of each key that need to be debounced.
  • a variable to register the final status of the key(or just a bit)
  • DEFINE a CONSTANT to LOWER BOUNDARY (or just ZERO value)
  • DEFINE a CONSTANT to HIGH BOUNDARY (1 - 255, how many states you need - this number create the same number of states on each side of diagram)
It need just 2 variables to hold all data and a routine!

Isn't show at picture, but  think and assign to each bullet a number, starting from left to right, from 0 to HIGH. The same with below bullets.

As can be seen on state diagram, a positive or valid signal on monitored PIN will cause the state to increment.
A ZERO cause it to decrement the state (state counter variable).
If the counter was BIGGER or EQUAL than HIGH boundary, then the state register change this value meaning a active PIN and the state doesn't increment more.
If the monitored PIN goes LOW, so the state decrements until reach ZERO.
When this happen, the register is set to ZERO, meaning a inactive PIN and the state stay there too.
I implement this debounce using PIC Assembler, and the code are inside a huge amount of other things.
Below a quickly C version build . I think it can work without major changes.
Better would be change it to work like a function.
Also, I am using two IF inside each state change due I don't know how char will suffer with negative numbers.

///////////////////////////
// Hernandi Krammes - its me - chico
// 10-14-2010 - use with care! 

#DEFINE HIGH 8    // 8 states between changes 8*5ms = 40ms

char keyA_state;
char keyA;    // 0-1 - need just a bit - use whatever you want

ISR(){    // Interrupt Service Routine

          //   for me at 5ms or anything else

    // key debounce
    char tmp;    // just to hold the state of key
    tmp = getPin(pinA);

   // Pls, use a comparation that recognize the right pin state

   // I think that an LOGICAL AND should be a better approach
   // Let me say, bit 2 is the desired PIN
   // so the PINFILTER should be 'b00000010'
   // and the result will be 0 or 1 and the
   // state machine will work nice
   // Thanks to underwood from german that warm me
   // that the code seens to not work
   // I think that is because this
   // Beyond, code shoud work with any microcontroller
   // PIC, Atmel(AVR), etc
   if (!(tmp AND PINFILTER)){ //old mode deprec. (tmp == 0)
        if(keyA_state == 0) keyA = 0;
        else keyA_state--;
        if(keyA_state == 0) keyA = 0; 
    }else{  // tmp = 1
        if(keyA_state == HIGH) keyA = 1;
        else keyA_state++;
        if(keyA_state == HIGH) keyA = 1;
    }
    // ready! the rest int code goes here
}
// There is it. I hope that this could help someone!

Let your comment.

Friday, September 24, 2010

Plotter/Engraver part N

Finaly, the fisrt picture of my Plotter/Future Engraver.
Some considerations about builting with MDF.
As Zoltar say to me, I shouldn't had been use MDF. It is a little bit bad.
Also, I am using just one traction axis for the base, that cause to much leisure on edges of mechanics.
Also, IGUS is to much imprecise. But it work for fun!
I am using old epson drivers and Rima/Emilia motors, that work natively on 200 steps/rev and with microstep now are working with 800 steps.
As say on last post, a Windows software control everything.
The MICROCHIP receive the commands and execute; It make the Glue between all parts.
I chose to use a SERVOMOTOR to control Z axis now. PIC control it! Very tigtht due time limitations, but works.
Microchip have poor stuction set, even that it is fast.
AVR I think may work MUCH better, because the program speed lots of instruction ADDing with carry on Microchip, where with ATMEL AVR there is a instruction that ADD with carry in normal way.
Well, for now, just this. Tomorrow I post a more.
Today the control board (with LB1946) used to play music and make the first tests, BURN due a accidental short circuit.
Now I am fixing with other and older DRIVER CHIP (Aleggro A2919LBS) and ajusting the program to work with this new architecture.
It's a great achievement to use old parts for new and nice things.


Bellow the picture of the hardware already build! Little bit messy, sorry.

Tuesday, August 31, 2010

Plotter/Engraver

The first test with the plotter/engraver have just been done!
Next days, few pictures and videos of project!

Saturday, February 20, 2010

Twitter lixo

Mudando um pouco o foco das postagens...
Esse video postado pelo crash_computer é sem duvida engraçado.
Replico ele aqui. Minha visão é igualmente a dele. Twitter suck.

Changing a little bit the post, this video linked by crash-computer is really fun.
I repost it here. My opinion about is the same! Twitter suck.

Saturday, February 13, 2010

Nova versao do engraver/CNC - New engraver version

Abaixo a imagem da nova versao do engraver.
Como bonus de utilizar uma ferramenta de desenho CAD, é possivel avaliar diversos problemas antes de realmente colocar a mão na massa.
Ainda, é possivel pensar melhor em como fazer as coisas com poucos recursos, otimizando para reduzir o trabalho final!
Acredito que o projeto atual está muito mais proxima da versao final.
A mesa sabe foi colocada "dentro" do eixo X, assim facilitando o suporte do carro maior através das guias IGUS colocadas nas laterais internas do carro.
Consegui tambem uma chapa de aluminio de 3.6mm para fazer alguns detalhes de suporte.

Utilizarei no projeto as seguintes guias IGUS:
DryLin® W carrinho, montado
  • WW-10-40-10 - guia de 50cm
  • WW-10-40-15 - guia de 60cm
Tambem seram utilizados mancais da Igus.
Esses produtos sairam por aproximadamente 500R$ em 2009.