Skip to main content

FLL EV3 Robot

This blog post is about our current EV3 robot we're planning to use in the 2023/2024 FLL competition. Some features: 2 large motors for steering. 2 medium motors for attachments.  2 colour sensors for picking up the white and black lines, also used for line squaring. 1 gyro sensor. To enable attachments to be changed as quickly as possible we're using gravity to keep the gears connected, i.e. you don't need to fasten anything to the robot. Every attachment has 2x 12 tooth double bevel gear (part 32270) which comes in contact with the 2x 20 tooth double bevel gears (part 32269) on the robot. The medium motors are horizontally aligned on the robots, but we use 12 tooth double bevel gears to convert that to vertical alignments. These in turn are connected to 20 tooth double bevel gears, and the attachments in turn connect to these 20 tooth double bevel gears with their 12 tooth double bevel gears.  The complete robot is modelled in Bricklink Studio 2 . You can download the rob

Network simulator: DummyNet on Hyper-V

DummyNet allows us to shape a network (latency, upload & download speeds). It runs on FreeBSD. In this example Hyper-V will be used to create a VM that acts as a bridge between two networks (switches).

Create new private switch

You also need to create a new private switch. The idea is that DummyNet will be installed between a server and your normal network (switch). So instead of connecting the server to your normal switch, connect it to the private switch. DummyNet will act as a bridge between the private switch & normal switch, meaning traffic on one network will be replicated to the other network and vice versa, plus it will shape the traffic.


Install FreeBSD

Download FreeBSD 10. You only need the CD ISO as we’ll install a bare system.
Create a new VM called DummyNet with 128 Mb RAM, 2GB harddisk and 2 network interfaces. The first interface must be connected to your normal network, and the second interface to your private network created above.
Important: On both network adapters enable MAC Address Spoofing (under Advanced section). This must be enabled for the bridge to work. 
Install FreeBSD. Do not install any additional packages.

Partition: Select Guided, whole disk and click on Finish

On network configuration select Cancel – we’ll do the configuration later.

Reboot the system & log in.

Create /etc/rc.conf.local with the following contents:
cloned_interfaces="bridge0"
ifconfig_bridge0="addm hn0 addm hn1"
ifconfig_hn0="up"
ifconfig_hn1="up"

Restart.

Test Bridge

To test the bridge, create another VM with one network adapter linked to your private network. From this VM you should be able to access the normal network as before. If you can’t it means there is something wrong with your bridge configuration.

Configure DummyNet

Edit /boot/loader.conf and add
dummynet_load="YES"
autoboot_delay="-1"
The autoboot delay is optional – this will override the default 10s delay when booting.

Edit /etc/sysctl.conf and add
net.link.bridge.ipfw=1
net.link.ether.ipfw=1
Edit /etc/rc.conf.local and add
firewall_enable="YES"
firewall_type="open"
firewall_script="/etc/ipfw.rules"
Create /etc/ipfw.rules with the following contents:
ipfw -q flush                                   
ipfw add pipe 1 ip from any to any
Reboot.

Confirm you can access your network from your private network. If not something is wrong with your DummyNet configuration.

Now configure your network for a latency of 100ms and bandwith of 1024kbits/s with no packet loss. On the DummyNet VM, log in & type the following command:
ipfw pipe 1 config delay 100ms bandwidth 1024kbit/s plr 0
The delay is the latency (100ms is a very slow network), bandwith is the speed for uplink & downlink, plr is packet loss ratio, set to a non-zero value to simulate lost packets - 0.01 means 1% of the packets will be lost.

To view the current status:
ipfw pipe 1 show 
 Enjoy!

Comments

Popular posts from this blog

Installing Lego Digital Designer (LDD) on Windows 10

If you're using Windows 10 18.09 or later and try to install Lego Digital Designer (LDD) 4.3.11 you'll probably get an installation error for Adobe Flash Player. However, there is an easy way around it: Download the installation file for LDD 4.3.11. Rename the .exe file to .zip. If you don't see the .exe extension in Explorer, go to "View - Options" on the Explorer menu, then under the "View" tab deselect the "Hide extensions for known file types". Open the zip file with Windows Explorer. Copy all files in the zip to another directory on your computer. In the new folder: Delete install_flash_player_active_x.exe. Copy OpenGLChecker.exe and rename it to install_flash_player_active_x.exe. Run LDDSetup.exe. In short the installer will execute install_flash_player_active_x.exe during the installation process, but all it does now is to execute the same logic as what OpenGLChecker does. In theory you can run any .exe that will not retu

OpenWRT 3G connection checker & logger

A 3G connection is normally not very stable - so we need something to periodically check it & reconnect when needed. I also wanted a summary email at the end of each day with the total traffic per client. I'm using the following settings/scripts: Edit /etc/crontabs/root (create if not existing): # send stats & disconnect 3G at 23:00 everyday. # check the connection every 5 minutes between 5:00 and 23:00 and reconnect if needed # reboot at 5:00 if /tmp/stats.msg doesn't exist - will be sent in checkconnect */5 5-22 * * * /usr/bin/checkconnection 0 5 * * * if [ ! -s /tmp/stats.msg ]; then reboot ; fi 0 23 * * * /usr/bin/sendstats && ifdown wan The first line will run /usr/bin/checkconnection every 5 minutes between 5:00 and 22:59. Then at 23:00 the  day's statistics will be emailed and the 3G connection disconnected. The next morning at 5:00 it first checks if the email was sucessfully sent at 23:00, if so it will reboot the router (seems to be m

Windows Hyper-V Server 2019

This post will explain how to use the free Hyper-V Windows 2019 Server version. This version doesn't come with any GUI interface as provided in the full Windows 2019 Server version. Instead it comes with a character interface, but with the help of some third party tools you can easily get a fully functional Hyper-V server for free. The following will be assumed: You have a dedicated server connected to a network and you want to install Hyper-V 2019 on this server to run Virtual Machines and/or act as a file server. You have physical access to this server to do the installation. You have another machine connected to the same network to do remote management, running a recent version of Microsoft Windows. You don't want to join a domain or use Active Directory. You can do this if you want to, but this is not included in this post. First you'll need to download the Hyper-V 2019 ISO from  https://www.microsoft.com/en-us/evalcenter/evaluate-hyper-v-server-2019 . You’ll