Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: lynxmotion ssc-32 servo controller

  1. #1

    Talking lynxmotion ssc-32 servo controller

    Hello!
    Taking a stab at setting up girder (noob) to control a Lynxmotion ssc-32 servo controller.

    Heres what works:
    Dedicated lynxmotion sequencer software. I am able to control the servors as expected so I know everything is setup right.

    So I load a serial port monitor to capture the commands the sequencer sends to the DB9 port and controller.

    For example:
    If I want to move servo 1 to a certain position, the command would be #1P1600T100 Which means: #1 is servo 1 P = position of servo gears and T = time 1000 being a second.

    Here is the exact port capture of a 2 step command to set the servo positions:

    IRP_MJ_WRITE DOWN TRUE 0x0 23 30 50 31 34 30 31 23 31 50 32 32 34 36 54 31 30 30 30 0D #0P1401#1P2246T1000.
    IRP_MJ_WRITE UP TRUE 0x0 23 30 50 31 34 30 31 23 31 50 32 32 34 36 54 31 30 30 30 0D #0P1401#1P2246T1000.
    IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_WAIT_ON_MASK: Wait for event)UP TRUE 0x0 04 00 00 00 ....
    IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_WAIT_ON_MASK: Wait for event)DOWN FALSE 0x0
    IRP_MJ_WRITE DOWN TRUE 0x0 23 30 50 31 34 30 31 23 31 50 31 37 39 36 54 31 30 30 30 0D #0P1401#1P1796T1000.
    IRP_MJ_WRITE UP TRUE 0x0 23 30 50 31 34 30 31 23 31 50 31 37 39 36 54 31 30 30 30 0D #0P1401#1P1796T1000.
    IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_WAIT_ON_MASK: Wait for event)UP TRUE 0x0 04 00 00 00 ....
    IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_WAIT_ON_MASK: Wait for event)DOWN FALSE 0x0


    How do I generate a lua file and use that as a serial device in the plugin section and then add the serial send commands?

    Im sure Im missing some sort of info to help with the answer so please let me know what you need to know so I can know

  2. #2

    Default

    Got it for those that care. Here is the lua file in the serial plugins directory. Now onto Netremote to control the servos over the network.


    local Super = serial.Classes.Simple
    local device = Super:New({
    Name = "SSC32",
    GlobalName = "ssc-32",
    Description = "Lynxmotion SSC-32",

    LogLevel = false,-- change this to false when the device is working

    BaudRate = 115200,
    Parity = N,
    DataBits = 8,
    StopBits = 1,
    FlowControl = 'N',

    CallbackType = serial.CB_TERMINATED,
    ReceiveTerminator = '\r',

    SendStartByte = '',
    SendTerminator = '\r',
    IncompleteResponseTimeout = 100,
    NoResponseTimeout = 1000,

    Initialize = function(self)
    if Super.Initialize(self) then
    -- add your own initializations here
    self.Status = 'Initialized'
    return true
    end
    end,

    ReceiveResponse = function(self, data, code)
    if math.band(code, serial.RXCHAR) then
    -- add code here to process the data parameter
    end
    Super.ReceiveResponse(self, data, code) -- must call the parent's ReceiveResponse
    end,

    })

    serial.AddDevice(device)

  3. #3
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Actually, this line

    Code:
    if math.band(code, serial.RXCHAR) then
    should be

    Code:
    if math.band(code, serial.RXCHAR) > 0 then
    --Rob

  4. #4

    Default step motion

    ok kids Im learning....that I need to learn more

    I have netremote working fine now sending events to girder to control the servos position. However with the varied positions I assigned the arrow buttons in the CCF, I still do not have a way to control a smooth motion. Is there a generic slider function or a STEP command script? Again here is an example of servo positions:

    #0P1200T1200 = servo 0 is at a certain angle set at 1.2 seconds
    #0P1500T1200 = servo 0 is now 300 steps past 1200

    How would I assign a slider or step command in lua and netremote to control a constant input to change the steps smoothly?

    Thanks!

  5. #5

    Default

    Bump on the above....

    just wondering what lua code I would need to assign a static address to a servo (#0) then the Position command (P) then the location (number)

    I would need the #0P to remain the same and just the number value change.

    any thoughts?

  6. #6
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    what's the range of values that the position parameter can take? - I'd guess that it's from 0000 to 9999? Or is that not a fixed length field?

    Presumably the T parameter is the time it should take in ms?

    I'm not quite clear, do you have a working slider in NetRemote?
    --Rob

  7. #7

    Default

    I have the range set manually right now since the servos are running pan tilt on a camera.

    for example:

    home position for the panning servo is 1460 so to set that the serial command to the SSC-32 controller is #0P1460

    I am not worried about the time control, it can always stay static.

    to move it just a bit to the right would increase to 1470, so the command that has to be sent is #0P1470. To move left would decrease.

    its the same for all the other servos, the first 3 characters are static and the last 4 (or down to 3 in 4 cases) change. The range is from 880 to 1900.

    I have done a slider in netremote that sends something to girder, but I guess Im kinda lost on what to do on the girder side for variable code. I tried to set the variables in the slider thumb control range with the #0Pxxxx but it keeps crashing when I save. If I just put numbers in, I know that wont work and I still dont know how to make those numbers transfer to "serial send" since Im using a custom serial device plugin.

    I have netremote working fine with girder controlling the servos using a static event to action, but again Im not sure how or where to put the variable code in Girder action/events.

    thanks for helping the noob!

  8. #8
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Simplest thing will be to set the range of the slider from 880 to 1900

    When you adjust the slider you should see an event coming from NetRemote with the value of the slider in pld3

    First thing - in your serial device change the Global name to SSC32 - that's the name of the global variable that is created - you can't have a '-' in an identifier.

    So, create a scripting action that looks something like this :-

    Code:
    SSC32:Send(string.format('#0P%04dT1200', tonumber(pld3)))
    Save and close the action.

    In NetRemote drag the slider (I'd probably recommend setting it to only send on release) and then drag the event from the logger to the newly created action.

    Save the GML and try moving the slider and see whether it now works.
    --Rob

  9. #9

    Default

    ok here is where Ive gotten so far, and thanks for the continued help.

    I have a thumb slider in NR with a var of panC1

    this is the system lua code in NR designer ccf

    NetRemote.RegisterVariableWatch([[panC1]],NetRemote.GetPlugin('Girder'))

    in NR thumb properties the image var is blank, the VAR is panC1 and the range is the same as the above post

    when I move the slider (connected tcp to girder on another machine) I see the input coming which says: source: com server details panC1 and the time

    when I copy the log it just says

    TIME Date Source Details Payloads

    I dragged that over to the scripting action I made with your above code and in the lua console I get an error

    string "ssc32.gml:\SSC32\Scripting"]:1: attempt to call method `send' (a nil value)

    clueless...
    Last edited by theengine; January 31st, 2008 at 10:28 AM.

  10. #10
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Why are you copying the log? To post here?

    You need to select some lines in the log to copy it.

    You can't use copy/paste to add an event though, you have to drag it from the logger to the action in your GML
    --Rob

Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •