I'm trying to get a app C# to run the actuator

Hi everyone, I’m new to this stuff… I have downloaded the SDK information but every time I go to open it in VS it tells me it is not trusted… I have it located on my C drive to keep things simple. I would like to see this actuator move in and out…
I have been able to get the Jrk Configuration Utility to move it in/out but any of the apps within the SDK packet error out

At this point… The Smc.getConnectedDevices(); get me nothing back… Is all I can see at this point…

Can anyone lend me a hand or point me in the right direction please.

Thanks so much…

    Smc connectToDevice()
    {
        // Get a list of all connected devices of this type.
        List<DeviceListItem> connectedDevices = Smc.getConnectedDevices();

        foreach(DeviceListItem dli in connectedDevices)
        {
            // If you have multiple devices connected and want to select a particular
            // device by serial number, you could simply add a line like this:
            //   if (dli.serialNumber != "39FF-7406-3054-3036-4923-0743"){ continue; }

            Smc device = new Smc(dli); // Connect to the device.
            return device;             // Return the device.
        }
        throw new Exception("Could not find device.  Make sure it is plugged in to USB " +
            "and check your Device Manager (Windows) or run lsusb (Linux).");
    }

Hello.

You mentioned the jrk, but you are using the C# Smc class which is for the Simple Motor Controllers. The Simple Motor Controllers are different from the jrks. Which motor controller do you have?

–David

I have Pololu Jrk UBS Motor Control it is hooked up to part number LACT2P
and we can by using the Jrk Configuration Utility make the actuator move in and out…
I would like to be able to do the same thing with code. I want to have like preset positions. So say I hit a button the Actuator moves out an 1"… Sorry I’m new to this…

I wrote a created a serialport this morning and was able to make the green light on the control blink when I pushed a button… I have tried using some of the dll but I can’t get them to give me a list back…

I’m using this motor controller pololu.com/catalog/product/1394

Try using the Jrk class, and the example code for it, instead of the Smc class.

–David

David,
I just did that and the green light pulses on/off. So that should mean I’m connecting to the Controller right?
It comes up with Jrk Serial #00024270

3/23/2012 3:03:21 PM Connecting…
3/23/2012 3:03:21 PM Connected to #00024270.

When I check the “Activate motion sequence (input mode must be serial)” check box
The green light goes solid
and the Current target: 1500, 2000, 2500 then repeats…

So how do I make the Actuator move in and out with a couple of buttons?

Great, it sounds like you found JrkExample and successfully ran it. Did your actuator move while the program was running? If so, then all you need to do is remove the code for doing the motion sequence, add some buttons, and write code like this in their click handlers:

jrk.setTarget(1500);

I recommend looking at the source code of JrkExample and trying to understand how it works. Once you understand it, it will be easy to adapt it to do different things.

–David

No the actuator did not move :frowning:
So what am I doing wrong?

I’m not sure. You said earlier “I have been able to get the Jrk Configuration Utility to move it in/out”. Does that still work? If you close JrkExample, can you control the actuator from the jrk configuration utility using the “Manually set target” box?

How many jrks are connected to your computer?

–David

On the controller there is a red light… I just ran the Jrk Configuration Utility and the light is now orange… The Actuator is moving… but if I unplug the 12v battery and plug it back in the light becomes red again and the actuator will not move… So how do I turn on the light to orange…?

It sounds like your “No Power” error is set to “Enabled & Latched”. Try setting it to just “Enabled” and then the jrk should be able to automatically recover from the loss of power without you having to explicitly clear the errors. Be sure to click “Apply settings to device”. Whenever the red LED is on, it means there is an error and you can look in the jrk configuration utility to see what it is. The errors are described in the “Error Reporting Commands” of the jrk user’s guide.

–David

Dave,
How can I speed up the actuator? make it move quicker…
I have it all working and it’s awesome! Thanks a ton for the help… I’m going to look over all the code this evening in the Jrk project… So that I can make my own version…
We are going to use this to shift the transmission in a car. So it needs to be quick… Speed shifting quick…

Dave I just tried to
jrk.setTarget(1700);
jrk.setTarget(1800);
jrk.setTarget(1900);
jrk.setTarget(2000);

All running off buttons the actuator will not move…

I have one set at jrk.setTarget(1500); It comes all the way in…
and one set at jrk.setTarget(2500); and it goes all the way out…

How do I get it to stop at a certain point?

Please note, our products are not intended for applications like the one you are describing, where malfunction can cause injury or property damage. I suggest you only proceed if you take additional safety precautions to avoid harm caused by a jrk malfunction.

Did you wire the jrk exactly as shown on this page, and use the provided settings file?
pololu.com/catalog/product/2303

What is your Feedback Mode set to right now?

To make the actuator move quicker, you should first ensure that the jrk is actually driving it at a 100% duty cycle. You can do this by looking at the jrk’s graph window. If the jrk is driving the actuator at 100% then that is basically like connecting the power source directly to your actuator. The only way to make the actuator move faster would be to get a higher voltage power source.

–David

David,
The Feedback is set to none.
I have also uploaded the motor tab.


You’ll have to set the Feedback mode to “Analog” and hook up the linear actuator’s potentiometer if you want position control.

I recommend wiring the jrk exactly as shown on this page, and following the instructions there:
pololu.com/catalog/product/2303

–David

David we have it connected like this to the controller. Is that what your referring to?
Will I need to change my coding? to feed it another input?

So I need to purchase a potentiometer and feed the FB or the Blue wire the information through a potentiometer 0v is all the way in and 5v is all the way out… Is that correct? Do you have a pic of how to set the potentiometer in line with all this stuff? It so I could really use it… :slight_smile: I’m not really a hardware guy… LOL… just something simple will do… I know what a potentiometer does… varies the current…

Thanks for all your help on this… I’m sure this is not in your norm… LOL

Your idea of how the potentiometer functions is correct. I recommend just choosing a linear actuator that already has a potentiometer built in. Those are the ones that say “with Feedback” in the name. What actuator do you have right now? Are you sure it doesn’t have a potentiometer built into it? It seems like it would have to have a potentiometer if you hooked it up as the picture shows, because I’m pretty sure the ones without potentiometers only have 2 wires.

–David

We have LACT2P with the feedback… So it should have what we need…