Shop OBEX P1 Docs P2 Docs Learn Events
48 bits input, at 50 Hz ? — Parallax Forums

48 bits input, at 50 Hz ?

t2nt2nt2nt2n Posts: 21
edited 2007-10-19 15:00 in Propeller 1
Hi,
I want to know if a propeller can manage this kind of signal :
http://www.shumatech.com/support/chinese_scales.htm

so a 48 bits one, sent 50 per s.

With some masks, I surely could separate the 48 bits wih 2x24 bits datas, to recover the datas of position

It should be nice if I could manage this kind of datas, with 14 different input of them, and keep free 14 others I/O, to drive DC motors .

Tx a lot for all infos and help.
«1

Comments

  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-17 13:47
    Yes you could do this easily. Something I had considered myself for a cheap DRO.

    Graham
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-17 13:49
    The interface is well described in the link you gave!
    It is serial data @80kHz.

    This is too high for a spin driver, but no problem for machine code. I think you can sample 10 of those devices in one COG, most likely all 14...
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-17 14:04
    Impossible in Spin, no problem in assembler. Only 12µs left for sampling and shifting the data.

    Another description of that Sylvac-protocol is on my home-page (see signature).


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-17 14:14
    Tx a lo for your reply, and very quick replies.

    I had in view to use one COG, only to get 2 of each datas, and to manage in the same time the pwm signal to drive one DC motor (with PID control), and eventually, to send some parameters to others COGs, to modify the driving of others DC motors.

    But what you say with a too low spin code is not a good news, for me cry.gif

    I will check what is the minimal cycle time, to work with spin code.
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-17 14:19
    > I will check what is the minimal cycle time, to work with spin code.

    Forget it! In Spin, you couldn't even generate the signal. BTDT


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-17 14:29
    I'm afraid that these scales do not update often enough for servo control, unless you are looking for very slow control. Better to use quadrature encoders such as those sold in rotary and linear form by usdigital

    Graham
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 11:55
    Nick Mueller said...

    Forget it! In Spin, you couldn't even generate the signal. BTDT


    Nick

    Sorry, I don't see why a Spin code can't generate a pwm : a pwm is just some on/off signal. So why are yu saying that Spin can't generate such a signal ?
    Graham Stabler said...
    Better to use quadrature encoders such as those sold in rotary and linear form by usdigital

    Graham

    Better with using: perhaps yes, but not sure. I need more precision than speed.

    Better for my purse : perhaps yes but more surely not.
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-18 13:00
    We are not just talking slow, this is very slow you certainly won't need a D in your controller.

    To give you some idea the mylar encoder strip is $4.20 per inch if you want the highest resolution a head is typically less than $30

    The highest resolution strip they do it 500CPI which means 2000 after quadrature, this means a resolution of 0.0127mm
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-18 13:02
    > Sorry, I don't see why a Spin code can't generate a pwm

    Spin couldn't even generate the signal of the digital scales. I wasn't talking about PWM, but you. smile.gif


    From your PM:
    > Vas te faire enculer, sombre con.

    Oh, vous parlez Francais? Moi aussi!


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO

    Post Edited (Nick Mueller) : 10/18/2007 2:24:08 PM GMT
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 14:23
    Nick Mueller said...
    > Sorry, I don't see why a Spin code can't generate a pwm

    Spin couldn't even generate the signal of the digital scales. I wasn't talking about PWM, but you. smile.gif


    Nick

    Today, for sure not. I never heard about pwm 2 months ago. I am not talking about the Propeller and Spin, that i didn't know what it was 1 month ago.
    And that's one of the main reason why i come here : to ask questions and learn something. smurf.gif

    Yet, if you are selling something, I hope for you that business is doing well.
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-18 14:39
    t2nt2n,
    the *BEST* advice I can give to solve your *real* problems you is to stop sending offending PMs to me.
    Two are enough!


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 15:05
    Sorry to come back again Mr. Nick Mueller, but I don't know what means BTDT.
    English is not my native language, as you noticed.
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-18 15:12
    Been There Done That (he has tried in the past)

    English is my native language but I still used google to find out what it meant [noparse]:)[/noparse]
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-18 15:17
    t2nt2,

    You shouldn't play the fool! Here, in the public, do the nice guy and at the same time sending me yet another offending PM (now counting three).
    I sincerely ask you to stop sending me *ANY* PMs!

    Compris?


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 16:18
    Sorry to pollute the forum.
    I didn't tought to use google for the abbreviation.

    Big tx, M. Stabler.
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-18 17:37
    > Sorry to pollute the forum.

    You are a little bloody liar! In the meantime you have sent me a forth offending PM.
    Do us a favour and take your medication, go back to the kindergarden and most of all, STOP SENDING ME PMs!

    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 18:32
    Nick Mueller said...


    You are a little bloody liar! .... go back to the kindergarden ...
    Nick

    I don't understand why you are so offending.
    I was really sorry to disturb this forum with a dumbass question.
    But a good night, with a good and full sleep, and you surely 'll see the life with other eyes.

    Post Edited (t2nt2n) : 10/18/2007 6:38:28 PM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 18:45
    This kind of dialogue is rare in this forum. In fact I have never seen in before... Hope to not see it again..

    We rather use irony, sarcasm, and ... silence.
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-18 18:55
    > I don't understand why you are so offending.

    Oh, I'm sorry. I didn't tell you to stop sending me PMs. My fault!

    So you cretin have sent me a fifth PM that was no more intelligent then all the others before.
    *That's* what upsets me. Not your questions here in the public, but your cowardish offenses without *any* reason as PMs to me.

    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 19:40
    I took a (quick) look at the data sheet of the Prop.

    I found some infos about the max frequency (80MHz, the first examples of code published here are talking also about this frequency).

    Infos also about Spin code, math features, particularly.

    But I didn't found anything about the minimal frequency, working with Spin code.

    Can somebody say me what is the minimal frequency I can hope working with Spin ?
    Or the adress of the kindergarden where I can find it ?

    Tx in advance for your infos.
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-18 20:28
    Nick, as we have no way of seeing your PM's I suggest you keep your complaints about them to yourself or take them to the moderators who will be able to deal with them properly.

    If they have been sent I'm sure we will see no more of t2nt2n and we can all get back to business.

    Graham
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-18 20:40
    The datasheet and the Propeller Manual (which is also downloadable) are the major sources of information about Spin. The Propeller Manual has a section that describes all the expression operators that are available. If, by math features, you mean floating point math capability. That is done using an object (package of subroutines) that you can download from the Propeller Object Exchange. It comes with good documentation including estimates of execution time for the various routines.

    There is no minimal frequency for the use of Spin. Obviously, the speed of anything you write in Spin depends directly on the system clock frequency, but you can write code that works perfectly well using the RCSLOW clock (approximately 32KHz) as well as with a 5MHz crystal multiplied to 80MHz using the PLL. Some I/O drivers will not work at slow speeds, like the video drivers or the Servo32 driver, but you can write a driver that adjusts its timing for different clock frequencies. Have a look at the CLKFREQ function for some examples.
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 20:57
    I should guess t2nt2n wants to know (as he needs to smile.gif ) how fast SPIN instructions work worst case.
    The answer I gave the last 7 times was: Around 5 us for a very basic SPIN instruction, as a REAPEAT without any condition, or a OUTA~. More complex statements easily add up to 20 and 30 us....

    My personal experience - freely given - is that a comparable hand coded assembly program runs 80 times faster than a SPIN program. So if you have some idea about a not extremely clever tuned assembly program, you can make an educated guess how long SPIN would most likely take.
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 21:12
    Tx a lot for your quick reply.

    I did some (dumb ?) calculus, before posting, but a flow data of 48bits at 80kHz gives about 4 Mbits/s.
    So, the Spin code needs much more than 20 cycles, to get a flow data ?

    As deSilva said that I could manage at least 10 such devices with machine code, this code needs only 2 cycles, or less, to get such a flow data ?

    I am totally noob in robotics, as you can see. But as I read also that Spin was a compiled code, I could hope to avoid the machine code....a desperating hopless idea, I fear.
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 21:17
    And deSilva gives another reply, which confirms my fears.
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 21:32
    t2nt2n said...
    but a flow data of 48bits at 80kHz gives about 4 Mbits/s.
    No,that would be double billing smile.gif
    Its 80kHz = 12,5 us per each bit, and 48 come one after the other.

    But 12,5 us is too fast for SPIN...

    Serial communication with SPIN works upto 19,2 kbit/s = 50 us/bit which is around 5 SPIN instructions...
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-10-18 21:53
    (God bless deS, as he wades in where mere mortals fear to tread. Later the rest of us will likely suffer his ire once arised...)
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 21:58
    Please make that sticky!
  • t2nt2nt2nt2n Posts: 21
    edited 2007-10-18 22:09
    +1.

    As well as I can learn some tricks here in robotics, as well as I can improve (and in what a manner) my english in such a place hop.gif
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-18 22:53
    1) Your English is much better than my French and German.

    2) Propeller assembly language is not quite as terrible as some would have you believe.· deSilva and I know how dangerous it is to say that ... it undermines our guru status.

    3) The best way to use assembly language is to use it only when necessary ... for example, your high speed data acquisition.· Use Spin for everything else that doen't require either blindingly high speed or precise deterministic timing.· A good example is the FullDuplexSerial driver or the keyboard driver.· They're relatively small routines, most of the complex stuff is done in Spin.
    ·
Sign In or Register to comment.