Welcome, Guest. Please login or register.

Username: Password:

Author Topic: How to complie firmware  (Read 5948 times)

kaito83

  • Full Member
  • ***
  • Posts: 47
    • View Profile
How to complie firmware
« on: September 05, 2016, 06:02:05 »

Dear All!

How to compile firmware to mega2560.

Regards Tamas
Logged

GigiG

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: How to complie firmware
« Reply #1 on: September 05, 2016, 08:04:38 »

Take the source from Tom's site, substitute the PinMappings.h with the one I give you (available on my site too), use the Arduino IDE to compile the source and upload the hex to the Mega via USB (try the latest 1.6.11 version, if something goes wrong use the old 1.0.6, as suggested by Tom). Then use the AstroEQ ConfigUtility to configure your board, via USB too. Finally try the Bluetooth connection to control your AstroEQ using EQMOD interface directly or via Sky maps softwares.

Gigi

EDIT: Be aware that this PinMappings.h is for my AstroEQ on prototype-shield version! If you built the home-etched version you need a different file. I'll put both PinMappings.h versions on my site soon
« Last Edit: September 05, 2016, 14:03:08 by GigiG »
Logged

doramason

  • Full Member
  • ***
  • Posts: 37
    • View Profile
Re: How to complie firmware
« Reply #2 on: November 02, 2016, 15:58:44 »

Hi GigiG,

I would like to make some changes to the firmware but I couldn't get a respond from Tom for help I guess he is busy with classes/exams. I hope you can help me with it.

I have a diy astroeq(made with ICs not arduino). I want my motors to run at full step at higher speeds(lets say above 200x sidereal) to have maximum torque. At default motors run at 1/4 microstep which loses some torque so I can't pass a certain speed. Which part of the code should I change and which software should I use? can I do it with arduino software?

another thing I want to add is a bluetooth module like hc-05. I'm guessing additional code needed for that to work plus new pin mapping. have you done it already to your version? 
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: How to complie firmware
« Reply #3 on: November 03, 2016, 00:29:17 »

Hi doramason,

To be fair if the motors are maxing out on 1/4 stepping, you aren't going to get much of a performance boost going to full stepping - it might be a few %, but on the down side it will be a very non-smooth movement (full stepping at low speed to accelerate makes a noise that sounds horrible!).

There isn't an easy way to adjust it as the AstroEQ firmware was designed to change the timer prescaler when switching between step modes. The ATMega timers have limited dividers, with the only two useful ones being a factor of 8 apart. This is why you will notice that all of the high speed step modes are 8x larger step size than the low speed step modes (32x with 4x, 16x with 2x, 8x with 1x). Changing that would require quite a major firmware redesign. In the very early firmware it could have been done because all of the motor routines were completely different, however this was changed about 3 years ago in order to improve the firmware massively.

Bluetooth shouldn't need any code or pin-map changes. Basically you just need to connect the TX/RX of the Bluetooth module to the TX/RX pins of the ATMega via some jumpers so that you can select between either the USB-Serial converter or the Bluetooth module.
Logged
Tom Carpenter (AstroEQ)

doramason

  • Full Member
  • ***
  • Posts: 37
    • View Profile
Re: How to complie firmware
« Reply #4 on: November 03, 2016, 08:47:37 »

Thanks for the answer Tom. So I'm guessing full steps are not a possibility even with newer firmwares and it is far beyond my capabilities to change. I don't mind the sound or the vibration if I can have higher speeds. The problem why my speed is too low is because of the worm adjustment. If I tighten it to eliminate the end play then motors can't turn that fast. I will try a new set of axial bearings maybe they will improve the situation.

So for the bluetooth, can I just solder the TX/RX of the bluetooth module to atmega and it would work? nothing extra is needed? Like resistors or other components in between? Because I will also do it for my arduino focuser and it requires some resistors. here is the schematic for that. 
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: How to complie firmware
« Reply #5 on: November 03, 2016, 08:57:14 »

