Pan and Tilt Servos control?

If you need technical help with anything you've bought from Dawn Robotics, please post here.

Re: Pan and Tilt Servos control?

Postby Miltos » Mon Jan 26, 2015 2:18 pm

Hi Alan,

thanks for your reply again! I was suspicious about the bootloader too!!! I've got Arduino Uno.Can we fix the bootloader with that? If so kindly give me instructions on how to...

Thanks again,
Miltos
Miltos
 
Posts: 14
Joined: Mon Jan 19, 2015 10:16 pm

Re: Pan and Tilt Servos control?

Postby Alan » Mon Jan 26, 2015 6:31 pm

Hi Miltos,

Great news that you have an Uno. This tutorial shows you how to use an Arduino as an ISP in general.

Specifically for the Mini Driver

  • Load the sketch File > Examples > ArduinoISP onto your Uno
  • Connect wires as follows between Uno and Mini Driver

  • Uno Mini Driver
    10 <---> RST (RESET)
    11 <---> MO (MOSI)
    12 <---> MI (MISO)
    13 <---> SCK

  • Provide power to both the Uno and the Mini Driver. Probably the best way is to plug them both into the same PC with USB cables.
  • In the Arduino IDE select Tools > Programmer > Arduino as ISP
  • Select Tools > Board > Arduino NG or older w/ ATmega8
  • Select Tools > Burn Bootloader


You can check that this has worked by trying to upload the Blink sketch to the Mini Driver.

Best of luck. :)

Regards

Alan
Alan
Site Admin
 
Posts: 311
Joined: Fri Jun 14, 2013 10:09 am

Re: Pan and Tilt Servos control?

Postby Miltos » Mon Jan 26, 2015 11:32 pm

Thanks Alan,

but this "journey" will take long... I've followed your guide for flashing Dagu Mini Driver with the bootloader but the process stucks on with this message "Burning bootloader to I/O Board (this may take a minute)...".
Then nothing happens :!:
May be my Dagu is completely dead but I can still see its blue light blinkign when connecting on board...

That's it for the moment...
Miltos
 
Posts: 14
Joined: Mon Jan 19, 2015 10:16 pm

Re: Pan and Tilt Servos control?

Postby Alan » Tue Jan 27, 2015 11:41 am

Hi there,

When it says 'this may take a minute' it should probably read this may take 5 minutes. Can you please leave it for a while longer to see if you get any results?

Also, I can't find your order number by searching for your name and email address in our order system. Could you please email it to me at sales@dawnrobotics.co.uk? Apologies that it's taking so long for you to get up and running with your robot, it really should be a much quicker, better experience than this.

Regards

Alan
Alan
Site Admin
 
Posts: 311
Joined: Fri Jun 14, 2013 10:09 am

Re: Pan and Tilt Servos control?

Postby Miltos » Tue Jan 27, 2015 4:49 pm

Hi Alan,

The bootloader doesn't load eventhough I've tried every combination possible. I wonder if the VCC and GND pins on ISP have anything to do with this, as are not connected to anything.

Anyway, I will try a few combinations more and I'll tell you the results...

You will not find my name or email address in your database as I haven't purchased any robokit from Dawn robotics. It happened to have a mini Dagu Driver and an Arduino UNO and I build the camera robot from scratch with my students in Greece. I am a teacher of technology in a High School and this camera robot is an opportuinity for our students to learn and explore... You''ve already helped a lot and I want to thank you for this...

As a result, if you think that the Dagu mini driver is faulty we will proceed to buy another one from Dawn robotics.

Regards,

Miltos
Miltos
 
Posts: 14
Joined: Mon Jan 19, 2015 10:16 pm

Re: Pan and Tilt Servos control?

Postby Alan » Wed Jan 28, 2015 12:35 am

Hi Miltos,

No worries, glad I don't have to feel guilty about your Mini Driver not working. :)

The Atmega8 on the Mini Driver is fairly robust so I think it probably can be rescued. It may just be some problem with setting up wiring between the Arduino and the Mini Driver.

Perhaps you could try wiring VCC and GND on the Mini Driver to the 5V and GND lines on your Arduino. This would make sure that they have a common ground and power.

You may also be able to get more information by running avrdude from the command line. Avrdude is the program used by the Arduino environment to upload the bootloader. This is probably easier to do on Linux (you can run it from the Pi command line) but if you run

avrdude -c arduino -p atmega8 -P SERIAL_PORT

where SERIAL_PORT is the name of your COM or serial port (probably /dev/ttyUSB0 or /dev/ttyACM0 on Linux) then you should hopefully get some info on whether avrdude can see the Mini Driver (atmega8).

Regards

Alan
Alan
Site Admin
 
Posts: 311
Joined: Fri Jun 14, 2013 10:09 am

Re: Pan and Tilt Servos control?

Postby Miltos » Wed Jan 28, 2015 2:39 pm

Hi Alan,

I've got Dagu Drive Mini driver installed on COM4. This is the command line I give inside avrdude:

avrdude -c arduino -p atmega8 -P COM4

and this is the reply:

avrdude: stk500_getsync(): not in sync: resp=0xfe

Any guesses?
Miltos
 
Posts: 14
Joined: Mon Jan 19, 2015 10:16 pm

Re: Pan and Tilt Servos control?

Postby Miltos » Wed Jan 28, 2015 9:01 pm

Hi Alan,

Finally success!!! :D It was my fault!!! I will try now to upload something on Dagu Mini Driver and I will let you know the results....

Thanks a lot!!! again,

Miltos

Edited: Yes, success with the upload file as well...everything works great, now. I believe this will turn as a great guide for this forum too...
Miltos
 
Posts: 14
Joined: Mon Jan 19, 2015 10:16 pm

Re: Pan and Tilt Servos control?

Postby Miltos » Thu Jan 29, 2015 10:38 am

Alan hi again,

I need now to re-configure the left virtual joystick to control the servo motors as a substitute the electical ones. Where is this configuration file and how can I modify it as the two servo motors are connected now to D5 and D6 pins?

Regards,
Miltos
 
Posts: 14
Joined: Mon Jan 19, 2015 10:16 pm

Re: Pan and Tilt Servos control?

Postby Alan » Sat Jan 31, 2015 12:36 am

Hi Miltos,

Fantastic to hear that you're up and running. :)

To change how the motors are controlled you'll need to modify mini_driver_firmware.ino.

You should see in the processMessage routine (line 458) that the left and right motor speed are read out of the 'set outputs' serial message and stored in global variables for motor direction and duty cylce (speed). At the moment the duty cycles are sent out to the DC motors using an interrupt service routine at the bottom of the file but I think that what you'd want to do is to add some code into the main loop (probably around line 280) to take the values stored in the globabl variables and send them to your servo motors.

Once you've made your changes to the firmware, change one or both of the values of VERSION_MAJOR and VERSION_MINOR at the top of the file. Then, when you next start up the robot, the web server should detect that the firmware is out of date, and compile and upload it (you can follow progress on the 192.168.42.1/logs.html screen).

Hope that helps.

Regards

Alan
Alan
Site Admin
 
Posts: 311
Joined: Fri Jun 14, 2013 10:09 am

PreviousNext

Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest