go away spammer

Author Topic: how to make a GUI for robots?  (Read 25395 times)

0 Members and 1 Guest are viewing this topic.

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #90 on: February 19, 2009, 03:56:30 AM »
« Last Edit: February 19, 2009, 04:00:54 AM by cosminprund »

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #91 on: February 19, 2009, 04:25:15 AM »
lol oops

link fixed

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #92 on: February 22, 2009, 03:33:18 PM »
Just to let you know this is not dead. This weekend I worked on the code that will run on the MCU. The code is made to be easily ported from one Atmel to another, lots of "defines" and conditional compilation. In fact one only needs to alter the file "customize.h" to make it work with an other MCU, and even that is made to be easy. The code also implements an bidirectional communication protocol - or to put it in the usual RS232 words: I implemented an AT command set :D

The brave ones of you might want to download the code (it's in the attachment) and give it a try. The code is NOT complete: only one "dump" method is implemented, the code wasn't tested on anything but the Axon - in fact if you try to compile for an MCU that only has one USART you'll get an error because I haven't implemented that branch of the conditional compilation.

This is a quick reference on the "AT" command set, just to get things started:
"AT" => gives an "OK - I'm here message"
"AT?" => gives information on all available AT commands - sort of like an help.
"ATI" => gives information on the MCU and it's capabilities. It's designed so an GUI like the SoR Scope may parse the returned information and figure out what's on the other side of the RS232 :)
"ATDUMP DECIMAL ALL 8BIT" (or it's short form "ATD D A 8") is basically the equivalent of the "axon_daq" - it converts and dumps all configured pinx (16 on the Axon) and writes the result as a decimal value (human readable). This is the only "dump" variation that works at the moment.

Right now the code doesn't work with the SoR Scope GUI (funny thing, isn't that) because the SoR Scope needs to learn to send the AT commands. The code is provided as an AvrStudio project: unzip, open it up in AvrStudio and hit "build all". I didn't provide an HEX file because I don't want people tempted to use it on the Axon with Axon's bootloader: This project was made from scratch, it doesn't include any of the Axon source code and I'm not sure if any special configuration options need to be made for it to work with the Botloader!

Anyway, have fun with the code, I know I had fun writing it.
More next weekend.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: how to make a GUI for robots?
« Reply #93 on: March 01, 2009, 09:40:24 AM »
Quote
it doesn't include any of the Axon source code and I'm not sure if any special configuration options need to be made for it to work with the Bootloader!
It won't interfere with the bootloader in any way. So no problem with including the .hex!

Just let me know what I should add to the SoR Scope tutorial when you're ready. I haven't been too motivated to work on this much more simply because its already passed my expectations and what I currently need it for. :D

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: how to make a GUI for robots?
« Reply #94 on: March 02, 2009, 01:38:42 AM »
You shouldn't work on the tutorial until I manage to finish the configurable part in the Scope itself. Ie: after you connect to an MCU that's running the SoR Scope AVR software you'll be presented with a dialog box to decide for yourself what you want to graph and how (what pins, what speed, stuff like that). Technically all the difficult bits are done, it's just that I got carried away with other stuff and haven't managed to write a single line of code over the past week :(

As for what should be in the tutorial, I've got a few ideas:
- It should show how you use the Scope to figure out what data you're receiving from an sensor. IR sensor would work out-of-the-box, for the Ping))) sensor a new option is needed (feature creep :( )
- It should show how you measure the PWM pulse from an other MCU!
- It should show how to use the Scope from an running robot (ie: it needs some functions to send "updates" when needed; Coupled with the ability to send an indication of what the servos are supposed to do it would provide a cool debugging tool).

I'm also planning on writing a small helping library that would do "Hardware Assisted Software PWM", with one or two full ports (ie: 8 or 16 servos), using one 16 bit counter (overflow interrupt actually) in a set-and-forget manner (the library would expose one global variable per connected servo where one just writes the length of the pulse, allowing the software to do everything else). I'm planning on using the SoR Scope to test and prove this library :)

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: how to make a GUI for robots?
« Reply #95 on: March 13, 2009, 11:21:52 PM »
Incidentally: have you tried setting U2XN (see section 22.2.2 of ATMega640 spec).

The transfer rate can be doubled by setting the U2Xn bit in UCSRnA. Setting this bit only has
effect for the asynchronous operation. Set this bit to zero when using synchronous operation.
Setting this bit will reduce the divisor of the baud rate divider from 16 to 8, effectively doubling
the transfer rate for asynchronous communication. Note however that the Receiver will in this
case only use half the number of samples (reduced from 16 to 8 ) for data sampling and clock
recovery, and therefore a more accurate baud rate setting and system clock are required when
this mode is used. For the Transmitter, there are no downsides.


So you may be to double the xmit speed from the CPU. Havent tried it yet but just a thought.
« Last Edit: March 13, 2009, 11:25:29 PM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 952
  • Helpful? 5
  • cooll
Re: how to make a GUI for robots?
« Reply #96 on: March 14, 2009, 04:06:48 AM »
what i have been trying to dois that...iam writing dll files using c++...then usig vb iam designing the gui and importing the dll files to use its functions then...iam programming my microcontroller to recive commands from my c++ back end...

its quite tricky but nonetheless very usefull...oh yes the gui is connected to the mcu via wireless.
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

 


Get Your Ad Here

data_list