Saturday, August 6, 2016

FZ-94 (1) – Bumping up MODBUS


In this first post on an improved FZ-94 setup for Artisan v1.0 we are focusing on the communication between the machine and the software. MODBUS RTU speed in Artisan prior to v1.0 was limited by an issue in an underlying library. That resulted in each request/replay pair to take at least the amount specified by the serial timeout parameter, which defaults to one second.

The time needed to read one MODBUS input channel from the FZ-94 in Artisan prior to v1.0 was about 1.0057s. In Artisan v1.0 this reduces to 0.016s using the standard setup as described in our post "Connecting Artisan to a Coffee-Tech FZ-94 Lab Roaster", more than a year ago.

Because this was discovered and fixed and thus each single communication happened dramatically faster, it was possible to realize a retry-on-error strategy in Artisan v1.0 that resends a request on hitting a communication error. Those communication errors occur randomly, often caused by electro magnetic (EM) effects sent out by the motors in a roasting machine.

To reduce the number of communication errors one usually reduces the communication speed on the serial communication line. Up to now, the FZ-94 comes from the factory with the serial speed set to the lowest possible value, which is 2400 baud.

With that retry-on-error strategy implemented in Artisan v1.0, we can dramatically increase the serial communication speed without any negative effects on the data recording. If an error occurs, Artisan will silently re-request the corresponding data.

The three temperature PIDs in the FZ-94 are of type MTA-48 from MaxWell. According to the manual, they support serial speeds up to 19200 baud.

The baud rate needs to be set for all devices of a MODBUS ring to the same speed. Since the FZ-94 has one MODBUS ring, we have to change the baud rate on all 3 PIDs, as well on the Artisan side in the MODBUS tab.

Here are the three steps we have to perform on each PID.

1. Disable the data lock


First we have to disable the "Set data lock" (LCK) on all three PIDs. The two MTA-48 on the left side, reading bean temperature (BT) and environmental temperature (ET), have the data lock set to "Not allow to modify any parameter" (LCK=2). The last MTA-48, the one on the right reading drum temperature (DT) has the data lock set to "Only allow to modify SV and AT", as this one allows to set the drum heat limit via the SV parameter.

  • press the "Set" key for 3 seconds to access the Level 1 parameters
  • press the "Set" key repeatably until "LCK" is displayed
  • change the value of the "LCK" parameter to "Allow to modify any parameter and SV" (LCK=0)
  • press the "Set" key for 3 seconds to return to the normal display

2.  Set the baud rate to 19200


The baud rate is a Level 2 parameter of the MTA-48. We first have to enter that Level 2 and then change the value of this parameter.

  • press the "Set" key and the left arrow (Shift) key simultaneously for 3 seconds
  • once "PASS" is displayed, enter PASS=0101 then press the "Set" key again to enter parameter Level 2
  • press the "Set" key repeatably until "bAUd" is displayed
  • press the up and down keys until "19.2" is displayed
  • press the "Set" key for 3 seconds to return to the normal display


3. Re-enable the data lock


  • press the "Set" key for 3 seconds to access the Level 1 parameters
  • press the "Set" key repeatably until "LCK" is displayed
  • change the value of the "LCK" parameter to 2 "Not allow to modify any parameter" on the ET and BT PID to the left and to 1 "Only allow to modify SV and AT" on the DT PID to the right
  • press the "Set" key for 3 seconds to return to the normal display


Don't forget to set the MODBUS speed in Artisan to 19200 as well (menu Config >> Serial Port; MODBUS tab).



Now you can also choose a faster sampling interval, either 1 second with oversampling disabled or 2 seconds with oversampling enabled. The effect of this fast sampling is seen at the very and of the nice FZ94 trailer by Frans & Roemer. Check the flashing speed of the PIDs communication LEDs!





NOTE: Please, study the linked manuals of the devices to understand the implications of any modifications you undertake as well as possible. Remember that you yourself are responsible for making sure the modifications are understood correctly and carried out precisely with care and common sense. We prepared our posts as careful as possible, but do not take any responsibility for remaining errors, mistakes or bad consequences that may result from you modifying any device based on the information given here.

No comments:

Post a Comment