# LabVIEW

cancel
Showing results for
Did you mean:

## Lego Mindstorms Cruise Control

Hi

I have a problem and I am going round in circles

I am trying to create a cruise control in labview for a lego mindstorms robot.

I have got as far as motor control and measuring rotations, however I have hit a wall

I need to work out The transfer function of The motor and then wire up a PID to compensate The power to maintain a steady speed.

1. I have no idea which PID controller to use in labview or how to wire it into my circuit - I have tried a few and I'm lost

2. The output taco is telling me The number of rotations per "second" wrong by a factor of 24 (yes I know odd number)

3. The seconds at ticking over at 24 times The actual rate of time (again odd)

4. I can calculate The speed of The motor but  I have no idea how to use this motor speed to calculate The "motor transform" its a new one on me tbh but its something like (1/0.3s)+1 but I'm not sure

5. I have no idea how to add a disturbance in The circuit or where I need to wire The feedback loop into.

All I want to achieve is a controller that will maintain a constant speed no matter The rise or fall of The road for 1 motor

any help would;d be greatly appreciated Thanks

Message 1 of 9
(3,858 Views)

## Re: Lego Mindstorms Cruise Control

Hello Labviewnooby

Thanks for your post. When looking at PID control the following white paper is a really good starting point if you've not seen it before.

http://www.ni.com/white-paper/6440/en

As to the reason you're speed is wrong by a factor of 24. How are you working this out, can you not just scale the answer down by 24?

Many thanks

Dan.H

National Instruments

Applications Engineer UK

Daniel Harryman MEng
CLA, CPI
Message 2 of 9
(3,824 Views)

## Re: Lego Mindstorms Cruise Control

Thanks for trying but I have read that before and it does not help and as I said I seem to be going around in circles

i have to find the transform function and put it in a PID....but i have no idea how to put the correct PID in to labview

I am currently trial and error every PID controller there is in the list and will hopefully eventually get there

I am literally trying every wire to every connection in order on each PID on the list ..but im not hopefull.

I know what i want it to do but how to do it in lab view i seem to be missing a trick somewhere along the line.

I also am having troubble reading the boxes (is there a Zoom function?)

Message 3 of 9
(3,796 Views)

## Re: Lego Mindstorms Cruise Control

It's never as easy as they make it look on TV, huh?  😉

Have you considered this:

LabVIEW Introduction Course - Three Hours

or this:

LabVIEW Introduction Course - Six Hours

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 9
(3,785 Views)

## Re: Lego Mindstorms Cruise Control

I hear you there brother...

Thus far I have cobbled together a PID controller (now I realized I needed to use Boolean math in the program) that was a kind of eureka moment..

I have to put a disturbance in to test it but I am out of time so it is what it is ...

I am OK in the theory of what I want to do ..But I shall have to have a long learning session on labview this summer me thinks... If I ever get time off work LOL.

Thanks boys for the assist and I shall re visit this later in the year ...

Message 5 of 9
(3,769 Views)

## Re: Lego Mindstorms Cruise Control

Good luck!  Please report back because these robotics things are always interesting projects.  🙂

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 9
(3,732 Views)

## Re: Lego Mindstorms Cruise Control

Hi

Sorry I was out of the office over Easter so have only seen your posts now. I hope your project went OK in the end. If you need anymore LabVIEW help or guides there are plenty of online resources we also offer courses you can take online or onsite details of these can be found here:

http://www.ni.com/training/

If not the forums are a great place to search for past and previous problems and solutions. Good luck with your learning with LabVIEW.

Many thanks

Dan.H

National Instruments

UK AE

Daniel Harryman MEng
CLA, CPI
Message 7 of 9
(3,716 Views)

## Re: Lego Mindstorms Cruise Control

i´m calculate the speed motor using a time loop but i dont know the period of Sampling time. if someone could help me

thanks.

Message 8 of 9
(3,459 Views)

## Re: Lego Mindstorms Cruise Control

i´m calculate the speed motor using a time loop but i dont know the period of Sampling time. if someone could help me

thanks.

If you have a question, you can better open a new topic instead of using an old one.

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
Message 9 of 9
(3,427 Views)