RS485 with Picaxe?

Hendriks

Member
I am about to buy a Gecko GM215 stepper driver.
One of its features is that you can control it by sending ASCII commands to its RS485 port. (115,200 baud default)

To control this driver with a Picaxe, would I need an interface like a MAX485 or LTC485?

Or isn't it even possible to do?
 

techElder

Well-known member
When you speak of "RS485", you are speaking of serial transmission over a balanced half-duplex pair with multi-point stubs where gadgets like your "Gecko GM215" sit waiting for commands. Each stub has an address.

So, strictly speaking, you need an RS485 driver to go match those requirements. However, there are ways to use regular RS232 into that gadget, but it depends on how the gadget is set up.

Do you have a data sheet available?
 

techElder

Well-known member
Are you going to use multiple drivers? These things talk to each other over the RS485 line, and it seems that each driver has a "name" which would be its address, I suppose. So, if you do something that isn't RS485, you might be interrupting the local communication.

Appendix A shows how these commands are coded to this 2-word binary format used by the GM215. This is to allow a user to write their own GUI if they wish to do so.
Is this what you intend to do? It seems these drivers have a robust internal programming structure.
 

Hendriks

Member
I want to connect 2 drivers to the RS485 bus (for 2 axes), this should not be a problem.

My key problem i that I want to send ASCII commands to the master driver with a Picaxe. So I don't generate Step-Dir nor CW-CCW signals, I just tell the drivers where I want the axes to go and how fast.
 

techElder

Well-known member
You are going to need to stick with RS485 since your two drivers will need to communicate with each other.

My suggestion is to start with one of these modules from eBay (search in your version of eBay): http://www.ebay.com/sch/sis.html?_nkw=MAX485+Module+RS-485+Module+TTL+to+RS-485+Module+#Cu3&_id=121235071900&&_trksid=p2057872.m2749.l2658

Your PICAXE program will perform the same commands that you can perform from a terminal program. You'll send commands via serial, similar to this one http://www.geckodrive.com/support/motor-control-manuals/stepper-drives/gm215r7b/motion-commands.html . Nice that you can work out the syntax etc. manually.

You'll have to study the command set so your program can test for limits etc.

Looks like those are some smart drivers, but I don't know what you will be using as a source for the commands. Will you be trying to read source files from drawings? You won't be able to do that directly with a PICAXE, of course.
 

Hendriks

Member
Hi Tex,

Thanks for your suggestions,
I just bought two of these RS485 modules to try.

My goal is to send 2 axes to a few pre-determined positions by pressing a button. So nothing fancy.
I think the Gecko drives will do all the work for me, so the Picaxe doesn't need to send high frequency pulses, only simple text.
 

rossko57

Senior Member
I think the Gecko drives will do all the work for me, so the Picaxe doesn't need to send high frequency pulses, only simple text.
I don't think you'll be sending text to these drivers, even though they will do the donkey work.

Note that the datasheet tells you all about the PC based user program editing tool. The expected use of these drivers is to be pre-loaded with a program in their flash memory, written with that PC tool. Bit like using PE to program Picaxe, this does NOT send the text you are looking at onscreen down the wire to the chip, but instead translates to machine code at the PC end before transmission to onboard flash memory.

I think you'll need to study EDIT MODE, which is intended as a diagnostic aid allowing an RS485 host (PC) to direct program control and read status back. You should be able to send byte sequences that effectively amount to "direct" motion commands, but it is not intuitive or textual, see page 43 RUN. Note also the 'ready' handshaking described there.
 

Hendriks

Member
http://www.geckodrive.com/support/motor-control-manuals/stepper-drives/gm215r7b/product-description.html

Gecko says:
"...The GM215 motion controller core is a 16-bit MCU, FPGA, Flash ROM and an RS485 interface transceiver. The motion controller executes ASCII format commands sent from an external PC or from its own non-volatile memory.
'ON THE FLY' MOTION CONTROL: Acceleration, velocity and destination can be changed even while the motor is in motion. The new values apply immediately..."


If I understand what you say, the PC software compiles the commands for the driver.
But from the quote above I would hope that I could send ASCII commands on-the-fly that would be executed immediately.

You kind of shattered my hopes....:(
 

Hendriks

Member
I sent a message to Gecko:
"Is it possible to send ASCII-commands from a microcontroller to the RS485 port of the GM215 to control the driver and have them executed immediately?"

Today they answered:
"Thank you for contacting Geckodrive technical support.
Yes, you can send ASCII commands to the GM215 but doing so would require significant time to write code. The communication would be very tedious to write but it is doable.
Please let me know if you have any questions. Thank you!"
 
Top