Acceleration is a measurement of how quickly something speeds up or slows down. The ActivityBot's acceleration can be adjusted, which will be important in some robotic applications. Some examples:
The ActivityBot robot's acceleration can be adjusted with the Robot set acceleration block.
Choose the speed option for use with Robot drive speed blocks, choose distance for use with Robot drive distance blocks. The acceleration setting for distance maneuvers is typically slower to help improve accuracy. The acceleration setting for speed is usually a little faster to give the robot more peppy responses in sensor navigation.
You can also change the maximum speed limits for Robot drive speed and Robot drive distance maneuvers.
The default speed limit for Robot drive speed is 128 ticks per second. Even though your code can change the speed at any time, there are some cases when sensors and variables might work together to ask for some unreasonably high speeds. Limiting the speed with this block can prevent some "runaway" conditions.
The default speed limit for Robot drive distance maneuvers is 64 ticks per second. That's the cruising speed the ActivityBot reaches while on its way to its distance goal, unless you use this block to change it. For transporting a drink, it might be safer to pick a slower cruising speed. In a timed dead reckoning navigation contest, you might want to experiment with higher cruising speeds.
This example sets the acceleration and cruising speed for Robot drive distance blocks to high values while it drives forward, then resets to low values while it drives backwards. The overall traveled for both maneuvers is the same, so the ActivityBot returns to where it starts. As you watch your robot go, pay close attention to two things:
The first block in the program is a comment noting the project name. The second block is frequency out, which makes a piezospeaker tone. If that tone plays in the middle of the program instead of at the beginning, it could indicate that the batteries are low. The third block is the required ActivityBot initialize. These first three blocks are used in all example programs that make the ActivityBot move.
Next, Robot set acceleration block is configured for distance at 600 ticks/s2. The Robot set max speed block is set for distance, at 128. That determines the Robot drive distance block's target cruising speed, which is 2 full revolutions per second. After these settings, the first Robot drive distance block makes the ActivityBot go 256 ticks forward. The high acceleration setting causes the ActivityBot to speed up and slow down abruptly, while the high Robot set speed setting directs the ActivityBot to use a high cruising speed to travel the distance.
When your robot completes the first maneuver, the next set of Robot set acceleration and Robot set max speed blocks have much lower values. Then, a Robot drive distance block tells the ActivityBot to back up the same distance it just went forward, 256 ticks. You will see that with the new acceleration setting of just just, 50 ticks/s2, the ActivityBot only gradually speeds up and slows down. With the new max speed of just 64, the cruising speed is slower.
What's in a name? — The acceleration setting in the Robot set acceleration block is in units of ticks per second squared. It does not matter if your Robot drive distance blocks are also using ticks, or centimeters, or inches. The result will be the same.
Setting the acceleration Robot drive speed blocks is about the same as it is for distance maneuvers. The next project shows the effect that different acceleration settings have, when speed and drive time are the same.
This time, the robot does not make it back to where it started. The robot drive speeds were the same in both directions (+/- 128) and the drive time was the same, pause (ms) 2000. So what happened? Going forward, the acceleration setting was 600 ticks/s2 but going backwards, the setting was only 300 ticks/s2. The slower acceleration rate makes it take longer for the robot to reach full cruising speed, so it wasn't able to travel the same distance in the same amount of time.
Now, let's add the effect of constraining the max speed in the driving-backward maneuver.
After driving forward the same distance as last time, how far did it make it back? It should stop even further from the starting point. Why?