Robot manipulator control device project

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello respected users of AVRfreaks forum. I am currently working on finishing papers for Masters degree study(As i am resident of Croatia we call it sort of diploma work and i can't really translate it into anything that would make sense in English) and my subject is automation of robotic arm or manipulator. I chose Fischertechnik 3-axis model for the simplicity. The project has 4 phases: Electronics, Micro controller programming, computer vision and embedding everything into a windows application. So you can guess I'm stuck at 2nd phase. As I'm total newbie(started it this week) in AVRs i need help setting the general framework for my project. I've read the tutorials on interrupts, USART, timers(PWM) so I can say that I understand the basics.

I'm using Arduino 2009 board with ATmega 168.

So basically what my uC should do is to get PWM values from the computer via USB and setting them to motors(through LMD18200 drivers), reading pulse counters(made of simple buttons), sending states of pulse counters to the PC and taking care of the edge detectors.

So after this lengthily introduction my first actual question: How should i handle buttons? My taught was to handle them each in interrupt routine. Then i taught that debouncing cycles could slow the uC down and the possibility of 2 or more buttons changing state in the approx. same time will make the uC to miss some pulses(as it was stated in one of tutorials that while one INT routine is active the others are disabled). So should i handle this in the main loop or is there any other smart way that i've missed.

Thanks a lot. Ivan

"If what you have done yesterday still looks big to you, you haven't done much today. - Mikhail Gorbachev"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Will you be coding with Arduino or using C such as WinAVR(etc).
I was under the belief that the Arduino code debounces inputs.
If you are coding with C, there is a current thread regarding debouncing (discussing danni's code, which takes very little overhead.)
You must not debounce inside an interrupt! You can use several interrupts to debounce though. Interrupts should always be as short & fast as possible.
The code discussed debounces inputs in background and the result is polled in main.

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you the debouncing topic is most helpful. I am coding in C. I've downloaded danni's code and it's very usefull i just need to find the way to make it work on 2 ports as 4 ports will be occupied by PWM and 4 more to select the motor direction. but i'll ask abot that in the debouncing topic

"If what you have done yesterday still looks big to you, you haven't done much today. - Mikhail Gorbachev"