【Test Projest】For the New Products Test Project


#1

I thought most of the guys start to receive the package recently. That’s great.

Before we start, let me make a announcement of this project.

  1. There are still some problem of gear, gear rods, big rotatry table, and stepper motor until I send them. Some of you may get them because the delivery time is not same. I have got some of them from factory, but still not enough.

  2. It would be nice if you can write down your opinion on the forum and have a discussion with others. If you got both the mechanical parts and electronic modules, you can split them in different category.

  3. Some of you may got the stepper motor driver module and encoder motor. For the encoder motor, visit here to know how to use it.

  4. New products test project is an on-going project. It would not be just this time. When we start to talk about the products you have received, I think it’s time to prepare the next test project. There must be somewhere is not very ideal. So please take about anything about this project.

Here we go !!!


#2

Hi Johnny,

the new Me-Baseboard ist just fantastic, works fine, everything on one circuit.

I have problems starting with the Me-Encoder Motor Driver.
The makeblock library has been changed today. Reading the sample code MeEncoder.ino from your ZIP file I noticed:

  1. the runWithAngleAndSpeed function is not part of the library any more.
  2. The motor slot selection has been moved to the MeEncoder constructor MeEncoderMotor encoder(0x08, 0); and the motor slot parameter was removed from the other functions
  3. As a first try, I replaced runWithAngleAndSpeed() by moveTo(), but the moveTo() function always returns false as result and the motor does not turn.

Seems I need some help to get the motor turning.

Kind regards,
Thorsten


#3

Yeah, we have change the library. The bootloader has also been changed. I will upload the new example code and bootloader immediately.@indream is testing on it.

Thank you.

How about other parts, the rotatry table and gear?


#4

1, download the file EncoderDriver.zip (20.7 KB) and unzip it. Then you should use USB-TTL Cable burn the driver code to the encoder driver module. There is a MCU on the module.

Just like the pictures below,

Driver Vcc -> 5V USB TTL
GND -> GND
TX -> TXD
RX -> RXD

And, make sure you choose Arduino UNO in arduino IDE.

Push the reset button on the encoder module when the code just finish compiled and start uploading.

2, update the library (v2.1.0318 at least). We have add an example code of encoder motor.

That’s all. Please post everything you got when you use that. Thanks!


How to Use Encoder Motor in New Products Test Project
#5

Hi Jimmy,
thank you for your detailed update description.

Uploading/Updating the new Me-Encoder sketch on the Me-Encoder board turned out to be more complicated, than I would have expected.
I do not have a USB-TTL Cable, but the USB to serial adapter Foca 2.2.
http://imall.iteadstudio.com/im120525005.html
I guess cable and adapter may use the same or a very similar FDTI chip.

I’m currently stuck with a “not in sync” message:

$ /usr/bin/avrdude -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:EncoderDriver.cpp.hex:i
avrdude: stk500_getsync(): not in sync: resp=0x00

I can see the Me-Encoder is reset automatically prior to trying the code upload but then fails uploading “out of sync”.
This could have different causes, from missing bootloader, wrong arduino type to … see http://arduino.cc/en/Guide/Troubleshooting#toc1

As alternative approach - is it possible to use the (MOSI,MISO,CLK,RST) connections?
Does the Me-Encoder use the Uno bootloader or something specific?

Kind regards,
Thorsten


#6

Hi @thorsten

I agree with you that the USB-TTL Cable and USB to serial adapter is same. I think you should try to push the reset button on the encoder module when the code just finish compiled and start uploading.


#7

Hi Jimmy,

yes, I’ve tried several things, reset the board manually, use the DTR line to reset automatically, swapped the RX/TX lines (a typical trap for the foca 2.2 board), added external power to the MeEncoder board and also tried different serial communication speed settings from 9600 to 115200.
I basically got one of these two messages for each setup:

  • programmer is not responding … (most combinations)
  • out of sync error message … (with RX/TX crossed and DTS connected).

The out-of-sync was the only setup, when the MeEncoder was reset automatically prior to the upload step.
So at least one step in the right direction.

Today I’ve tried a different approach - the ISP connections on the MeEncoder with my USBtinyISP programmer.
The USBtinyISP is usually the more reliable programmer, as it does not rely on a bootloader.


Me-Encoder Motor Driver and USBtinyISP
Cable colors used: red=5V black=GND green=MOSI white=MISO orange=SCK blue=RST

Sadly this programmer did not work either with the Me-Encoder.
Here’s the command & error message I’ve tried to upload the sketch:

$ avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -q -q -patmega328p -cusbtiny -Uflash:w:EncoderDriver.cpp.hex:i
avrdude.orig: initialization failed, rc=-1
              Double check connections and try again, or use -F to override
              this check.

“initialization failed, rc=-1” is usually just a cable issue … so I’ve tried the same cable with my Arduino Nano:


Arduino Nano and USBtinyISP

Hooray - I could upload the blink sketch!
So the programmer and cable both are generally working.

Both the nano and the MeEncoder use the same chip, I’ve used the same programmer, same cable and the same IDE settings (Board=Uno, Programmer=usbtiny) - could it be that there is a problem with the ISP pins/the MeEncoder?

Is the way I have used the ISP (MISO,MOSI,SCK,RST,Vcc,GND) correct?
Is there a chance to test/check the MeEncoder board?

Kind regards,
Thorsten


#8

@thorsten, please wait me a few hours. I’m a little confused about it too. I got a instruction from our engineer. Maybe it should help you figure our the problem. I’m translating it to English.


#9

@thorsten, you might need to try this.
1, Get the example program and upload it to the arduino

2, Choose Tools->Programmer->Arduino as ISP

3, Open the driver code and connect the cable. Choose File-> Upload Using Programmer. Then you can start uploading.

