Re: [Emc-developers] Emc-developers Digest, Vol 114, Issue 13 (Ethernet, STM32F407)

2015-10-14 Thread Karlsson & Wang
> Thanks,
> I attached my code. at the moment I am just working on the protocol, without 
> stm, so this code runs on a pc.
> my code runs without changes in linuxcnc, but for some reason I do not get 
> data from the stepgens, but tcpdump confirms I am parsing all packages send 
> by linuxcnc.
> to get it to work, you only need to change the mac address in the code, and 
> create a 7I92 config with 3 stepgens.
> your idea of using the pwm module to send the data seems better, the stepgen 
> module is to complicated.
> I then thought of implementing my own module, but after all I think the 
> hostmot stuff is too complicated, and too mesa specific, and I am going to 
> implement my own protocol.
> I would appreciate if we could stay in touch about progress on this.
> you only build a encoder interface, and send back pwm, and use the pid in 
> linuxcnc you will not get a very good result, as you do not have cascaded 
> pid.(been there, done that)
> I recommend you put at least one pid in the stm32.
> 
> Rene

Code is run on a STM32F407 discovery board and a base board for the Ethernet 
communication. The discovery board is very cheap although the base board cost a 
little bit more. For development i use openocd, Eclipse, binutils and gcc which 
are freely available. It is rather simple to exchange the real motor to a 
software motor during protocol testing by integrating pwm signal once or twice 
possible with some scaling and send it back into the encoder value.

There is no problem to add pid or cascaded pid on the stm32 and a reasonably 
well tuned current control loop usually required to keep the current within 
what the transistors can tolerate. The hostmot stuff is a little bit 
complicated but driver in linuxcnc is ready to use. The protocol with a pwm 
value to control the motor current or speed and an encoder value sent back will 
work for an arbitrary motor and angle sensor.

I also plan to change protocol but this is left as an improvement then machines 
I have are up and running. I would suggest to investigate the standard 
industrial protocols available before you start a new protocol.


Nicklas Karlsson

--
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Emc-developers Digest, Vol 114, Issue 13 (Ethernet, STM32F407)

2015-10-13 Thread Rene Hopf

> 
> I use the STM32F407 with the hostmot2 driver. I had some glitches at startup 
> but today I added a small delay someone here suggested end then startup works 
> perfect every time with two cards connected.
> 
> I have been running two axes with DC servo motors and ordinary encoders on 
> one of the cards although both cards should be used to get 4 axis. I ran 
> servo loop at 1kHz but expect somewhat faster will also work.

Hi, currently I am working on a similar project involving a ethernet based 
board to control my own servo drives: https://github.com/rene-dev/stmbl
Is anyone of you willing to share some code? I already started implementing a 
server for the hm2_eth protocol, but maybe we can work together?
my idea is to use rs485 to control the drives, as it is much better than 
step/direction.
the stmbl hardware also supports smart serial, but there is a lot of software 
to do.
is there any smartserial client code available?

Rene
--
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Emc-developers Digest, Vol 114, Issue 13 (Ethernet, STM32F407)

2015-10-13 Thread Peter C. Wallace
On Tue, 13 Oct 2015, Rene Hopf wrote:

> Date: Tue, 13 Oct 2015 15:49:59 +0200
> From: Rene Hopf <reneh...@mac.com>
> Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
> To: EMC developers <emc-developers@lists.sourceforge.net>,
> Karlsson & Wang <nicklas.karls...@karlssonwang.se>
> Subject: Re: [Emc-developers] Emc-developers Digest, Vol 114,
> Issue 13 (Ethernet, STM32F407)
> 
>
>>
>> I use the STM32F407 with the hostmot2 driver. I had some glitches at startup 
>> but today I added a small delay someone here suggested end then startup 
>> works perfect every time with two cards connected.
>>
>> I have been running two axes with DC servo motors and ordinary encoders on 
>> one of the cards although both cards should be used to get 4 axis. I ran 
>> servo loop at 1kHz but expect somewhat faster will also work.
>
> Hi, currently I am working on a similar project involving a ethernet based 
> board to control my own servo drives: https://github.com/rene-dev/stmbl
> Is anyone of you willing to share some code? I already started implementing a 
> server for the hm2_eth protocol, but maybe we can work together?
> my idea is to use rs485 to control the drives, as it is much better than 
> step/direction.
> the stmbl hardware also supports smart serial, but there is a lot of software 
> to do.
> is there any smartserial client code available?
>
> Rene
> --


Well... sort of

One of the 7I90 firmware options is to run as a simple (72 DIO) sserial remote

The processor code for the remote is part of the hostmot2 firmware source
(in ssremote.zip)

Its written in a quite obscure assy language. but _might_ be somewhat 
comprehensible if combined with the sserial protocol description thats in the 
back of all sserial remote manuals




> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>

Peter Wallace
Mesa Electronics

--
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Emc-developers Digest, Vol 114, Issue 13 (Ethernet, STM32F407)

2015-10-12 Thread Karlsson & Wang
> > Date: Mon, 12 Oct 2015 22:55:03 +0300
> > From: Pekka Roivainen 
> > Reply-To: EMC developers 
> > To: emc-developers@lists.sourceforge.net
> > Subject: [Emc-developers] Timing of realtime functions in uspace
> > 
> > Hello!
> >
> > I'm building an ethernet based IO board to be used with LinuxCNC. I
> > wrote a short webpage about my project on www.pekka.eu/cnc
> >
> > Everything is working quite well, except for the write and read
> > operations being too slow. I have two functions exported to HAL, read
> > and write. The .time pin which is automatically exported to HAL for each
> > function states that the execution time of the read and write functions
> > are about 45ns and 4ns respectively. For debugging, I generated
> > my own pins for both functions to measure the execution time of the
> > function itself. I measure the execution time by calling
> > rtapi_get_time() in the very beginning of the function and in the end. I
> > calculate the difference and pass it to a HAL pin. By examining the
> > values of these pins, I see that the execution times according to
> > rtapi_get_time() are about 22ns and 18000ns for read and write. So
> > it seems that the execution time stated by HAL is a bit more than double
> > the execution time of the function itself. The 220us execution time for
> > the read would be something that I'd expect from my hardware, but when
> > it's doubled it starts to be too much for running servo thread with 1kHz.
> >
> > Is this expected behavior? It sounds a bit strange to me, especially as
> > the ratio between the two measurements is quite close to two. I have
> > checked like million times that I don't have the functions added to the
> > treads twice or something other stupid things, but I cannot seem to find
> > anything like that. Does anyone have any hints?
> >
> > I have tested my software with Debian Wheezy, kernel 3.2.0-4-rt-686-pae
> > and with LinuxCNC versions 2.7.0~pre6 and 2.7.0.
> >
> > Thank you for any comments.
> >
> > Regards,
> > Pekka Roivainen

I use the STM32F407 with the hostmot2 driver. I had some glitches at startup 
but today I added a small delay someone here suggested end then startup works 
perfect every time with two cards connected.

I have been running two axes with DC servo motors and ordinary encoders on one 
of the cards although both cards should be used to get 4 axis. I ran servo loop 
at 1kHz but expect somewhat faster will also work.

Nicklas Karlsson

--
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers