rfid-cocktail-bot is a smart, interactive cocktail ordering system that integrates RFID token-based ingredient selection, an ESP32 based Ordering and Pick-Up Station, a JavaScript server, and a UR cobot for automated drink delivery. The system logic is orchestrated via the CPEE process engine.
- RFID Tokens: Represent individual drink ingredients.
- Ordering Station (Input): Shows selected ingredients, confirmed order number, and the status of drink placements.
- Pick-Up Station (Output): Shows the free output spaces, the order number, and placement.
- UR Cobot: Executes drink delivery actions.
- JavaScript Server: Implements and handles CPEE process endpoints, acting as a communication bridge between the CPEE engine and the hardware interface layer.
- CPEE Process Engine: Manages the process workflow and communicates with the server via HTTP requests.
The drink-serving logic is orchestrated by the CPEE process model:
- Refresh the Server: Clears all variables stored from the previous run.
- Wait for Orders:
Sends aCALLBACKURL to the server and waits.
When a new order is submitted by a user, the server responds with anUPDATE, pushing the order into theorder_listarray in CPEE.
- Check Order List:
Continuously loops to check if there is at least one pending order. - Fulfill First Order:
Retrieves the first order from theorder_listand assigns it to theserve_ordervariable. - Timeout (Preparation Simulation):
Simulates a drink preparation delay. - Find an Available Position
Sends a request to the server to getglass_x, glass_y, available_position.- A fixed 2×5 grid of glasses is used cyclically, so refilling is only needed after every 10 orders.
- The server determines the available output position based on
weight cellreadings. If all positions are occupied, it stores theCALLBACKURL and retries every second until one becomes free. - The LED display is updated with the assigned output position.
- Send Coordinates to UR Cobot:
The CPEE sendsglass_x, glass_y, available_positionto the UR cobot. - Serve Drink:
The UR cobot picks up the glass from position(glass_x, glass_y)and places it atavailable_position.
The task is completed after receiving a response from the UR cobot, indicating that the actions have been successfully executed. - Mark Order as Finished:
Informs the server that the process has been completed.- The finished order is moved from
order_listtoorder_history. - The
serve_ordervariable is cleared.
- The finished order is moved from
The parallel structure ensures continuous order reception while drinks are being prepared and served.
-
Selecting Ingredients:
- Each RFID token corresponds to a drink ingredient.
- Toss an RFID token into the reader ring (input) to select an ingredient.
- Once a token is read, the corresponding ingredient name is displayed on the LED screen.
- If more than four ingredients are selected, the extra tokens will be ignored.
-
Confirming or Clearing Selection:
- Red Button: Clears the current ingredient selection.
- Green Button: Confirms the order.
- Upon confirmation, a unique order number is generated and displayed on the LED screen.
- The system then simulates drink preparation with a 10-second timeout.
-
Drink Serving:
- The UR cobot places the finished drink at an available position in the pickup station (output).
- The LED display shows current order numbers at each position (e.g.,
0:101, 1: , 2: , 3:). - Once a user picks up the drink, the corresponding position is cleared (e.g.,
0: , 1: , 2: , 3:).
- User drops 3 RFID tokens into the reader (input).
- LED screen shows:
Vodka, Lemon Juice, Soda. - User presses the green button to confirm.
- LED shows:
Order number: 102for 10s. - After the drink is prepared and placed by the UR cobot (output), the LED updates the serving station status:
0:102, 1: , 2: , 3:
(The drink has been placed at position 0).
To run the system:
- Connect all hardware components (RFID reader, LEDs, buttons, weight sensors, etc.).
- Power on the UR cobot and start the cobot-side server.
- On the lehre.bpm server:
SSH into the target machine, then run:cd /srv/gruppe/students/ge27zap/endpoint/ node server.js - Access the CPEE Process Model:
Launch the Main_process via the following path: /Teaching/Prak/TUM-Prak-24-WS/Jingyi Tang/restructured