If the Bluetooth module is not 3V tolerant, then yes, you will need some form of level shifter for the RX like the resistors you show.
Logged
Tom Carpenter (AstroEQ)

DwightP980

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to complie firmware
« Reply #6 on: November 19, 2016, 02:33:22 »

Hello, I'm what you may call a bit of a noob to the world of Arduino and AstroEQ, but have been bitten by the bug for sure.

I've purchased an Arduino Mega 2650 R3, NEMA 14 motors, DRV8825's the pulleys, and I'm in the process of putting this system together for a Celestron (Vixen) Super Polaris EQ mount.

I have downloaded all the recommended items per Tom, and Gigi's suggestions and have copied and pasted the PinMapping.h file from Gigi’s website and renamed as per the instructions in the AstroEQ-Guide.PDF to PinMappings.h.

After loading Arduino 1.0.6 IDE I copy and paste the PinMapping.h. file to a new clean Sketch and try loading to the Mega with no luck.  :(

I receive the following errors after this compiles or if I try to load to my Mega:

core.a(main.cpp.o): In function `main':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:34: undefined reference to `setup'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:44: undefined reference to `loop'

Not sure what to do at this point, but any, and all help will be greatly appreciated.

Regards,

Dwight Parks
Orlando, FL USA
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: How to complie firmware
« Reply #7 on: November 19, 2016, 13:01:25 »

Have you downloaded a copy of the AstroEQ firmware? (Found here: https://github.com/TCWORLD/AstroEQ, there's a zipped copy in the Downloads folder).

Logged
Tom Carpenter (AstroEQ)

DwightP980

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to complie firmware
« Reply #8 on: November 19, 2016, 16:24:56 »

Hello Tom,

My system is a Windows 10 Pro 64-bit version PC.

I have downloaded the AstroEQ-master folder, opened the AstroEQ-Firmware folder, and then clicked on the AstroEQ folder. After opening I then click on the AstroEQ.ino which then opens Arduino 1.0.6 which I’m running in Compatibility Mode for Windows 8, make sure I have selected the Arduino Mega 2560 board and the correct Com Port after confirmed in the Device Manager.

I then go to Sketch, Click on Add File, and select the PinMappings.h file.

When I either try to Compile, or Upload to the Mega2560 I receive the error messages:
core.a(main.cpp.o): In function `main':
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:34: undefined reference to `setup'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:44: undefined reference to `loop'

Trying this on two new Arduino Mega2560’s (one is the original Arduino Mega2560 R3, and a SainSmart 2560 clone) I get the same errors.

Also, I know I can communicate with the boards as I have loaded and modified the ‘Blink” sketch with no problems.
I’m sure it is something I’m doing as many people are using this system with great success but, I’m lost as to what my problem is.

Thanks for the help!

Dwight Parks
Orlando, FL USA
Logged

DwightP980

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to complie firmware
« Reply #9 on: November 19, 2016, 19:50:01 »

I forgot to include in my previous post that I also have downloaded, and installed to my desktop the following
programs :

AstroEQ
Cartes du Ciel
Arduino
ASCOM Diagnostics, and the ASCOM Profile Explorer

Dwight
Logged

DwightP980

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to complie firmware
« Reply #10 on: November 27, 2016, 23:41:24 »

My compiling problem is solved!  ;D

What I failed to understand after trying repeatedly to compile this program was it must all be loaded into the Arduino program, by first loading the AstroEQ sketch, then adding all the .cpp and .h files into the same directory.
Perhaps this will be of some use to someone suffering the same issue.

I’ve now programed the Arduino Mega 2365 R3 bread boarded two DRV8825’s and I’m able to control two NEMA 14’s with EQMOD.

Still trying to sort out tracking with CDC, but I’m sure with some more research that will come along too.

Next comes finishing the modification of the Celestron Super Polaris mount.

Clear skies to all!

Dwight
Logged