There are 6 cables, which are connected to the pins on Arduino: 5v、Ground、10,11,12,13. They should be connected to pins on Encoder which is 5v、ground、RST、MOSI、MISO、SCK respectively.


#10

Hi Jimmy,

thank you for your detailed description.

Your using an Arduino as an AVR ISP programming method - clever idea.
That got me a big step forward.

Here’s the setup I used:

The Arduino Nano has nearly the same Input/Output pins compared with an Arduino Uno, but not always at the same position. See the Arduino Nano board foto on arduino.cc.

In the meantime I’ve also attached a power supply to the MeEncoder now, to ensure there is enough power for a correct communication.

So here’s the latest output:


$ ./avrdude -Cavrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -t -b19200

avrdude: Version 5.11, compiled on Sep  9 2011 at 16:00:41
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "./avrdude.conf"
         User configuration file is "/home/thesemey/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [02] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [01] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [12] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [98]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
avrdude: Send: A [41] . [84]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [85]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [86]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [87]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [89]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [01] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [12] 
avrdude: Recv: . [10] 
avrdude: Send: B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [04] . [00] . [00] . [00] . [80] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: E [45] . [05] . [04] . [d7] . [c2] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: P [50]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude: Send: V [56] 0 [30] . [00] . [00] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [ff] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] 0 [30] . [00] . [01] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [ff] 
avrdude: Recv: . [10] 
Reading | #################                                  | 33% 0.04savrdude: Send: V [56] 0 [30] . [00] . [02] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [ff] 
avrdude: Recv: . [10] 
Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.

Even with an external power supply the Device signature is sometimes different, I’ve also seen 0x000000 or even 0x7f7f7f.
Whereas the correct value would have been 1E 95 0F.

Just to be complete: I also tried different baud rates and got either in “out of sync” or “does not respond” error messages.
Note: I also verified I connected everything correctly by programming the example blink sketch on a single MCU ATTINY85 chip, just as described in Program an ATtiny with Arduino on instructables.

Kind regards,
Thorsten


#11

Hi @thorsten

It’s a little strange about the error about the ISP method…

Do you have a Meduino or Arduino UNO ? We can unplug the chip (ATmega328) on the Meduino. Then it could be used as a TTL downloader. Finally, we go back to TTL again…

For the connection type, you can follow the pictrues below,

Open the EncoderDriver.ino and choose UNO in Tools->Board, then you can upload the driver program directly.


#12

Hi Johnny,

yes, I understand your idea, but I do not have a board with a MCU to unplug.
I checked all my boards, not a single one with a socket.

Would purchasing a different serial adapter like the USB Serial Light Adapter or the FTDI Friend make sense?

Kind regards,
Thorsten


#13

Hi @thorsten

Yeah, I think you can try it


#14

Good, I’ve ordered the [FTDI Friend][1], I expect it to arrive by end of this week.
Will do further updates, when I’ve received it.
[1]: http://www.adafruit.com/products/284


#15

Awesome - the Me-Encoder motor driver is really fantastic.
You can tell it to move to a 180° angle and it just does it all by itself.
Wow!


Let’s quickly sum up all four solutions necessary to solve the update problem noted above:

#1 Use a Power Supply

The Me-Encoder has the power jack for a reason, please use it!
Just attach a 9V or 12V power supply to the Me-Encoder and it will run stable.

#2 Check the cable

One of the brand-new jumper wires used was broken.
My continuity tester did not detect the broken cable, but replacing the complete set of jumper wires (together with using the power supply noted above) was the main step forward solving the issue.

#3 FOCA Serial Adapter

I am not sure if this is special only to the FOCA 2.0 serial adapter or not, but here is what I have found:
a) cross RX and TX lines with the Foca board (other adapters are different).
b) do not disconnect/reconnect cables while it is still powered on.
For some reason the FOCA serial adapter will refuse to work, after you modify the cabling while it is still powered on.
Best practice here: power off, change hardware, power on again, test.

#4 Connect RX-RX, TX-TX or Cross the RX/TX Lines

Another simple test if you need to cross RX and TX lines:

  1. Connect the serial adapter to your PC (choose one way to start with)
  2. verify which COM / serial port is used on the PC by your adapter
  3. start a serial terminal program on your PC
  4. connect with 9600,8N1 to your COM port
  5. press the reset button on the Me-Encoder
    The Me-Encoder sends its I2C address via the serial port after power on or reset.

If you can read the I2C address in the serial terminal, your cable is working fine.
If you do not receive anything, try the other, alternative cabling option (either RX/TX crossed or in parallel) is the right one.
Nice side effect - it is helpful to know the devices’ I2C address anyhow.

I hope my short list can someone in a similar cases.

Kind regards,
Thorsten


#16

@thorsten it’s very great that you have figured out the the problem finally. :smile:

And that’s very kind of you got a so complete summary. Communicating with you helps us figure out lots of problem which we have not noticed before. And I think most of your suggestions could be a part of FAQ when we list the product on our website.

Thanks !!!


#17

Using Makeblock Encoder Motor Driver and UART FTDI232-1 installation of contacts:

Driver USB UART
GND >>> GND
5V >>> VCC
RDX >>> RX
TDX >>> TX
For USB UART driver downloaded CDM v2.12, before programming the driver writes the firmware EncoderDriver.ino (http://forum.makeblock.cc/t/test-projest-for-the-new-products-test-project / 435/11 ) for coding the driver when you use the Encoder Motor Tool can not connect and read settings (key get), although the display connection is present.


#18

Is the latest firmware of the EncoderMotorDriver available for download? Library v2.1.0916 seems to use a more advanced packaging of the i2c messages than the firmware posted by Johnny on 18-mar-2014…

Joep.


#19