Using Flowol 4

I’m looking for help using Flowol 4 to program the Vex IQ Clawbot. Any help finding resources would be greatly appreciated.

Our teams have used Flowol. What did you need help with?

I am learning and teaching as I go. I’m doing okay with outputs such as Motors and the touch LED but I don’t know how to incorporate the Gyro, Color Sensor, Push Button and Distance Sensors?

You might want to start with Flowol by doing the ‘Mimics’. If you haven’t done any coding with the sensors before, then understanding how to use the sensors for the first time is a small challenge itself, no matter what programming language you use. If you have already done the Mimics then it will be easier for you to separate sensor issues from Flowol issues.

When using sensors, first you need to add them to your program in Flowol. You add them from the panel on the right where the motors and ports are listed. There is a way for Flowol to automatically obtain the list of sensors and motors from the robot brain. Input from the sensors is normally used in a Decision box, but you might also use them in a Let or in an Output (to set the value of something else).

Below is a link (I tried to attach it, but I keep getting an ‘Invalid File’ error) to a sample Flowol program that uses input from Touch LED sensors to select a subroutine and set the color of the LEDs. To use it you will need to have two Touch LEDs attached to the brain on ports 1 and 9. Once you have the program running you can press the LED on port 1 to change its color from Green, to Red, to Blue, and back to Green. Note that the program also has three subroutines stubbed out (Green, Red, Blue). Pressing LED9 will start the corresponding subroutine. For instance, if LED1 is Green, then pressing LED9 will launch the Green subroutine. Try adding motors to this sample. Have the Green subroutine go forward, and Red go in reverse.

Hope this helps, and let me know if there is anything else I can do.

Jerry

https://drive.google.com/file/d/0B4XllU8ff1-8ZXlWX3gtT3JIOEE/view?usp=sharing

Thanks for the file Jerry. Okay So, I understand the Touch LED and the Distance Sensor but not quite understanding the Gyro. Can you explain how to use this sensor?

Before getting into the details of the gyro, here are some general alerts: 1. The gyro is a little bit tricky and there have been some hardware issues that you need to watch out for. 2. Although the gyro is interesting and fun to experiment with, in practice there are usually simpler and more reliable alternatives for autonomous programming.
Getting started with the gyro:
First make sure your gyro sensor is mounted on the robot properly. The top of the sensor must be facing up, and the side with the connector pegs must face down. Do not mount it on any part of the robot that moves, like a lift.

When the Flowol program starts running it will initialize the gyro, and the way that the robot is facing during initialization becomes the home or 0 position. If you turn the robot to the right the gyro will have a negative value measured in degrees. Turn to the left and you get a positive number. So -90 is a 90 degree turn to the right, and +90 is a 90 degree turn to the left.

Note that after you make a turn the gyro is not reset, its current value is always relative to it’s starting position. So let’s say you wanted to turn 45 degrees to the left, go forward, and then turn 45 degrees to the left again. A common mistake would be checking that the gyro is at 45 for the first turn (correct), and then again checking for 45 for the second turn (incorrect). Instead you should be checking for 90 on the second turn.

Another common pitfall is to look for a specific value, like stop turning when gyro = 90. What will happen is that the value will be 89.9 at one instant and then jump to 90.1 in the next instant, and never actually get a reading of exactly 90, so it will keep turning in circles. To prevent this always test with >= or <= (gyro >= 90).

Overshooting your intended target angle is another common issue with using a gyro, and turning in general, especially if you are turning fast and are using omni-wheels. You might have code that stops your turn when gyro >= 90, but the robot actually makes a 100 degree turn. Inertia moves it an extra 10 degrees after you tell it to stop. The simple remedy is to stop before your intended target, for example >= 80 so that you actually get 90. The real variance will depend on how fast you are turning and your robot design.

Making a 180 degree turn is also complicated. I won’t get into too much detail, but to understand the problem think about what would happen if you were slowly turning clockwise and monitoring the gyro reading: -177, -178, -179… What are the next two numbers?

One last word of advice: when learning to code with a gyro, start by taking your turns slowly. Set the power of the drive motors to 50% or 25% when turning. After you gain confidence then try turning faster.

Disclaimer details:
As I mentioned there have been some hardware issues with the gyro sensor. Gyro sensors seem to randomly lose their internal firmware, or in some cases just stop working suddenly. When this happens you will get an error on the brain saying something like “bad motor or sensor on port 7”. In most cases you can run the firmware update tool to get the gyro working again. Check for other postings on the Vex IQ forums for details on this issue and how to recover.

Using the motor encoders is a simple alternative for making the robot turn. Instead of setting the motor speed, you set number ‘ticks’ that you want to motor to turn. 360 ticks =1 turn of the motor (or shaft connected to the motor). Note that the number of ticks it takes to turn your robot depends on your drivetrain design, including the size of the wheels, the gear ratio, etc. It is possible to use math to figure out how many ticks you need to make a 90 degree turn, but you can also experiment with different numbers until you find the right value.

Not turning is another alternative to using a gyro, seriously. Check out this robot:
http://www.bttoronto.ca/videos/4157988358001/
It picks up and stacks all those blocks without making any turns. It does go sideways, but it never actually turns. If you are not turning, then you don’t need a gyro.

The attached program has subroutines for using the gyro to turn 90 degrees to the left or right. It also turns slightly as it is moving forward by using the motor encoders (see blue sub, “Move to tower” step).
https://drive.google.com/file/d/0ByvBvfWpUFx-TDZKSEY4Zkd6dVU/view?usp=sharing

Hope that helps without being too overwhelming.

Jerry

I’m also looking for help using FLOWOL 4, should I start a new thread?

Here’s the issue:

I’m using 3 old laptops and have FLOWOL 4 installed, as well as vex iq firmware update.

laptop 1: robot connects to firmware update AND FLOWOL 4
laptop 2: robot connects to firmware update but won’t connect to FLOWOL 4
laptop 3: robot won’t connect to anything.

Any help would be greatly appreciated here or via e-mail: desrochers_s@surreyschools.ca

Hello Risky Teacher,

“Old laptop”… Hmmm… That is risky…
It has been a while since I’ve been involved with any Flowol installs. However, we did have a problem with a USB driver not being with installing Flowol. I remember that installing RobotC inadvertently fixed the Flowol issue, because it installed the needed driver. I would think that installing the firmware update utility would also install the USB driver, and you’ve done that.

Consistently connecting and downloading via USB is one of the most frustrating things with this platform. Right now you are having trouble getting connected for the first time, but even after you get past that problem, the issue won’t be permanently solved. The issue is not unique to Flowol either. RobotC, ModKit, and Blockly/Python all have similar problems. There are probably other threads in this forum covering USB connectivity in general.

Here are some things that you could try to get connected:

  1. Make sure the USB cable is plugged in good on both ends
  2. Restart the brain
  3. Unplug the USB cable on both ends and then plug it back in
  4. Switch to a different USB port on your computer
  5. Try a different USB cable. Old USB cables get loose and have trouble staying in, especially on the robot side
  6. Restart the programming software (Flowol)
  7. Restart the computer
  8. Go for a short walk and then try again
  9. Go for a longer walk…

I have had better experience with newer more powerful machines. Not just connecting, but also download times. I’ve had better luck with Macs than PCs too, but that might have been because they were newer. None of the programming packages are resource intensive, so you would think that any old laptop would work, and they do, except for the whole USB thing.

For FLOWOL, Blockly, and Python questions, you can also email Robot Mesh directly at sales@robotmesh.com.