I need some help from you guys.

I need some help from you guys.
So i recently got an old CNC machine that uses a parallel port for control. The controller board is a mechapro interface II (see http://www.mechapro.de/pdf/Doku_InterfaceII_EN_20150711.pdf ). So my idea was to use an Arduino Due (loaded with tinyg g2core software) to control the leadshine me742 Drivers. However I can’t get my setup to work. Does someone know if that kind of setup works, or am i missing something? I thought that the GShield might not be necessary since i already have motor drivers.

Any thoughts or recommendations?
Thanks a lot!

I took a quick look at http://www.leadshine.com/UploadFile/Down/ME742m.pdf . I t would appear that with some interface work you could connect to Due running G2core. The Due is 3V logic, the me742 is 5V logic. There are several ways to do this, depending on your available parts and electronic prowess.
Also note that settings such as microsteps might be most easily done manually, but be sure to set your G2core parameter to match so the step logic knows what is going on.
Perhaps you’ll get lucky and someone will stopby who has already done this and can provide some specifics.
Be careful - you will have a lot of different power supplies in this setup, wrong connections can render parts useless rather quickly

Thanks for the quick answer @cmcgrath5035 ​. How does one set up the g2 parameters? Is that something you do in the build process or later in the GUI? Also does someone know which pinout to use for the due?

I’d suggest you wander thru the G2 wiki a couple of times, https://github.com/synthetos/g2/wiki. The simple answer is that you can set parameters in G2 after you boot it up. But, DUE does not have have persistent storage, so you would have to re-enter parameters each boot. Better is to develop for yourself a custom_params.h file and rebuild the G2 binary. The wiki has all you need to do that, straightforward but not trivial.
Here is a starting point for pinout: https://github.com/synthetos/g2/wiki/Arduino-DUE-Pinout-for-g2core . It is somewhat dated but will give you an idea on how to proceed. It will help to have the diagram available as you read thru the wiki
https://github.com/synthetos/g2/wiki

Can a module like this one be used for the voltage level shifting part of the setup ? Would ease the whole thing isn’t it ?
Nice setup guide btw

@Jeremie_Tarot ​ I’m affraid it doesn’t work. Besides being 3.3V the Due pins have very low power ability, not enough to even drive the led of an optocupler. I’ve tried some things to control my Mach 3 controller but gave up due to some probing issues.

The Sparkun unit should work logically, although it is unclear if the output drive on the high side is capable of adequately driving the input opto-isolator on the me742.
If you proceed, be sure to re-read this wiki several times https://github.com/synthetos/g2/wiki/Configuring-Version-0.99
Setting up port pins is a bit more complex for G2core than prior versions of tinyG

@cmcgrath5035 i’ve been reading through all pages of that wiki since days, and i can’t get a grasp of it. So i downloaded the sources and then i need to write lots of new files for a bord that is used by syntheos themselves? I already flashed g2core with Chilipeppr on my Due and whenever i try to move my motors with it (using the pinout of GRBL) the motors don’t move. The Pinout diagram from the wiki cannot be correct since the motor 1 enable pin is on the lower rail of pins (of which the GShield uses none).

Pinout - First understand that I am not a Gshield user, when I created the DUE diagram it was for the most part a graphical exercise plus planning for how I would interface a custom shield.
Starting point was to reverse engineer the Gshield.h file.
But you raised a good point/question, and since I have never really studied Gshield I had a look. ANS: Gshield has a single (all 3 motors) enable on Pin D8, which I labeled ‘gblenabl’.

I do know that folks have flashed DUE with a pre-built gshield build of G2core to drive their motors and it works, using a gshield connected to the motors…

So what did you connect to what in your (failed) test of DUE flashed with G2core. I would guess for sure connecting a DUE directly to the me742 would not work.

@cmcgrath5035 i did indeed connect a DUE directly to the me742’s. The weird thing is that my me742 enable the motors whenever the enable pin is not connected at all and disable the motors whenever it is connected to some pin (no matter if +5V GND or +3,3V). Could this be a matter of wrong microstepping settings in my software? whenever i tried to move the machine i heard the motors doing some noises but they did not move.

In tinyG and G2core space, motor enable signal is active low. If same is true for Gshield, while step and dir are active high.
What did you connect to the enable on the me742s?
Do me742’s enable on logic high or logic low?

They are powered by an 48V power supply. The me742’s are enabled high active. However the manual states that they are usually left unconnected which is the enabled state (that matches my experience)

RE: "I already flashed g2core with Chilipeppr on my Due and whenever i try to move my motors with it (using the pinout of GRBL) the motors don’t move. "
Without level translators, I would not expect any movement, no matter how you connected Step and Dir pins.
If you made no connection to the enable, then, as you say, the motors energise and hold in place, as expected

RE: " So i downloaded the sources and then i need to write lots of new files for a bord that is used by syntheos themselves? "

Not sure what you mean by write lots of new files.
If you want to avoid reentering you machine specific parameters, modify the default machine parameters with the correct parameters for your machine and re compile so they become the defaults.

For clarity: G2core is a software product under heavy development. Lots of changes happen every day.
DUE + Gshield is not a product platform, but does make a viable test, evaluation and customization platform.
In your case, with external drivers, Gshield is not required.
Many folks have built G2 enabled machines, some based on custom shields, some based on external drivers such as yours.
In virtually all cases, users are doing a lot of customization hardware to match their machines to the DUE or other hardware platforms that are based on the DUE compute/control hardware.

If you need something that ‘just works’ out of the box, G2core may not be right for your near term needs.

I have been successfully running 4 Nema 34 motors with external Chinese DM860A from TinyG2 (ArduinoDue + g2core firmware) as a test. I couldn’t use it in production, as there is still an issue with probing. I user level shifters from eBay between Due and DM drivers in order to adapt different voltage.
Alternatively ArduinoUno with grbl pinout and no level shifters needed may be used, so you are on a tight track.

I don’t remember wiring, but you have to play with DIR/STEP + or - setting and enable by connecting ENA to GND or 5V (but not both) depending on your setup.

I’ll be able to provide some help next weekend, far from my machines now.

@sszafran would you share a link to the shifters you used please ?

@Jeremie_Tarot ​ I don’t have the exact link right now, but I just found same level shifter module here: 5pcs/lot Logic Level Shifter Bi-Directional Four-way two-way logic level transformation module
http://s.aliexpress.com/fEneaaI7

@sszafran thanks !
Looks very similar to the one posted earlier to me… Will study this further

I will be posting an update to my situation the following days. I seem to have gotten most things sorted out thanks to your help everyone!