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...

Install OpenWRT 14.09 on TP-Link MR3420 with Huawei E353 3G dongle

This post will describe how to install OpenWRT 14.09 on a TP-Link MR3420 router, plus configure it to use a Huawei E353 3G dongle to connect to the internet. First download the firmware, plus extra packages we'll need later. Store this on your computer: http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3420-v1-squashfs-factory.bin http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/kmod-mii_3.10.49-1_ar71xx.ipk http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/kmod-usb-net_3.10.49-1_ar71xx.ipk http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/kmod-usb-net-cdc-ether_3.10.49-1_ar71xx.ipk http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/kmod-usb-net-rndis_3.10.49-1_ar71xx.ipk http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/libpthread_0.9.33.2-1_ar71xx.ipk http://downloads.openwrt.org/...

8051 ROM replaced with SRAM

Compare this schematic to the 8051 schematic posted earlier. U6 (2764 8kb ROM chip) was replaced with a 6264 8kB SRAM chip. The idea is that the 8051 will still be able to access this chip as an external ROM chip using PSEN#, but also as external RAM. This way it is possible to download firmware to SRAM and execute the firmware as if it was stored on ROM. Comparing the DIP pinouts between SRAM (6264 8kb SRAM) and ROM (2764 8kB ROM), we can see that the two chips follow more or less the same pin layout, except for the address pins: Pin SRAM ROM 1 N/C Vpp 2 A4 A12 3 A5 A7 4 A6 A6 5 A7 A5 6 A8 A4 7 A9 A3 8 A10 A2 9 A11 A1 10 A12 A0 11 D0 D0 12 D1 D1 13 D2 D2 14 Gnd Gnd 15 D3 D3 16 D4 D4 17 D5 D5 18 D6 D6 19 D7 D7 20 CE1# CE# 21 A0 A10 22 RD# G# 23 A1 A11 24 A2 A9 25 A3 A8 26 CE2 N/C 27 WR# P# 28 Vcc Vcc To enable the SRAM to respond to ROM access and RAM access, we need to add logic to the chip select and output enable pins. Chip select (CE1# and CE2): The SRAM should be selected either...