Monday, December 25, 2023

MDrive 23 Plus and a micro controller

MDrive Plus 23

The MDrive Plus 23 is stepper motor with the NEMA 23 form factor with a built in driver 
(Type MDI1FRL23A7-EQ-OL1).

I bought a box of these stepper motors as it would make some projects a lot more compact to build if you do not have to use separate stepper drivers. Great for a robot arm where a big toroid transformer can be used as a weight int he base but you do not need the space for 5 or 6 separate drivers.

The stepper motors that I got are equiped with a short lead and a M12 fine thread 5 pin connector.

The challenge

MDrive type stepper can be controlled in many different ways, this is determined by the configuration of the software. The drive can be programmed for analog input, step and direction, RS-422 and RS-485 serial connectivity. Almost all I/O in the drive is multi purpose.

So now I have to figure out what protocol to use as I got them preconfigured ...
 
The drives came with a Phoenix Junction box, I tried to find some information about this type but it seems that they are built to specification. Good news, the pinout of the 8 pin multi connector and the 4 output connectors is documented on the back.

Pin 1 - Is the supply voltage
Pin 3 - Is the 0v connection 
Pin 2 - I/O (B) data connection
Pin 4 - I/O (A) data connection 
Pin 5 is Ground (GND)

So the first step is to take the lab PSU and power the drive with 24 volt. The range according to the specification of this drive is somewhere between 12 and 70 volts. 24 volts is on the safe side.

I removed the connector from the multi cable and hooked up the 24 volts to the brown and blue leads, I checked tried to rotate the axis of the stepper motor and there is an appearent hold current. So power connection done.

Now the tricky part, I do not know for sure that the connectivity is RS-485, there are only 2 leads for the data. Also, what is a good terminal application of you want to debug serial communication on a Mac? Hmm,

The current setup is an ancient Prolific USB to RS232 cable, a RS connection checker (a 25 pin to 25 pin
converter with leds for RTS, DTS, rx, tx etc). and a KK systems K2 RS-232 to RS 485 converter. Only dip1 to on RS-485 communication. It looks rediculous but sometimes you have to work with what you got.
 


First tried directly using iTerm with 
screen /dev/tty.usbserial-FD120 9600.

Pin 3 (B I/O) and 8 (A I/O) are the data lines and pin 1 is ground on the Delta 9 output of the K2 converter.

The wires of the multicable
B = 2 (GY/PK) 
A = 4 (WH)

Connecting to the port at 9600 baud with the connection above made the stepper motor start to run. Kind of a success, I think, kinda ... but not.

Even thought he I/O A And I/O B are both designators for the RS-485 protocol it turns (no pun intended) out that the A and B connections let the motor turn CW or CCW depending on the pins that are pulled low. The default DTR and CTS pulled low made things move but this had nothing to do with serial communication.

Now what?

Factory Reset

I don't know what day and age the drives come from and the company has changed names a few times over the years. There is a lot of documentation but I have not found a single source how to properly get you started.

One of the documents (2003) referes to the MD-CC200-000 interface, I snipped an image out of the PDF, 

So the requirements are a RS-422 connection to the 10 pin P2 header of the drive. The NEMA 17 and 23 drives use pinf 6, 7, 8, 9, 10 as can be seen in the image. The rest of the pins are reserved for nema 34 or can be configured as additional in or outputs.
 
It seems that this pinout is still valid. I need to reconfigure the KK K2 RS422/485 interface to go with the standard wiring. Only thing is that I have no connector to use to connect to the drive.
The connector type in the old document is not correct, it is in fact a DF11-10DS-2C connector, it has 4 notches, 2 at one long side and 1 per short side.

Novanta IMS - MD-CC402-001 USB drive connector kit is recommended. Lowest price I found for this item was 170 US dollars. I must be able to do better as this is a USB to RS-232 converter with built in RS-232 to RS-422 converter.

According to the documentation the following must be done to reset the drive to factory default.
 
Type FD and press ENTER. (FD = Factory Defaults.) 
The “Copyright 2001-2003 by Intelligent Motion Systems, Inc.” Message should appear.

2023-12-25 --- this is where the story pauses. In search of a connector to hook up the RS-422. To be continued.

No comments:

Post a Comment

It is not good because it is old, it is old because it is good

In the category: Borrowed wisdom is better than no wisdom at all. The title is a quote I have seen somewhere in a machinist forum. I can...