You might have encountered that when using brushed motors, they can continue to run/rotate for too short or too long of a period. Most notably, this occurs when using the car controller to turn left or right. This is because the Motor Driver Block has timeout configuration periods for each event. You can check the value of the timeout period by going into the Properties Panel of the Motor Driver Block. Clicking on Custom Settings, and then scrolling down to the Power Timeout section.
By default, this should be 400ms, meaning that each event occurs for 400ms before stopping. To change this value, you can simply double click on the value and then input the desired timeout period you require.
You should see that there are four timeout periods, each corresponding to the four Motor Driver input positions (0-3). For instance, if you insert your brushed motors into position 2 and 1, the second and third timeout's will impact the timeout periods of these motors. This also means that you can have different timeout periods for different motors (this could be used as a way to steer).
One of the major drawbacks of longer timeout periods is that it makes it hard to steer with the Car Controller Virtual Block. In most cases, you will not have a physical steering system, but rather must rely on rotational imbalances to steer. For instances, when turning left or right with the car controller, one motor is set to rotate forward while the other is set to rotate backwards. This rotational imbalance between the two motors allows the motors to steer almost on the spot. The problem is that with a timeout period of 400ms, a simple left or right turn results in the car turning almost 180 degrees, making precise turns almost impossible.
- The easiest way to counter act this is to assign a lower timeout period (for instance 50 or 100ms). This will allow for more precise steering. The only problem is that forward and and back motions with the car controller will also be affected by this change as well. As most motions will probably be in the forward motion, it might be worthwhile creating a forward loop using shortcuts for forward motions (The use of the clock would be the easiest way, but be careful to input a value less than the timeout period and carefully control the stop function of forward and backward from the other inputs). Otherwise, it will require constant manual input every 50-100ms for the vehicle to move forward or backwards.
- Another way is to keep the default timeout period but manually create the logic for turning through small rotational differences between the motors. For instance if you set the speed to 100 for Motor 1 and give a speed of 60 for Motor 2, the car will rotate in the direction of Motor 2 due to Motor 2 rotating slower than Motor 1. In effect, Motor 2 becomes the point of rotation for the whole vehicle. This exercise could be done many different ways through different rotational differences between the motors. But be careful, the maximum rotational difference you can have is 200 (i.e. between -100 and 100). The larger the difference, the more angular the rotation will be. You can measure this angular velocity using the IMU Block.
- You could also use a COUNTER Gate to increase the rotational difference for extended turn inputs. In this case, with each new turn input, there can be a linear or non-linear change in the rotational difference between Motors, creating more aggressive turning each successive input. Again, the maximum rotational difference you can possibly have is 200 (i.e. between -100 and 100). This would be similar to a sports car which have non-linear turning for each degree of steering wheel input.
As you can see, turning without a dedicated steering system is complicated. This could be a great way to familiarise yourself with turning dynamics by trying a number of different approaches to steering with the Kitsi Blocks. The best thing about is that you can rapidly prototype your idea very quickly.