Position PID labview

Questions about using encoders with the Roboclaw product line
jellestappers
Posts: 9
Joined: Mon Jun 26, 2017 10:27 am
Position PID labview

Post by jellestappers »

Hello,

I have 2 2*15A roboclaw motordrivers for my robot.
I plan to use them with labview, but i can't seem to get the position PID settings configured via labview.
The velocity PID works fine, but the Position PID doesn't get uploaded into the roboclaw.
i have attached my program in labview so far.
Its a state machine, and the PID settings get configured in the init state, and inside the forloop state 1 and 2 are for velocity and work fine, state 3 and 4 are for position and wont work properly.
Anybody have experience with such problem?

Thanks in advance.

Greetings,
Jelle Stappers :D
Attachments
CFTrobot labview.rar
(34.72 KiB) Downloaded 422 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Position PID labview

Post by Basicmicro Support »

We recommend to always set your settings(including all the PID settings) using Ion Studio and save the settings to the board. Then there will be no need to set them using packet serial commands.

The only case where you should need to set the PID settings is if you want to change them on the fly. Is that the case here?

If that is the case we will need you to convert your VI to one compatible with LabView 2015 and resend it. We cant open your VI because it is newer than our current version of LabView.
jellestappers
Posts: 9
Joined: Mon Jun 26, 2017 10:27 am
Re: Position PID labview

Post by jellestappers »

Hello Acidtech,

Thanks for your reply.
It's at this time not a neccesarry to set PID on the fly, but for some reason my drivers wont save the values that i set with IonStudio. i set them, i click on disconnect, and when the power goes off the drivers everything is lost again. im not planning to keep power on my robot, i want to home the axis everytime i start the robot.
This is also the reason why i want to set the PID on startup, because it doesnt remember them for some reason.
Maybe i do something wrong with uploading the settings?
jellestappers
Posts: 9
Joined: Mon Jun 26, 2017 10:27 am
Re: Position PID labview

Post by jellestappers »

i found where to save the settings on the board.
its under device in the top menu
Stupid to miss that :?
so for now i got everything i need
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Position PID labview

Post by Basicmicro Support »

Let me know if you need anything else. If you can convert your VI into the older versions(2015) I can probably look at it then.
jellestappers
Posts: 9
Joined: Mon Jun 26, 2017 10:27 am
Re: Position PID labview

Post by jellestappers »

Hello,

Here is a converted file to labview 2015. i hope it works, i compressed it into a winrar.
I am issueing another situation.
For some reason the roboclaw drivers dont have an unique id.
normally this isnt a problem, but since i run 2 roboclaw drivers over usb it takes the one which is plugged in first as the lowest the comport and the other one is the higher comport.
this is a problem with labview, since i define on which comport which contoller is.
luckily the roboclaw has an adress, and i set both adresses different so it will never control the wrong roboclaw.
but basically this means if it switches the comports then the robot wont work at all, and you got no clue what is going on. since this is only a small part of a bigger system i need it to work properly, and i cant go to it everytime to plug in the usb ports in the right order.....

another thing, i did send a ticket about autotuning a few weeks back, and i got as response i should give a call when im ready to tune my drivers.
well im ready now, but calling you would result in a huge bill :(.

Greetings,
Jelle Stappers :D
Attachments
labview.rar
(67.42 KiB) Downloaded 399 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Position PID labview

Post by Basicmicro Support »

The simplest option is to change the Packet Serial address of one of the Roboclaws(not commands sent will have to use the correct address now). Then you will know which is which by reading the address back before you start. Similarly thouhg more of a hack is you can set the baud rate settings differently leaving the addresses at default(simplifies detecting the units on power up). The baudrate is ignored when using USB comminications. USB is always as fast as it can go.

There are other options as well though may not be an option through LabView. If you are on a Windows machine you can use SetupDi commands to find out what physical USB port a device is plugged into(down to the port number on a hub if you are using a hub). On Linux I know there are similar things that can be done as well.

I'll try to look at your VI this weekend.

If you cant call, I recommend setting up Skype(if you dont have it already) and sending me your Skype name and a good time when you can work on it(preferably sometime between 9am and 9pm PST :) ). I'll add you as a contact and we can work on it through Skype so no per minute charges then.
jellestappers
Posts: 9
Joined: Mon Jun 26, 2017 10:27 am
Re: Position PID labview

Post by jellestappers »

Thanks for the reaction Acidtech,

that solution sounds usable indeed, i could request the adress, check if it matches, if not, it should try the other comport number and do the check again :D, and then it works, that sounds the best solution so i can move the labview program.

I hope i get some time next week to give a call.

Greetings,
Jelle Stappers
jellestappers
Posts: 9
Joined: Mon Jun 26, 2017 10:27 am
Re: Position PID labview

Post by jellestappers »

Hello AcidTech,

Im sorry for my very late reaction.
The robot is a side project between my jobs, but i finally found time to try what you said.
I can't seem to find the option in the roboclaw library in labview to request the adress of the driver.
i got driver 1 with adress 129
and driver 2 with adress 130
problem is if the comports get swapped, then i can't notice this and the robot wont react at all (wich is actually better then moving with the wrong axis).

Greetings,
Jelle Stappers
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Position PID labview

Post by Basicmicro Support »

Packet Serial address is set as part of several other options. Use the See commands 98 and 99 in the Roboclaw Users Manual. I believe the Labview VIs are called GetConfig and SetConfig but I dont have them in front of me at the moment.

You need to look at the appropirate bits in the config word returned byt he Labview VI to determine what address is set for that Roboclaw.

Post Reply