08-18-2023 01:43 AM
Guys, iv built an obstacle avoidance robot car, it's 4wd and uses an ultrasonic sensor for detection.
I am looking at putting control from labview onto it in the form of the linx toolkit. It will be wired for now with he view of making it wireless eventually.
I am struggling with the event structure wiring within a while loop, especially the toggle switch on my block diagram( Boolean TF) I'm using to switch between autonomous mode and manual control from labview.
I need 6 event structures in total, F for forward, B for Backward, L for left, R for right, S for stop, A for autonomous and M for manual.
Coud some one help me wire this, I'm only learning In labview and Linx I'm finding very difficult.
Any help appreciated.
Thank you
08-18-2023 07:33 AM
Are you using the LINX toolkit with Arduino or RaspberryPi? What have you tried so far? Can you post your code?
08-18-2023 08:08 AM
Hi I'm using arduino, il post the code when home! I have the arduino programmed and working perfectly that with serial monitor on the arduino it will do all the commands mentioned above F and B etc, I have the Auto manual command (A+M) toggling too! It's just the labview aspect that has me scratching my head
08-18-2023 08:10 AM
And yea, I'm trying to use the Linx toolkit but cannot find much help in terms of wiring it, especially event structures etc.
thanks
08-18-2023 01:22 PM
08-18-2023 03:44 PM - edited 08-18-2023 03:46 PM
What did you have in mind for your User Interface? Your Linx code uses single character strings for all the commands -- do you intend to "drive your car" by typing specific letters on a keyboard?
All of your commands are "binary" in nature -- "Go" (at max speed) or "Stop" (instantaneous 0 velocity). "Right" means "spin to the right by turning the left wheels forward at max speed and the right wheels backward at max speed" -- again, all or nothing, and car linear velocity goes from "whatever" (when driving straight ahead) to 0 (when turning) -- not good for the tires! How about a rotary control that "turns the front wheels" slightly?
Most of the time, your car is running along, "doing the same thing". Every so often, you change something on the Front Panel (what? a String input? a Boolean Button? a Numeric Dial?) to "give the car another command" (which it should do "instantaneously". Do you know about LabVIEW's Event Structures, which are used to "fire" LabVIEW code when a Front Panel Control is changed?
So it depends how you want to handle "Events". In the example of the Linx code you posted, when you get a command, you simply issue commands to motors (and other things). I notice that you often follow the command by a Delay(), which suggests that a "time parameter" might be "designed" (by you) into your command structure.
LabVIEW, with its "interactive Front Panel" for simulating "real controls" (such as a rotary "Steering Wheel", a linear "Accelerator" and "Brake", and modeling Actuators (motors attached to wheels, possibly actuators to "turn the front wheels up to ±30°". You can also write little sub-VIs with names like "Accelerate" (which gradually increases the speed that the wheels turn) or "Turn" (which takes an angle for the turn). Encapsulating the "messy details" in a sub-VI, particularly if you design it with an icon that says (or "shows", by means of an image) what the VI does, makes it possible to fit an entire Control Program for your car on a single Laptop Screen (of course, it will have multiple "layers", like a State Machine ...).
Bob Schor