How to create field collection item fields programmatically? first of all, English is not my native language so sorry if this reads bad.

I'm trying to program a field collection with field collection item fields like the code as given by rbruhn here: https://drupal.org/comment/4653514#comment-4653514

I want to create it on an easier leavel for testing purposes. My goal is to create a taxonomy reference dropdown and a textfield.

I manage to reproduce the field_collection type. Hower, I can't reproduce any field collections item fields. Let's say I want a textfield in my field collection. 

creating an ordinary textfield field collection item field, this would make sense to me (but it doesn't work). Can someone tell me what I do wrong? Instead of appearing inside my field collection it appears as a field inside my node which contains my field collection field

array(
  'field' =&gt; array(
    'field_name' =&gt; 'name_of_my_field',
    'type' =&gt; 'text',
    ),
  ),
  'instance' =&gt; array(
    'field_name' =&gt; 'name_of_my_field',
    'entity_type' =&gt; 'field_collection_item',
    'bundle' =&gt; 'name_of_my_field_collection_field',,
    'widget' =&gt; array('type' =&gt; 'text_textfield'),
  )
),
This works for me (my field collection is called field_fc_test). I imagine the problem is with the way you are calling field_create_instance. 

$new_field = array(
  'field' =&gt; array(
    'field_name' =&gt; 'name_of_my_field',
    'type' =&gt; 'text',
    ),
  'instance' =&gt; array(
    'field_name' =&gt; 'name_of_my_field',
    'entity_type' =&gt; 'field_collection_item',
    'bundle' =&gt; 'field_fc_test',
    'widget' =&gt; array('type' =&gt; 'text_textfield'),
  ),
);
field_create_field($new_field['field']);
field_create_instance($new_field['instance']);