can post project if needed

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

can post project if needed

Postby alex31 » Sat Oct 06, 2012 2:21 pm

I have done an interface board for pedagogic purpose for curses about PLC

the project i have done is an interface card based on olimex p407 wich permit the plc to pilot
a lynx robotic arm http://www.lynxmotion.com/c-124-al5a.aspx from
a modicon PLC

on output i have 5 pwm
on input i can choose between 5 modes :

* console based ui over serial usb, i use a slightly modified version of microrl
* PLC : logical level (5 for action, 5 for direction)
* PLC : analog level (5 for absolute position)
* PLC : modbus over serial, RTU or ascii (using freemodbus library)
* PLC : modbus over tco, RTU or ascii (using freemodbus library and lwip)

I store permanent state in flash using the last 128ko of eeprom with a mechanism to
reduce wear.

debug message and log are printed on the lcd 6610 screen, in bit banging mode, (this screen use 9 bit spi) in the future, i will
use a olimex E407 instead of P407, so i will connect the screen to an usart configured in synchronous 9 bit mode to use it as spi and
avoid bit banging.

i use chibios hal for all peripheral access,
i use fpu, ccm ram as heap for malloc/free, rtc (saved by battery), gpt, adc, uart, serial over usb, pwm, time
compile with the linaro gcc recommanded toolchain

in fact, nothing new, i have used example form chibios as inspiration, and a lot of open source code found on the net, but it's a working project, so if
someone things it can help, i will put the tar.gz somewhere.

thanks again to the chibios team to give us a so well designed piece of code :-)

Alexandre

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: can post project if needed

Postby Giovanni » Sun Oct 07, 2012 11:45 am

Very interesting, sure go ahead and post code, more examples would not hurt for sure.

If you want I can move the thread in the User Projects forum.

Giovanni

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: can post project if needed

Postby alex31 » Sun Oct 07, 2012 9:50 pm

Very interesting, sure go ahead and post code, more examples would not hurt for sure.

If you want I can move the thread in the User Projects forum


Well, when it will be finished, on final hardware, documented, it could be put in User Projects forum,
for now, let's consider that it is a collection of sample.

there is only Makefile for forum recommended linaro gcc 4.6.2, i have not tested that
it compiles under windows since i am a pre-windows old unix guy.



https://docs.google.com/open?id=0B3a7E0ODHTNHQkdzSi1fQjJnVEU

Alexandre

User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: can post project if needed

Postby DeusExMachina » Thu Apr 04, 2013 6:06 am

Very interesting project for me! Do you finished it?

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: can post project if needed

Postby alex31 » Thu Apr 04, 2013 4:26 pm

Very interesting project for me! Do you finished it?


it has evolved, now it runs over an olimex e407 instead of p407, i am using 4dsystem oled screen instead of nokia 6610,
the robotic arm has been modified so i will have access to the real servo position to make position control,
and current consumption can be monitored to protect servo motor, but i am waiting for
a team which design the interface card with the Programmable Logic Controller, and interface card with the robotic arm to test and to write the code for servo control.

jbus/rtu and bus/ascii ober rs485 has been tested ok with an old april 5000 plc, jbus/ip hab been tested ok using modpoll on a pc.

i can send you the last tarball if you want, and system should be finished by this summer.

Alexandre

chrismerck
Posts: 21
Joined: Fri Mar 14, 2014 12:35 am
Been thanked: 4 times

Re: can post project if needed

Postby chrismerck » Sat Jul 12, 2014 4:03 pm

Hi Alexandre,

Great work! I'm also working on a ChibiOS FreeModbus slave project.

One question: Why did you not use "chSysLock" and "chSysUnlock" in vMVPortEnter/ExitCritical() ? Instead you seem to have bypassed the locking.

Best,
Chris

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: can post project if needed

Postby alex31 » Sat Jan 24, 2015 1:04 pm

I have miss this post, sorry.

To answer the question, the problem is that in freemodbus code, ENTER_CRITICAL_SECTION can be
call within a critical section, and that to be fine, a counting semaphore would be necessary to

1/ not call chSysLock twice (or more)
2/ exit lock zone at the last EXIT_CRITICAL_SECTION

it seems that none of the work done inside freemodbus CRITICAL_SECTION really involve that is should be done
inside a chibios syslock zone since i have never had hangs.

for now, this project is again in standby because of shortage on a component we have chosen for 24volts plc logic
(i2c half bridge), when we will have receive components, solder the last (v3) pcb, and gives curses on plc with students to
track last bugs, i move the code and gerber files from internal git server to github.

Alexandre

User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Location: California
Has thanked: 7 times
Been thanked: 1 time

Re: can post project if needed

Postby Chudik » Wed Jan 28, 2015 3:17 am

modbus over serial, RTU or ascii (using freemodbus library)


Very interesting!!!
Does it have both master and slave parts?

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: can post project if needed

Postby alex31 » Wed Jan 28, 2015 10:18 am

No, there is only slave part. The PLC is the master, the stm32+chibios stuff is the slave.

Alexandre

User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Location: California
Has thanked: 7 times
Been thanked: 1 time

Re: can post project if needed

Postby Chudik » Fri Jan 30, 2015 6:31 am

Hmm, my current project is slave and master simultaneously, but at least I can use the slave part first. So, thanks anyway :)

Are there plans to make master part?

Igor


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 18 guests