Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erweiterung Lernfabrik 4.0 #5

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

MoBoo
Copy link
Contributor

@MoBoo MoBoo commented Dec 12, 2019

1. Normal Working Mode

  • Standard Lernfabrik 4.0 Funktionalität und Arbeitsweise

2. Store-after-Produce Working Mode

  • Extends Normal Working Mode: Stores produced workpiece back into HBW.
    • Normal Working Mode -> from DSO and put into Delivery DSI -> From DSI Delivery store in HBW, but keep processed State.
    • If DSI is blocked by another Delivery, that Delivery is processed first and then Store-after-Produce is continued.
  • Pickup Workflow
    • MQTT-Message (topic: f/o/pickup): Pickup Workpiece by ID from HBW and put in DSO
    • Message-Body: {"ts": "<%Y-%m-%dT%H:%M:%S.000Z>", "id": "<nfc tag_uid>"}
  • Store Workflow
    • MQTT-Message (topic: f/o/store): Pickup Workpiece from DSO and put back into HBW
    • Message-Body: {"ts": "<%Y-%m-%dT%H:%M:%S.000Z>"}

3. Endless Working Mode

  • After Delivery, the delivered Workpiece is queued for automatic ordering.
  • Ordering takes precedence over Delivery.
  • After Production a workpiece the Store-after-Produce Workflow is triggered, but Workpiece is treated as a newly delivered Workpiece (State RAW)

Change Working Mode:

  • Working Modes can be iterated by using the Joystick (J1) and pull down. After working mode is changed a sound is played to indicate a working mode change.

Improvements:

  • Orders and Pickups are stored in Queues: Orders can be queued, so no order is lost
    • Example: Order two diffrent Workpieces back to back asap -> only a single order is taken.

BugFix:

  1. If Order-Message asks for workpiece of type, but type is not available, HBW faults and stay in FAULT State until an Acknowledge Message is send.
    • Problem: VGR does not notice the fault of HBW and stays in "VGR_WAIT_FETCHED" forever.
    • Solution: If HBW Faults, a mqtt-message is published and VGR also switches to FAULT Mode. Acknowledge Message does reset both HBW and VGR.

Things to consider:

  • Publish Queue States to MQTT: How many and which Items are in which Queue and which order.
  • Publish MQTT-Message when working mode is changed
  • Make Working mode changeable by MQTT-Message
  • TxtVaccumGripperRobotRun.cpp (line 1019) "case PICKUP2DELIVERY" may be refactored to use "case STORE_FROM_DSO" (line 1068)

MoBoo and others added 15 commits November 27, 2019 15:41
Hallo Herr Steiger,

ich habe heute auf die neue Firmware (4.6.6) und die Txt-Version 0.8.0 gewechselt und es scheint als würde das Quittieren von Fehlern in der Cloud nicht funktionieren.

Es wird zwar der Timestamp über MQTT veröffentlicht, und der VGR bekommt auch die entsprechende MQTT-Nachricht, verwirft diese aber (!!!)

In TxtFactoryClient.cpp wird der Timestamp in der MQTT-JSON-Nachricht geprüft, ob dieser im 10-Sekunden Fenster liegt.
Allerdings wird der return der trycheckTimestampTTL negiert (!ft::trycheckTimestampTTL), das dürft meiner Meinung nach nicht sein.
Sonst müsste in der MQTT-Nachricht ein Timestamp angegeben werden der mindestens 10 Sekunden von der aktuellen Zeit abweicht.

Dies sind die entsprechenden Code-Stellen.
Utils.cpp (ft::trycheckTimestampTTL)
https://github.com/fischertechnik/txt_training_factory/blob/master/TxtSmartFactoryLib/src/Utils.cpp#L64

TxtFactoryClient
https://github.com/fischertechnik/txt_training_factory/blob/master/TxtFactoryClient/src/main.cpp#L316


Mein Test Setup:
-	Werkstück in SLD einlegen und nach der Farberkennung entfernen.
-	VGR fährt zur Abholposition
-	NFC wird geprüft  Error
-	VGR befindet sich in Error-State
-	Über Fischertechnik-Cloud Dashboard/MQTT-Nachricht (Topic f/o/state/ack) Nachricht veröffentlichen
o	mosquitto_pub -u txt -P xtx -t f/o/state/ack -m "{\"ts\": \"$(date -u +'%Y-%m-%dT%H:%M:%S').00Z\"}" -h 192.168.0.10
-	VGR erhält Nachricht, Timestamp wird validiert (erfolgreich) -> Negierung in IF-Statement
-	VGR bleibt im Error-State


Freundliche Grüße,
Mark-Oliver Masur
…ATE_ACK

Fix Bug with Error-Acknowledgement-Messages
MQTT-Acknowledge Messages Timestamp Check Bugix (#3)
Append env-var check, to make sure TOOLCHAIN_BIN_PATH is set.
2. Add Endless Working Mode
3. Add Pickup Workflow
4. Add Store Workflow
…to support custom mqtt client ids and prefixes. Configurable through /opt/knobloch/Data/Config.Client.json: 'mqtt_client_id': '<client_id>' and 'mqtt_prefix': '<prefix>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant