Recent

Author Topic: DATA  (Read 3686 times)

jb007

  • Full Member
  • ***
  • Posts: 145
DATA
« on: June 24, 2019, 03:43:12 pm »
Hi,

 had this 16 channel servo controller, it's controlled by RS232.

9600, 8data bits, none parity, 1 stopbit, no flowcontrol.


The software with it is verry limited, just 1 servo at once.
By the slides or a command.

I managed to intersept the data from pc to the pcb by using a logic analyzer.
Played around and understand the code.

Somehow I dont's see the clue to get it in lazarus in the right way.
Tried different things...

Any one a hint?








to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #1 on: June 24, 2019, 03:44:35 pm »
software
to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #2 on: June 24, 2019, 03:44:58 pm »
from logic analyzer
to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #3 on: June 24, 2019, 03:45:23 pm »
how to in Lazarus?
to DIY or not to DIY

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: DATA
« Reply #4 on: June 24, 2019, 03:55:32 pm »
Maybe your problem is not on software but hardware?

What device do you using? Is there any document on internet?

Sometimes the Rs232 pinouts can be "pin to pin" on your device.

I used before some modbus devices with lazserial and serbod's "DataPort" package.
Both of them is working.

But also I didn't notice your "received event" or "serial.ReadDate".

« Last Edit: June 24, 2019, 04:04:37 pm by tr_escape »

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: DATA
« Reply #5 on: June 24, 2019, 04:54:16 pm »
If you have two RS-232 ports on your PC, you can connect those in between and just relay (and log!) the data. Store a timestamp, or count the pulses. That makes it easy to analyze and steer.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: DATA
« Reply #6 on: June 24, 2019, 05:32:18 pm »
how to in Lazarus?
First is bad, should not even compile, and #02 is actually a byte with decimal value of 2.
Second is missing exclamation mark "!" at the end of the string.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: DATA
« Reply #7 on: June 24, 2019, 05:45:39 pm »
If you are talking about this device:
https://www.gearbest.com/development-boards/pp_62994.html

then it seams I was right and you were missing an exclamation mark at the end of the string. According to https://github.com/avtehnik/rpi-lcsc-16-servo/blob/master/server.py, you should send something like '#01P2500!'.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #8 on: June 24, 2019, 08:33:44 pm »




Hi,

Thanks, I understand.


I should have place the code here, what DID compile, sorry for that...
( while I was coding, I made a screenshot for here )

Let's make a new start! :D

First of all, the servo-pcb is working. Using the software delivered by the pcb, one can control a servo,just 1 at a time.
By using the slides or by a command followed by pressing button "Test".


When sending a command from the software:

Like #12P0034! or #05P1234!

what makes servo 12 go to position 0034 ande servo 05 go to position 1234.

This works fine!


I intercepted some comands by a logic-analyzer, as you can see in picture below.
The logic analyzer shows what had been send in terms of e.g. 0x23


Now, I want to send this with Lazarus.
Got al the com setting the same as in the software delivered by the pcb.

After watching some commands with their results in the logic-analyzer, it's clear to me how the command is being transmitted, see picture.

But, ( off caurse  ;)  ) now I'm writing this I understand I have to connect the logic analyzer again so I can see what Lazarus is sending ( or not ).

In my tests I allready had only 1 program at once using the comport ( com3 in my case ), so there's no issue between lazarus or the software delivered by pcb.


 















to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #9 on: June 24, 2019, 09:17:47 pm »
Nice, this makes sence...

Somehow, in the first place I was confused by the way the data was shown in the logic analyzer... %)

to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #10 on: June 24, 2019, 09:26:34 pm »
It works!

I purchasd this pcb for my RC truck.

( I allmost designed a servo pcb myself using an arduino, but it's ok now! )

Thanks for your time.



OFF TOPIC:


Recently I finished my prototype 3D-fpv camera.
There's no Lazarus involved but it has a microcontroller and MikroPascal.
The basic idea of htis 3D-fpv comes from internet, but I worked from bottom up myself bouth hardware and software.


Here you can see it:
https://www.dronetrest.com/t/some-introduction/6706

Meanwhile, I'm working on V2.0...


Kind regards!


to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #11 on: June 24, 2019, 09:32:48 pm »
OFF TOPIC nr2:


Building RC truck, flatbedloader, excavator and DIY transmitter/receiver-setup.

For those interrested:
( sorry , these projects I have only at Dutch forums, but one can watch pictures and videos );


Truck:
(  flatbedloader not started )
https://www.modelbouwforum.nl/threads/bouwverslag-5-assige-trekker-met-dieplader.263256/


Excavator:
https://www.modelbouwforum.nl/threads/project-elektro-hydraulische-cylinders-graafmachine-huina-1550-ombouwen.261643/



Transmitter/receiver:
https://www.modelbouwforum.nl/threads/bi-directioneel-rc-control-zelfbouw-verslag.263922/






to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #12 on: June 24, 2019, 09:40:33 pm »
Some extra info!
I purchased this pcb 'çause it got RS232.
There are lots of servo pcb's based on I2C, but I don't manage that to work on Aruino by using bit-banging...

Have a nice evening!
to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #13 on: June 25, 2019, 10:29:38 am »
Last but not least...

Now, I do understand my misinterpretation of the data e.g, 0x32 

"What is that '3' doing next to the '2'?

It was just ASCII... :D

An not some special constructed code by the software!

Have a nice day



to DIY or not to DIY

jb007

  • Full Member
  • ***
  • Posts: 145
Re: DATA
« Reply #14 on: June 30, 2019, 10:16:00 pm »
So excited!

Jumped into schematic/pcb-design.

This opens new doors!

So far, so good! This toppic is done...


to DIY or not to DIY

 

TinyPortal © 2005-2018